Link to home
Start Free TrialLog in
Avatar of terrenceg
terrenceg

asked on

RS232 dec to hex conversion

I am wrtting a program that sends data to a spray jet printer via a RS232 port.  I have been sending commands with 1 byte hex data and it works fine ie. 1B 02 14 1B 03  (decimal 27 2 20 27 3)

Now I need to send command data with 2 bytes in hex ie.  143 (decimal 323).  How do I send this type of hex value? The command allows 2 bytes for this data, I tried 01 43 but this is interpreted incorrectly? Any help would be greatly appreciated.
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of terrenceg
terrenceg

ASKER

Thanks Tim, can you tell me which is the most significant part.  I read somewhere in the manual that I should transmit the most significant part first