Click to See Complete Forum and Search --> : Ring Indicator


navalsoni
May 15th, 2001, 09:51 AM
Hi All,

I am developing an EPOS System using VB 6.
I have a Cash Register on my Com Port 1, that opens whenever a randon string is sent to the Com Port.
My problem is that I want to detect if the Cash Register is Open or Closed.
From what I got from the manufacturers of the Cash register I need to use the Ring Indicator to test if one of the Pins in the Com port is of Status High or Not.

Has anyone worked on this problem before ?
Is there any code present for this functionality ?

Thanks

Navs

Jean-Guy2000
May 15th, 2001, 01:54 PM
You need to use the MsComm Control, The Control will fire a event when the ring indicate.

Create a form and put the Microsoft Comm control in it.

then past this code


Private Sub Form_Load()

With MSComm1
.CommPort = 1 'Put your port
.Settings = "9600,N,8,1" 'And settings here
.Handshaking = comNone
.PortOpen = True
End With
End Sub


Private Sub MSComm_OnComm()

Select Case MSComm1.CommEvent
Case comEvRing
MsgBox "RING!" 'Ring detected
Case Else
'Handle other events
End Select

End Sub