Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking the serial port state

Status
Not open for further replies.

pmscraiova

Programmer
Dec 8, 2001
86
RO
I want to check the state of an serial port. Particullary, I want to know if there is any possibility to verify if a serial barcode scanner is online or not.
 
If you are using the MSComm control, there is a property called PortOpen that you first, set to .T. to open the port. If this succeeds, then the port is open. Otherwise, you will get an error. In the init event:

ThisForm.oMScomm.PortOpen = .t.
Thisform.label1.Caption = ;
IIF(ThisForm.oMScomm.PortOpen , 'Open', 'Not Open')

If you're using a 3rd party comm .DLL of some sort, you'll have to try to open the port using their calls, and look for the return code.

From there, you would need to use whatever commands you need to to query the barcode reader.


-Dave S.-
[cheers]
Even more Fox stuff at:
 
It is also worth looking into if your scanner has OPOS drivers. The OPOS (or previously refered to as Ole POS by MS, but that was a bit too confusing) drivers expose significantly more functionality in POS equipment through the use of the device driver and ActiveX interfaces to the devices. It simplifies the use of POS devices and provides significantly more control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top