07-06-2018 04:45 AM
Hi,
I'm trying to create a dymamic 2D array whereby the user inputs how many rows he would need.
This is what I have built so far and it works to some extent...
The problem I have is that in the VI the array does not grow/shrink according to the user input. What I mean is if for example I have 2x2 array in the VI, and I run it,
If I enter Number of Row = 1, the 1st row is initialised while the second row is greyed out.
If I enter Number of Row = 2, the 1st and 2nd rows is initialised.
If I enter Number of Row = 3, the 3 rows is initialised but only 1st and 2nd rows visible!
Is there any property node I can use to grow/shink the array in the VI so that only the initialised rows are visible?
Solved! Go to Solution.
07-06-2018 05:31 AM
07-06-2018 05:57 AM
Funny you should say that... I did try that property node originally but still the same problem...
The number of rows is updated but on the VI, the number of visible element in the array do not change ie.
If the user inputs number of rows > original array drawn on the VI, the extra rows are not visible
If the user inputs number of rows < original array drawn on the VI, non-initialised rows are greyed out but that does not stop the user inserting a value into them
Alternatively, if I could lock out the greyed out elements to stop the user initialising those, I could work with that.
07-06-2018 07:09 AM
Hi sherzaad,
The number of rows is updated but on the VI, the number of visible element in the array do not change ie.
Please attach a VI demonstrating the problem!
if I could lock out the greyed out elements to stop the user initialising those, I could work with that.
There are solutions to this problem, but I would start with debugging your example VI…
07-06-2018 07:31 AM
It worked perfectly for me. Here's a question -- did you possibly forget the Prime Principle of LabVIEW, namely the concept of Data Flow? You cannot set the number of Rows and Columns of the Indicator until after you have initialized (and set the size of) the Array, itself.
"I'll show you mine if you show me yours".
Bob Schor
07-09-2018 02:22 AM
@Bob_Schor wrote:
It worked perfectly for me. Here's a question -- did you possibly forget the Prime Principle of LabVIEW, namely the concept of Data Flow? You cannot set the number of Rows and Columns of the Indicator until after you have initialized (and set the size of) the Array, itself.
Thanks for that reminder! keeping that in mind I added a couple of extra block and Voilà! It works! The number of rows in the VI Array control updates with user input.