Serial Port: Writing Codes in HEX, not in ASCII
I have some troubles with my serial Port. This time, I am adressing a DLP Projecotor. (PJ).
The PJ listens only to commands it receives in hex format.
The command 02h 01h 3e 03 makes the PJ switching on.
When I write
ComPort.Write("02H" & "01H" & "3E" & "03H")
to the PJ, my Serial Port Monitor(monitoring HEX) says
30 32 48 30 31 48 33 45 30 33 48
Thus I wrote some ASCII to the PJ and the Oj does nothing.
When I write
ComPort.Write(Chr(2) & Chr(1) & Chr(122) & Chr(3))
my portmonitor is saying:
02 01 7A 03 and the PJ reacts correctly.
It is quite long winded changing the decimal 122 to hex 7a.
Now we come to my question:
Is there a chance of writing hex codes directly to the port?
Something like
ComPort.Wrtiningsomehex (02 01 7A 03)?
Are there any workarounds? A automatic decimal to hex concerter method or something like this?
Thank you very much!!
Greetings,
Carsten

