Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i send decimal data format by rs232 ?

I have two devices which only receive decimal datas format for driving them
0 Kudos
Message 1 of 4
(3,659 Views)
Serial (UART) data is only 5-8 (sometimes 9) bits long. Usually data is sent as ASCII (ie 0x30 is "0", etc.) and thus instruments will often send/receieve data as a string ("3.1414E1" for example).

With this in mind, you need to take a look at what your device expects as a data format. Then you can use some of the string conversion vi's to convert your data to strings and send that to your device.

If you're not using LabVIEW you can do this in whatever programming language you're working in either by using a canned function or making your own.

Hope this helps!
Message 2 of 4
(3,659 Views)
In addition to what Chris siad I would like to add that some devices use the standard ieee format for flaoting point data.

For these types of devices use the "type cast" function found in the advaned>>>data manipulation palette to cast from a float to a string.

You should get the specifics on the device to do this properly.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 4
(3,659 Views)
Here is more info on the ieee 754 standard for floating point data:
<>

and here is a online calculator for you as well:
<>


HTH,

Regis

"Ben" wrote in message
news:506500000005000000A7D00000-1042324653000@exchange.ni.com...
> In addition to what Chris siad I would like to add that some devices
> use the standard ieee format for flaoting point data.
>
> For these types of devices use the "type cast" function found in the
> advaned>>>data manipulation palette to cast from a float to a string.
>
> You should get the specifics on the device to do this properly.
>
> Ben
0 Kudos
Message 4 of 4
(3,659 Views)