how to make a RESET button in labview which resets all the elements in an array back to inactive element. Rather than deleting values in every column of array its better to create a RESET button ... how to make it ???
Connect the Reset button to a Select primitive. Put an empty array of the same datatype on the True input and the existing (filled) array on the false input.
Lynn
@abhinavb wrote:
how to make a RESET button in labview which resets all the elements in an array back to inactive element. Rather than deleting values in every column of array its better to create a RESET button ... how to make it ???
You seem to have some misconceptions.
Is the array a control or an indicator or just some data held in a shift register or feedback node?
What you are probably looking for is an empty array. An empty array has a size of zero and has no elements (active or inactive). From your mentioning of "rows", you seem to have a 2D array.
The size of the array is independent of the visible size of the container.
Clearing an array means simply writing an empty array of the same datatype to it's terminal (or internal data structure). If the array is a control, you need to write to a local variable of it instead.
Can you show us some code so we can have a better understanding what exactly you mean by "array" in this context? Thanks!
If it is a control/indicator then you can use the 'reinitialise to default' invoke node - you would not set set the default first value ofcourse. Post your code - it will help people understand what you are trying to do
@David_78 wrote:
If it is a control/indicator then you can use the 'reinitialise to default' invoke node
Hmm, this will only work if the default value actually is an empty array, of course. 😄
(I'd stay away from property nodes unless there is no good alternative. Here we have good alternatives).
Hi Abhinav,
I am not sure whether I got your point or not after reading the rest of the comments. This is what I felt to be an example which may help you solve your problem. I would also be glad if any mistakes are pointed out in this VI if anything is wrong.
Regards,
Nitzz
(Kudos are always Welcome, Accept as a solution if it is the One;))
Hi all,
Oops, I am really sorry, I missed the part in abhinav's post where he mentioned he doesn't want to use delete function. You may ignore my previous post.
Regards,
Nitzz
What if the array is a control array?
How to set to zero all the elements in an control array, that does not have an input?