CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Ring Indicator

  1. #1
    Join Date
    May 2001
    Posts
    2

    Ring Indicator

    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


  2. #2
    Join Date
    Sep 2000
    Location
    Ottawa, Ontario
    Posts
    356

    Re: Ring Indicator

    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



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

Featured