From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-01-2020 12:29 PM
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.
Thank you
07-01-2020 02:48 PM - edited 07-01-2020 02:51 PM
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!
07-01-2020 05:17 PM
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.
07-01-2020 11:31 PM - edited 07-01-2020 11:33 PM
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!