LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hexadecimal string to 0x00000000 to write data into niHSDIO Write Static (U32) VI

Hi NI Community,

 

I'm trying to create a binary to hexadecimal converter to go into the "Write Data" input of the niHSDIO Write Static (U32) VI. Can you help me understand how I can make this conversion? I attached the VI below.

 

ask NI.PNG

 

Thank you

0 Kudos
Message 1 of 4
(1,930 Views)

Hi victor,

 


@victor55 wrote:

I'm trying to create a binary to hexadecimal converter to go into the "Write Data" input of the niHSDIO Write Static (U32) VI. Can you help me understand how I can make this conversion? I attached the VI below.


Right now most of the stuff in this image is handling strings: where do you try to convert "binary" data?

Why do you think you need "hexadecimal" data?

 

Suggestion: create a boolean array of 32 elements, then convert this array to an U32 number. No need for all those pink string wires and string formatting functions!

Best regards,
GerdW


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

Hi,

 

Thank you for your response. The Hexadecimal string is the correct output but I need to connect that output to the "write data" of that niHSDIO Write Static (U32) vi and it requires a different format. So I'm trying to figure out how to do it.

0 Kudos
Message 3 of 4
(1,881 Views)

Hi victor,

 


@victor55 wrote:

The Hexadecimal string is the correct output but I need to connect that output to the "write data" of that niHSDIO Write Static (U32) vi and it requires a different format. So I'm trying to figure out how to do it.


When the "String" really is correct then you just need to convert it into a U32 value. Use ScanFromString with %b as format and a "0" constant set to U32 datatype…

 

But again: Your whole VI is a big Rube-Goldberg!

All your controls (Brykte) should be boolean switches, All the booleans should be used with BuildArray, followed by a simple BooleanArrayToNumber. Or start right with a boolean array - as suggested before. There is no need for any string wires in this VI!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(1,848 Views)