|
-
Jan 17th, 2001, 03:33 AM
#1
Thread Starter
New Member
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
-
Jan 17th, 2001, 03:45 AM
#2
PowerPoster
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.
-
Jan 17th, 2001, 04:18 AM
#3
Thread Starter
New Member
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 .
-
Jan 17th, 2001, 04:31 AM
#4
PowerPoster
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.
-
Jan 17th, 2001, 04:42 AM
#5
Thread Starter
New Member
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.
-
Jan 17th, 2001, 04:57 AM
#6
PowerPoster
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
-
Jan 17th, 2001, 05:35 AM
#7
Thread Starter
New Member
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.
-
Jan 17th, 2001, 05:43 AM
#8
PowerPoster
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.
-
Jan 17th, 2001, 06:03 AM
#9
Lively Member
-
Jan 17th, 2001, 06:08 AM
#10
PowerPoster
Hey! reckus, what type of system do worked before?
-
Jan 17th, 2001, 08:06 PM
#11
Lively Member
-
Jan 18th, 2001, 01:16 AM
#12
Member
-
Jan 18th, 2001, 01:41 AM
#13
Lively Member
-
Feb 3rd, 2001, 11:19 PM
#14
Thread Starter
New Member
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..
-
Feb 4th, 2001, 01:17 PM
#15
PowerPoster
[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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|