06-08-2014 07:41 PM
Hi All,
I am using LabView 8.5.
I have to convert decimal to hex value to write the data into MCU.
But my value is decimal like 12.51.
How can I convert?
Thanks,
Cloud
06-08-2014 07:46 PM
Hi All,
In additional information to my question,
I need to convert the decimal value 12.51 to byte[] to able to write into MCU through RS232.
Regards,
Jessie
06-08-2014 07:48 PM
How many bytes do you want to represent this value? (4 bytes for single representation, 8 for double).?
Use the typecast function.
06-08-2014 11:49 PM
Hi Cloud5,
Please see this http://digital.ni.com/public.nsf/allkb/DD5AFE8E829DC16D86256BDF005E1F95.
Regards,
SrikrishnaNF
06-09-2014 02:24 AM
Hi Cloud05,
On the indicator, right click> select representation> select I16 (Word)
This will allow you to select display format in the properties dialog box.
Now press right click> select properties>Click display format> select Hexadecimal in the Types menu.
You should see small 'x' on the left of indicator indicating the value in Hexadecimal
Please see attached image.
06-09-2014 02:42 AM
How is the number supposed to be represented according to the manual? Some, e.g. the pump i'm working on right now, uses 1/100s as integer, i.e. 12.51 would be read/sent as 1251. Is the number supposed to be the hex representation or the text representing the hex? (Is it supposed to send 04E3 or the text '04E3')
/Y
06-10-2014 07:48 AM
Please check attached VI.
One array shows 8 byte representation (When 12.51 is considered as double precision)
One array shows 4 byte representation (When 12.51 is considered as single precision)
This way u can convert it to array and then transfer to serial port.
If this is what u r looking for , pls dont forget to add Kudos.
Miraz
06-10-2014 07:51 AM
Please check attached image
One array shows 8 byte representation (When 12.51 is considered as double precision)
One array shows 4 byte representation (When 12.51 is considered as single precision)
This way u can convert it to array and then transfer to serial port.
If this is what u r looking for , pls dont forget to add Kudos.
Miraz