LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamical show amount of inputs dependen of user input

Solved!
Go to solution

Hello Together,

 

following problem:

 

on one page the user can set the amount of test samples, which is realized within one event loop (within a while loop).

(sorry for not posting the VI as it contains WAY much more code, which is not relevant)

 

dependent from that number I'd like to show only the respective amount of input lines.

 

WWolf78_2-1597235157319.png

WWolf78_3-1597235172443.png

 

I've realized this by a case structure, but I'd like to have that for up to 20 Inputs, which would result in a rather big case structure.

 

WWolf78_1-1597235044719.png

WWolf78_4-1597235378871.png

 

 

 

I'm sure there is a way more elegant solution (?)

 

 

LV 2015 Sp1

0 Kudos
Message 1 of 6
(1,158 Views)

Hi WWolf,

 

instead of using lots of string controls you could use a string array-type (array, table)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(1,149 Views)

Hi GerdW,

 

I thought about the same but gut struck on how to show only part of the array

 

how do I show only part of the array dependent of the user input?

 

Best Regards

Wolf

0 Kudos
Message 3 of 6
(1,143 Views)
Solution
Accepted by topic author WWolf78

Arrays have Properties.  The Property "IndexVals" can be used to set the initial Index that appears in the upper left corner of the displayed array (so if you want the first Row, which would be Row Index 0, you would take "1", decrement it, convert it to a 1x1 array using Build Array, and wire it to the IndexVals property), as well as "NumRows", the number of rows you want visible.

 

Bob Schor

0 Kudos
Message 4 of 6
(1,136 Views)

Hi Bob Schor,

 

that's why I love this Forum:

as allways: anybody found a good solution 🙂

 

Thanks for your tip regarding the Property notes, that was the setting I was searching for.

 

unfortunately I didn't understood your Idea regarding the IndexVals.

Yes, I want every line to have a different label (if that's possible)

 

here instead of "String 2" on every line, Value 1, Value 2, ...

WWolf78_1-1597240141887.png

 

 

following Idea don't work:

WWolf78_0-1597240081288.png

 

Any Idea?

 

0 Kudos
Message 5 of 6
(1,109 Views)

Hi Wolf,

 

basic rule: in an array ALL elements share the SAME properties!

So all elements will have the same label/caption!

 

Solution:

Create an array of cluster. Eacu cluster contains a string (which displays your label) and another string for the user input…

(Hint: you can set this "label" string control to "disabled", so the user cannot change its content.)

 

The IndexVal property determines which array element is shown as the first visible element. (Example: your array might have 10 elements and you want to show element 2 to 6: IndexVal=2, NumOfRows=5.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 6
(1,092 Views)