Hi,
for a little project I need to send some commands to a device over the com port
I'm using the following lines
_CommSendstring(Chr(255) & Chr(1) & Chr(1),1)
_CommSendstring(Chr(255) & Chr(1) & Chr(0),1)
The first line (ON command) works like expected, but the second line not. After doing some reserach with a serial port monitor, I found out that Chr(0) seems to be an emtpy string which makes OFF command incomplete. Any idea why Chr(0) doesn't work? Any suggestions to make it work? Thx in advance
EDIT: I found the following code
$bBinData = Binary("0xFF0100")
$iNumbytes = BinaryLen($bBinData)
$tBinData = DllStructCreate("byte["&$iNumbytes&"]")
DllStructSetData($tBinData, 1, $bBinData)
$iRet = _CommSendByteArray(DllStructGetPtr($tBinData),$iNumbytes,1)