Fax Xon

Findus
Findus used Ask the Experts™
on
Hi I have a problem on phase C. I wait for Xon from my modem after the command "AT+FDT" (I have a fax modem class 2.0) but I don't receive it. I use mscomm control and vb 6.0. What should I do? Sorry for my English...
Thanks to all...
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

If you do set the handshake value to comRTS or comRTSXOnXOff or comXOnXOff, you need to set the RTSEnabled property to True. Otherwise, you will be able to connect and send, but not receive, data.


I don't understand why you are trapping for the XON/XOFF.  THe Commcontrol whould manage this for you automatically.

Commented:
Hi findus, I'm writing a program to send fax. I have a problem in phase C. The data aren't send to fax! Why? I don't know. I use a U.S. Robotics 56K professional message modem (class 2.0). This is the code:

Public Sub OpenCom()
   
   MSComm1.CommPort = 2
   MSComm1.Settings = "9600,N,8,1"
   MSComm1.InputLen = 0
   MSComm1.PortOpen = True
   
End Sub

Public Sub SetupModem()
 
   MSComm1.Output = "AT+FAA=0" & vbCr
   ReadModem
   MSComm1.Output = "ATH=0" & vbCr
   ReadModem
   MSComm1.Output = "AT" & vbCr
   ReadModem
   MSComm1.Output = "AT&F2X3S7=60" & vbCr
   ReadModem
   MSComm1.Output = "ATS0=0" & vbCr
   ReadModem
   MSComm1.Output = "AT+FCLASS=2.0" & vbCr
   ReadModem
   MSComm1.Output = "AT+FCR=1" & vbCr
   ReadModem
   MSComm1.Output = "AT+FLI=" & """" & "BIT" & """" & vbCr
   ReadModem
   MSComm1.Output = "AT+FLO=1" & vbCr
   ReadModem
   MSComm1.Output = "AT+FNR=1,1,1,0" & vbCr
   ReadModem
   MSComm1.Output = "AT+FHS?" & vbCr
   ReadModem
   MSComm1.Output = "AT+FIS=1,3" & vbCr
   ReadModem
   MSComm1.Output = "AT+FBO=0" & vbCr
   ReadModem
   MSComm1.Output = "AT+FEA = 0" & vbCr
   ReadModem
   MSComm1.Output = "AT+FCC=1,3" & vbCr
   ReadModem
   
End Sub

Public Sub ReadModem()
   Dim InString As String
   
   Do
      If MSComm1.InBufferCount Then
           InString = InString & MSComm1.Input
           List1.AddItem InString
             If InStr(InString, "OK") Then Exit Do
             If InStr(InString, "CONNECT") Then Exit Do
             InString = ""
           DoEvents
      End If
     DoEvents
   Loop

End Sub

Private Sub cmdSend_Click()

'Initialize Modem & Open Port
 If Not MSComm1.PortOpen Then OpenCom

'Set Fax Modem(CLASS 2.0)
 SetupModem

 'open g3file
   Open "c:\prova.tif" For Binary As #1
   
   MSComm1.InBufferCount = 0

   ''''''''''''''''''''''''''''''''
   'Phase A: Call establishment
   ''''''''''''''''''''''''''''''''
   
   MSComm1.Output = "ATDT" & "12345" & vbCr
   'wait OK from Modem
   ReadModem

   '''''''''''''''''''''''''''''''''''''
   'Phase B: Pre=message negotiations
   '''''''''''''''''''''''''''''''''''''''
   
   'Wait CONNECT from Modem
 
   MSComm1.Output = "AT+FDT" & vbCr
   ReadModem
   
   ''''''''''''''''''''''''''''''''''''''''''''
   'Phase C: Message Transmission
   '''''''''''''''''''''''''''''''''''''''''''''
   
   Send_File

   'Send <DLE> , <ETX> to Modem
    MSComm1.Output = Chr(16)
    MSComm1.Output = Chr(3)
         
   'Wait OK from Modem
   
   '''''''''''''''''''''''''''''''''
   ' Phase D: Post-pase 2 exchanges
   '''''''''''''''''''''''''''''''''''''
   
   MSComm1.Output = "ATH0" & vbCrLf 'Call hangup
   MSComm1.Output = "ATH0" & vbCrLf 'Call hangup
   Close #1
   
End Sub

Private Sub Send_File()
  Dim NumBlock As Integer
  Dim i As Integer
  Dim FileLength As Long
  Dim LeftOver As Long
  Dim stringa As String
  Dim BlockSize As Long
   
  BlockSize = 1024
  FileLength = LOF(1)
 
  NumBlock = FileLength / BlockSize
  LeftOver = FileLength Mod BlockSize
  stringa = String$(BlockSize, 32)
  MSComm1.Output = stringa
  For i = 1 To NumBlock
      If MSComm1.InBufferCount Then
        InString = InString & MSComm1.Input
        List1.AddItem InString
        InString = ""
      End If
      Get 1, , stringa
      MSComm1.Output = stringa
      DoEvents
  Next i
  stringa = String$(LeftOver, 32)
  Get 1, , stringa
  MSComm1.Output = stringa
 
End Sub


Thanks a lot
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
- award the points to Sector
Please leave any comments here within the
next seven days.
Per recommendation, force-accepted.

Netminder
EE Admin

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial