From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make a RESET button in labview ?

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 ???

0 Kudos
Message 1 of 32
(15,704 Views)

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

0 Kudos
Message 2 of 32
(15,691 Views)

 


@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!

0 Kudos
Message 3 of 32
(15,684 Views)

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
www.controlsoftwaresolutions.com
0 Kudos
Message 4 of 32
(15,666 Views)

 


@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).

0 Kudos
Message 5 of 32
(15,651 Views)

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;)) 

0 Kudos
Message 6 of 32
(15,637 Views)

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.Smiley Indifferent

 

Regards,


Nitzz

0 Kudos
Message 7 of 32
(15,634 Views)

Since the attachments are not downloading. Lets see if new post to the same link works

0 Kudos
Message 8 of 32
(15,259 Views)

oh it works! good for people like me 🙂

0 Kudos
Message 9 of 32
(15,257 Views)

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?

0 Kudos
Message 10 of 32
(14,513 Views)