-
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
-
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.
-
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 .
-
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.
-
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.
-
:o 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
-
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.
-
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.
-
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
-
Hey! reckus, what type of system do worked before?
-
Yo..
Hi Chris, last time I worked on Call Billing system and PMS wan.. what about you?
-
yo!
yo, rekcus,
i know something about call bill system, but wat's PMS about?
wat's it doing with comm port?
-
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?
-
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..
-
[email protected], sure it support.