Hello all,
Is there a way in PBCC40 to tell if a serial port (COM port) is already in use by another application under Windows?
I would like to be able to tell not only if a serial port is available on a computer, but if an application is already using it.
I wrote some simple code to scan for available serial ports:
I have found that the COMM OPEN statement is reliable in determining the existence of the serial ports present on a machine, however, even if I open a connection to an available COM port using another application like HyperTerminal, COMM OPEN still indicates that the port is available.
Thanks!
Is there a way in PBCC40 to tell if a serial port (COM port) is already in use by another application under Windows?
I would like to be able to tell not only if a serial port is available on a computer, but if an application is already using it.
I wrote some simple code to scan for available serial ports:
Code:
STDOUT "The following COM ports are available:" STDOUT "" FOR x=1 TO 255 a$="COM"+LTRIM$(STR$(x)) COMM OPEN a$ AS #1 ON ERROR GOTO Loop1 PRINT "COM";x;" is available." COMM CLOSE #1 Loop1: NEXT x
Thanks!
Comment