Results 1 to 15 of 15

Thread: RS-232 Serial data Processing using MS-COMM

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    5

    Question

    Hi,
    i am working on my project on MSComm .i need to receive the data from
    the source (PABX).When i attach the serial printer directly to the smdr port.
    of the pabx it starts printing automatically but on the other hand ,
    i am unable to read the same data.
    i am using a comm port 2.When i run the program comEvReceive is not on so it only displays "akssadasdsa....."
    but when i check with commevent comEvDSR then it shows that it is on.also it doesn't displays any error events.
    any help will be appreciated.mail me at [email protected]



    Dim ByteCount As Long
    Dim filedata As String

    Private Sub Form_Load()
    Dim Instring As String
    MSComm1.Settings = "9600,N,8,1"
    MSComm1.InputLen = 3

    Settings = MSComm1.Settings
    Threshold = 1



    End Sub

    Private Sub MSComm1_OnComm()
    On Error Resume Next
    If MSComm1.CommEvent = comEvReceive Then

    List1.AddItem MSComm1.Input

    Else
    List1.AddItem "akssadasdsa..."



    End If
    End Sub

    Private Sub Command1_Click()
    If Command1.Caption = "Start" Then
    If MSComm1.PortOpen = False Then
    MSComm1.CommPort = 2
    MSComm1.PortOpen = True
    Command1.Caption = "Stop"
    Settings = MSComm1.Settings
    MSComm1.RThreshold = CInt(Threshold)
    MSComm1.SThreshold = CInt(Threshold)
    End If
    Else
    If MSComm1.PortOpen = True Then
    MSComm1.PortOpen = False
    Command1.Caption = "Start"
    End If
    End If
    End Sub

    Private Sub Command2_Click()
    List1.Clear
    End Sub

    Private Sub Command3_Click()
    End
    End Sub

    Private Sub Command4_Click()
    MSComm1.Settings = CStr(Settings.Text)
    End Sub

    Private Sub Command5_Click()
    MSComm1.RThreshold = CInt(Threshold)
    MSComm1.SThreshold = CInt(Threshold)
    End Sub


  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    pbista, juz wanna to confirm with you. Are you connect to the PBX SMDR port and your computer Comm 2 simulateniously?

    If yes, you properly wan't get any data. 'Coz RS232 only allow 1 DTE/DCE in each end.


  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    5
    i didn't get u.yeah i have connected smdr port of pabx with my 25pin comm port 2.as the smdr port continuously sends the data which i want to trap.becoz when i connect the smdr port with the serial printer ,it prints the data continuously.
    the DSR seems to be on .

  4. #4
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    pbista, what i mean is you properly can not connect both the smdr to your computer's comm 2 and serial printer at the same time.

    'coz RS232 only allow a single DTE/DCE on each end of the straight cable/null modem cable.
    You can try to disconnect the serial printer and see will your sample program receive the CDR from the PBX.


  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    5
    hey chris,
    common man ,u got it wrong i haven't connected the printer and smdr port to my comm port at one time only.
    first i connected the smdr port to the printer to check if the data was coming .then afterwards i connected
    the smdr port to my comm port.
    don't know what's happening.

  6. #6
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Sorry for my understanding.

    ok, here we start again,
    Try to change your InputLen properties from 3 to 0
    'Coz InputLen = 0 will casue the MSComm1 read the entire buffer at once and not single character in each time.

    Code:
    'Change the InputLen = 0
    MSComm1.InputLen = 0
    
    Private Sub MSComm1_OnComm() 
    On Error Resume Next 
        Select Case MSComm1.CommEvent
        Case comEvReceive
            Do While MsComm1.InputBufferCount <> 0
                tmp = tmp & MSComm1.input
                DoEvents
            Loop
            List1.AddItem MSComm1.Input 
            tmp = ""
        Case Else
            List1.AddItem "akssadasdsa..." 
        End Select
    End Sub


  7. #7

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    5
    i think i tried keeping the InputLen=0 too.i have tried
    with every settings possible.
    but i am getting only the event onComDSR and not the onComReceive event.

  8. #8
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Will this be the hardware or your cable problem? The code should work. 'Coz I did work in CDR collection and analyze project more than 1 year.

  9. #9
    Lively Member rekcus's Avatar
    Join Date
    Jan 1999
    Location
    Kuala Lumpur
    Posts
    122

    Wink Port settings

    Back to basics for me. Make sure the Comport settings are proper.
    Hey, I also did CDR collection for more than a year.. hehe
    penyou!

    "The code bytes.."

  10. #10
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Hey! reckus, what type of system do worked before?

  11. #11
    Lively Member rekcus's Avatar
    Join Date
    Jan 1999
    Location
    Kuala Lumpur
    Posts
    122

    Talking Yo..

    Hi Chris, last time I worked on Call Billing system and PMS wan.. what about you?
    penyou!

    "The code bytes.."

  12. #12
    Member
    Join Date
    Jun 2000
    Location
    PJ, MY
    Posts
    39

    Question yo!

    yo, rekcus,
    i know something about call bill system, but wat's PMS about?
    wat's it doing with comm port?



    Have you found your paradise yet?

  13. #13
    Lively Member rekcus's Avatar
    Join Date
    Jan 1999
    Location
    Kuala Lumpur
    Posts
    122

    Wink PMS is...

    PMS la.. it is the Property Management System. Some PMS
    systems can interface directly with the PABX through the
    commport wan ma.. How come you don't know wan?
    penyou!

    "The code bytes.."

  14. #14

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    5

    can it be windows2000

    hey guys ,
    does the MSCOMM support windows 2000
    professional edition.while i might be trying like hell
    changin codes and all but who knows .....
    so if anyone knows plz let me know..

  15. #15
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    [email protected], sure it support.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width