Sending Data in DEC format

Forum to ask for any help
Post Reply
jersagfast
Posts: 1
Joined: Mon Nov 12, 2012 3:51 am

Sending Data in DEC format

Post by jersagfast » Wed May 21, 2014 6:07 pm

Hi Guys, I have a piece of hardware that has an RS-232 connection, but requires data to be sent to it in decimal format (not ASCII numbers). I know I can send HEX data with a \x prefix, but is there a way to send data in decimal format? Any help would be greatly appreciated, thanks. :)

User avatar
DemoPad
Site Admin
Posts: 770
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: Sending Data in DEC format

Post by DemoPad » Mon May 26, 2014 8:58 am

Just convert the decimal value to hex, and send the hex equivalent. At the end of the day, any data sent via DemoPad is sent as neither hex,ascii,or decimal, it is sent as binary data in bytes. You just need to decide which bytes to send, and you enter them in hex format in our software.

Eg: to send a decimal value of 7, send:

\x07

To send a decimal value of 255, send:

\xFF

Post Reply