From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

arrays as decision making

Solved!
Go to solution

hi,

 

i have a list of arrays which need to be use as input to decision making. attached are the VI and input file. When high_data is >10, it must perform the squareroot which is under the True condition. When the high_data is less than 10, it should return zero whcih is under False condition. i tried to use case selector but it seems array cannot be use for case selection. Can anyone help me with this. Thanks

Download All
0 Kudos
Message 1 of 5
(2,267 Views)
Solution
Accepted by topic author varsha88

First of all, you have race condition due to the blatant overuse of a local variable. Most likely, the local variable gets read before the terminal of the array gets valid data. Remove the local variable and use a wire directly. Remember, LabVIEW does not execut top to bottom or left to right. Execution order is fully determined by dataflow alone. If you have several CPU cores (and you probably have), things can even execut in parallel.

 

Second, have you tried to simply wrap an autoindexing FOR lop around the case structure? Then clean up the false case, which needs a scalar instead of an array, etc.. There are also loop-free solutions to this, but let's stick to the basics.

Message 2 of 5
(2,255 Views)

hi altenbach,

 

I do not really understand how to do the "wrap an autoindexing FOR lop around the case structure? Then clean up the false case, which needs a scalar instead of an array" because im still new to labview. can you share the vi? thanks

0 Kudos
Message 3 of 5
(2,244 Views)

Just try what I said. 😉

0 Kudos
Message 4 of 5
(2,238 Views)

Here is a simple solution without loops or case structure.

 

Try it. 😄

 

 

0 Kudos
Message 5 of 5
(2,209 Views)