LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array/Table dependent on dropdown lists

Hello,

 

With the help of other forum members, I've managed to create the set of dependent dropdown lists for my project. I've been told that I am now trying to include a table for when there are multiple choices (For my specific VI: show a table containing slots 0-3 and show a table containing channels 0-31). The end goal is to select the independent variable (Chassis/Module), and from there, only enable the possible slots/channels associated with the independent variable selected. 

 

Ex: I select "NI 9205", which has 32 potential channels, so the table would display all 32 channels and allow me to enter information associated with each specific channel. If I instead select "NI 9236", which only has 8 potential channels, the table should then only enable the 8 channels, and disable the rest. (If it is possible to make the dimensions of an array/table dependent on another variable, that would be preferred. I'm just not sure if it's possible.)

 

 

0 Kudos
Message 1 of 5
(1,258 Views)

I also want to say the redundant while loops and multiple stop buttons have been addressed and corrected. Besides that, if there are any redundancies or inefficiencies, I will always have open ears to constructive criticism. 

0 Kudos
Message 2 of 5
(1,251 Views)

@RyanShorette wrote:

With the help of other forum members, ...


You should refer to the old discussion for clarity.

 

NO! You need to rearchitect your code as a simple state machine. greedy loops inside greedy loops are just not the right way to do all this. Same for multiple stop buttons that both need to turn true for the outer loop to complete. This is very constipated!. Since some of your items differ in number depending on the selection, you need to use ragged arrays. In a simple 2D array, all rows are padded to the longest. Don't use free labels for diagram constant!. You can show the label of the constant and edit it with the same text. having all these loose elements is like herding cats!

 

 

 

Message 3 of 5
(1,249 Views)

Here's somewhat cleaned up code. Maybe it can give you some ideas....

 

I would probably use an event structure and coerce dependent rings to the new valid range if needed.

Message 4 of 5
(1,224 Views)

Use a State Machine for your code as suggested. The 9205 has differential and SE inputs, if you use differential inputs, then you are using two of you analog inputs for a measurement. Be aware of that. Below is State Machine that does something similar to what you want, you can use it for ideas. (It is nothing more than a JKI State Machine) Sorry cannot share company code.

 

Snap135.pngSnap134.png

Message 5 of 5
(1,203 Views)