Solved

RS232 dec to hex conversion

Posted on 2006-07-14
2
420 Views
Last Modified: 2012-06-21
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.
0
Comment
Question by:terrenceg
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 125 total points
ID: 17108205
Hi terrenceg,

It probably expects lowbyte/highbyte order so reversing your 01 43 to 43 01 will probably work.

Tim Cottee
0
 

Author Comment

by:terrenceg
ID: 17108320
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
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question