LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Truth Table and select case

Hi, I think I have a fairly straightforward problem, I'm just not very comfortable with arrays yet.

So for a project at work we need to turn relays on and off in various order. We have a truth table of the combinations (1 for on 0 for off). I was thinking of having a table on the front panel (4 columns 9 rows) and then have labview parse the array and send it through the select case.  At first I was trying to resize the array and then decimate it. However after playing around with all the different functions for a while I really got no where.  I'd like to be able to parse each row (and get the four separate 0 or 1) from the table and send each one into a separate select case to turn the motor on or off.

Is there an easy way to do this?  If i'm going about this wrong any suggestions? Thanks.
0 Kudos
Message 1 of 5
(3,035 Views)
You need to look into autoindexing:



The loop iterates for each row.

To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.


Message Edited by smercurio_fc on 06-11-2008 01:15 PM
0 Kudos
Message 2 of 5
(3,032 Views)
What you show makes perfect sense. I just dont know what the function you use in the for loop is? Thank you though for the easy way to do this.
0 Kudos
Message 3 of 5
(3,021 Views)
haha nevermind I just realized it was the index array icon, just looks different in the palette. Also my company will be getting me into a few local labview classes the coming weeks, thanks for the other resources too.
0 Kudos
Message 4 of 5
(3,019 Views)
The icon looks different because once you place the function on the block diagram you can resize it to index out multiple elements, which is what I did. With just one index the default value is 0, and it automatically increments by one with each additional index input. This is documented in the LabVIEW Help.
0 Kudos
Message 5 of 5
(3,012 Views)