LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

bool to numeric

Solved!
Go to solution

Hello everyone, 
I'm currently tring to make a LED lamp blink in 5 different freqencies due to differenceses in voltage. I have made the 5 differnet cases for 0-1, 1-2 , 2-3, 3-4, and 4-5
Is there any smart way to make the program decide which case to run. I hvae 5 boolean values to select the 5 different cases.

All help would be appritiated 🙂Forum.png

 

0 Kudos
Message 1 of 10
(10,003 Views)
Solution
Accepted by m3gney

Use the Boolean Array to Number.  Right click the case structure and change the radix to binary.  Binary will probably make it easier to understand which case is which. 

Capture.PNG

aputman
Message 2 of 10
(9,990 Views)

I like this solution

 

decode bool array

 

Instead of the attached VI you could use the Search 1D Array- function from the array palette.

It is important to say, that the enum has to be typed to U32 for the typecast to work!

 

Greets, Dave
0 Kudos
Message 4 of 10
(9,971 Views)

Since it is not possible to attach a vi due to weird type mismatch of application/octet-stream I insert it as a snippet:

 

Fast button array decoder.png

Greets, Dave
0 Kudos
Message 5 of 10
(9,962 Views)

Hello m3gney.

 

You should better use an Array than several bolean displays. As the blincking frequency couldn't be the same as the acquisition frequency, you shouldn't do it in the same process.

The idea could be to create two loop, one for the acquisition and one for the blincking led.

 

I made you a VI

 

Good luck. 

Sabri JATLAOUI - Certified LabVIEW Architect - Certified LabVIEW Developer
0 Kudos
Message 6 of 10
(9,947 Views)

Put your 5 buttons in a Radio Buttons cluster, then just wire its terminal to the case selector.

buttons FP.png buttons.png

"If you weren't supposed to push it, it wouldn't be a button."
Message 7 of 10
(9,913 Views)

Thanks a lot for all the great help! I managed to fix the case structure, but now I have a new problem. I'm getting two different error messages

Error (-201003) and (-200279) and I have no clue how to solve it. The rest of the errormessage (-200279) is below the picture.

 

 

Forum 2.png

 

 

 

Possible reason(s):

The application is not able to keep up with the hardware acquisition.

Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.

Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value: 0

Task Name: MyVoltageTask

 

 

 

 

Again, thanks a lot for all the help.

0 Kudos
Message 8 of 10
(9,840 Views)

You should start a new thread since this is another topic. This will increase the chance to get appropriate help.

Greets, Dave
Message 9 of 10
(9,825 Views)

Will do.

 

Thanks for all the help! Smiley Very Happy

0 Kudos
Message 10 of 10
(9,815 Views)