LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric to Hex string

Solved!
Go to solution

Hello Friends,

I have to convert Numeric to String to send in MODBUS Communication. I dono the conversion so that numeric can be made variable and i will do conversion internally. Pls have a look at the VI attached to get clear idea. If you still have doubt in this I am ready to explain.

 

Thanks and Regards,

Ratheendiranaath B.R.

0 Kudos
Message 1 of 6
(2,840 Views)

Hi friend,

 

- "to/from hex conversion" is ask very often in the forum. Did you read any of those threads?

- You also don't give clear explanations: In your example you convert your input 12 to a string displaying "12" in hex mode. Do you really want to have BCD numbers in the string? Or do you expect "0C" as string (in hex display mode)?

- using DBLs to convert to string is also ambigous. Do you wnat the value converted to some integer format or do you want to typecast the DBL?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,837 Views)

Yes. I want to convert that numeric input into BCD numbers what we enter in String constant in Hex Display.

0 Kudos
Message 3 of 6
(2,829 Views)
Solution
Accepted by topic author Mechatronrathi

Hi friend,

 

here's a very basic, straight-forward way:

check.png

Probably there are more effective ways, but I wanted to show some basic steps of that conversion...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 6
(2,821 Views)

This is what i was expecting. Thanks for your help.

 

Ratheendiranaath 

🙂

0 Kudos
Message 5 of 6
(2,814 Views)

Hello,

 

In order to inter-convert data types, LabVIEW provides in-built conversion palettes. For example, in order to convert numeric to string (decimal, hex display, etc), you can have a look at the following palette:

 

Programming>>String>>String/Number conversion

 

You may find some useful functions there. Hope this helped!

0 Kudos
Message 6 of 6
(2,781 Views)