Solved

RS232 dec to hex conversion

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Close form "before" open 3 40
Run a batch file when a Crystal Report is opened 5 27
VB.net Open Folder in Windows Explorer 3 24
write xml in vb.net 2 24
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…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 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