LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert from 1d array of word integer to boolean?


0 Kudos
Message 1 of 7
(5,761 Views)
I'm the same person who ask the above question.I really need answers!The attached file is used to control another vi on another computer.It si able to open the vi from another computer,able to open the correct vi,able to run the vi and able the control the buttons of the slave vi from the master vi.This is done by flatten to string.The problem is that i need to read values (boolean)and display the values unto the front panel of the master vi.I tried using unflatten from string but unable to do so.Or is there a better way to read the led displays from the slave vi to master vi.The attached file is is done halfway-can control the slave vi,but able to display the slave display on the master vi display.Maybe anyone can explain on how to convert string to boolean.Please take a
look at the my vi and help me to improve it.

tks!

grays
0 Kudos
Message 2 of 7
(5,761 Views)
First, I've looked at your VI, and I don't think you can concatenate strings like that going into the call to get the control values;there's no control with that name (boolean 1boolean 2boolean 3..etc)

I think there's an error coming out of that part of the code, but you never display it. Try looking at that. I'd bet money there's an error because it can't find the control on the VI.

Next, if you want to get the control value, you'll have to do it one control at a time. Put only ONE control name in, and on the output, wire the string into the Convert String to Boolean Array control. This should return a 1D array with one value in it; this should be your boolean value. I tried it, and it worked fine. If you want to extract just that value, use the Array Index
VI to get the 0th element of that array and wire that to a boolean indicator, and...Bingo!

Mark
0 Kudos
Message 3 of 7
(5,761 Views)
where can u find the Convert String to Boolean Arry control?
0 Kudos
Message 5 of 7
(5,761 Views)
sorry, meant the String->String/array/path -> String to Byte Array VI.

Mark
0 Kudos
Message 6 of 7
(5,761 Views)
Use the function "Number To Boolean Array" to convert a number into its boolean representation. This function is located in:

Diagram palette -> Boolean

or in:

Diagram palette -> Numeric -> Conversion

You may need to use a For Loop as this function do not accept an array as an input (LabVIEW 5.1, I am not sure about LabVIEW 6)

Attached is an example.

Regards;
EJV
www.vartortech.com
0 Kudos
Message 4 of 7
(5,761 Views)
If I understand you correctly, you are trying to read a boolean from a another VI.

Datasockets could do the job also, but the attached illustates how to accomplish the same task starting with a refnums.

It is not elegant (extreme understatement) but it illustrates the concept.

Ben

bar@dsautomation.com
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 7
(5,761 Views)