ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean Array to Number Block TroubleShooting

Solved!
Go to solution

I am using an EV3 Cube to scan a sheet that represents a binary number; i.e a black line represents a 1 and a white line represents a 0.

 

Using this, I generate a numeric array consisting of 1's and 0's and convert them by using an Index Array to divide them into a single digit, use a quick comparison (!= 0) to generate their Boolean values, then using the Build Array block, I turn it into a Boolean array.

 

However, despite this, while using the Convert Boolean Array to Integer block, I receive an error which I do know the reason to.

 

If anyone could help me, I would be greatful! Thank you.

 

(By the way, I am a Freshman engineering student with no prior knowledge of LabView, just a year of C++ and 2 years of Java to help me. So thorough explanations would be much easier for me to comprehend)

 

Attached are pictures of my code along with the error I receive.

 

http://i.imgur.com/oIT13Rt.png?1

0 Kudos
Message 1 of 5
(4,024 Views)

I guess that function is not supported on the EV3, just guessing. What are the rest of the words in the error message (currently cut off)?

 

On a side note, I think you could dramatically simplfy the code by using "split array" and to the !=0 on the two arrays, then simply reverse the arrays to get the current output.

Message 2 of 5
(4,005 Views)

Thanks for your response!

 

I know for a fact the function is working on the EV3, because I have a friend who uses the same function on the same project we are working on. Hers works however mine doesn't despite being the same boolean Array!

 

Anyways, here it is:

http://i.imgur.com/1pXrK96.png?1

 

Yes, that probably would work as well, but in my case, if it works, don't fix it! lol

0 Kudos
Message 3 of 5
(3,997 Views)
Solution
Accepted by miguelalabastro

Hi Miguel,

 

the error dialog clearly says "function not supported in current target"…

 

This is a replacement for your BooleanArrayToNumber use case:

check.png

(It also includes Christian's comments on your convoluted check of the array elements.)

Edit: you can in this use case get rid of the ReverseArray node and just reverse the array constant…!

 

Side note: Please attach images directly in the the forum message. Links to 3rd party website create problems when reading the forum through a company firewall…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 5
(3,973 Views)

This will work. Thank you very much for your time!

 

Miguel

0 Kudos
Message 5 of 5
(3,964 Views)