LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean into array

Hi,
 
I am using entire port 11 and partially port 10 (10.7, 10.6) for 10 lines from NI PCI-6509 card. Since all these 10 lines can either be high or low, at the output of my DAQ Assistant, my data is represented in boolean, where I want to have all 10 boolean put together into array (orange) or double (orange as well). I don't know what do I need for the input of "Index Array", which is the place where those 10 lines will be connected.
 
So my question is what should I use to convert boolean into something that is input of Index Array.
 
Thanks
0 Kudos
Message 1 of 10
(3,341 Views)
I don't understand what you want. The output of the DAQ Assistant is a Boolean array not a single Boolean for each line. An orange line represents a DBL. How and why do you want to convert the Boolean array to DBLs? Also, I don't understand what you want to connect to the index array function. Maybe you could post your code with a better explanation of what you are having trouble with.
0 Kudos
Message 2 of 10
(3,335 Views)
I enclosed the VI I currently have. Basically I need to connect the output data from DAQAssistant to the input of that "Reverse 1-D Array.
 
Thanks
0 Kudos
Message 3 of 10
(3,327 Views)
You can connect it directly. It's the rest of the code that doesn't make much sense to me. If there is only supposed to be one of the digital lines true, you can do a search of the Boolean Array and find it's index. Try the attached modification.
0 Kudos
Message 4 of 10
(3,323 Views)

Thanks. Actually not only one (out of those 10), but multiple can be high at the same time. Will the VI you gave me still work then?

If so, I think something else might be problem. When I read in DAQ Assistant all 10 lines are LOW, which should not be the case. For one PCB I am testing, I have 3 (of those lines) pulled high, so when I use Digital Multimeter, I measure ~0.7V on all three lines on the connector itself. I am driving these lines from the pin no.99 (+5V) card PCI-6509.

All 10 lines are connected to the GND via pull-down resistors (10k each line) since all DIO lines in the PCI-6509 don't have pull-down resistors.

 

Any suggestions ?

 

Thanks a lot Dennis

0 Kudos
Message 5 of 10
(3,312 Views)
No, if you get multiple trues at a time, the modification will not work. Maybe if you explained what each bit in the digital read is supposed to represent and what exactly the code is supposed to do?
0 Kudos
Message 6 of 10
(3,302 Views)

Well, those 10 lines represent Identification of every PCB I have. It starts from 00 0000 0000, then 00 0000 0001, then 00 0000 0010, 00 0000 0011, so I will be having multiple lines HIGH at the same time. So each PCB has hard-wired its own ID number that is connected to MAIN card on which I have the PCI-6509 card connected too. This 10 lines are connected to the GND on the MAIN card just because the PCI-6509 does not have pull-down resistors build in. So for example, the card with ID 00 0000 0010, is connected in following way. 9 LOW lines are connected to the GND (even though they are already connected to the GND on the MAIN board via 10k resistors), and 1 HIGH line is connected to the pin no. 99 of the PCI-6509 card which I am using for having having lines HIGH, since it says it provides +5V.

 

hope this helps.

 

 

0 Kudos
Message 7 of 10
(3,295 Views)
I think I understand now. If you have a straight progression (i.e. 1-n), then you can use the function Boolean Array to Number. You can wire this to the index input of Index Array.
0 Kudos
Message 8 of 10
(3,291 Views)

I would not necessarily have IDs in the following order: 1, 2, 3, 4,..., n-1, n. I may have one PCB with ID no.2, then plug the other PCB that has ID 14, so randomly I would be plugging PCBs.

Could you please send me the modified VI because I still get mis match when I connect that function to the Index Array.

Thanks.

0 Kudos
Message 9 of 10
(3,287 Views)
It should look this. With this technique, the array of products have to match the index. For example, if the digital read returns numeric 14, then item 14 in the array should be that product name. For your combo box, the numbers do not have to be in order and they do not have to be sequential. For example, if 14 is the value returned by the Top Cap CCA, then select the combo box>Edit items and make the Value 14. The array constant you have, make item 14 in the array equal to Top Cap CCA.
0 Kudos
Message 10 of 10
(3,283 Views)