Although serial ports are disappearing, they can still be useful.
Here is a COMMs UDF. It provides an easy way to use serial ports without the restrictions and problems some methods have. USB to serial is ok, binary data is ok.
This UDF requires my comMG.dll which can be in either the script folder or the Windows folder by default, or in the path specified using the function _CommSetDllPath.
Note the following shortcomings:
the dll link below is 32 bit so it will not work with a 64 bi
ok, i managed it to work. Removing
Local $CmBoBaudOptic = 19200 ; Baud
Local $CmBoBaudScanner = 115200 ; Baud
from top of the script and placing it within desired functions SendData2() and SendDataOPTICS() like below:
Func SendDataOPTIC($FileName, $LineNumber)
$CmBoBaudOptic = 19200 ; Baud
;Start up communication
_CommSwitch($CMPortOptic)
(...)
and
Func SendData2($FileName, $LineNumber)
$CmBoBaudScanner = 115