Solved

RS232 dec to hex conversion

Posted on 2006-07-14
2
404 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now