ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reinit to default an array... help!.

Hi guys,
 
I have one problem with reinit to default one array, where i send all the data acquired from serial port.
The problem is when I use another time the vi, and other... always remember the data from previous time.
I am try to use invoke method with property node... but it didnt run. Also I could use 'Reinit to default' full VI, which it works on array but affect to anothers values on reference local from main vi(the main vi sends 2 values to read on this sub-vi), since with full VI reinit to default, the values turn to default  = 0.  I want put to 0 the history of array. Any option to get it???.
Regards, Fonsi
I attached the picture of sub-vi.
0 Kudos
Message 1 of 6
(3,513 Views)
I believe that you have here what is known as a LabVIEW 2 syle global (I gather they were discoverd under pretty much the same circumstances that you have discovered thier behavoir) and this is exactly the behaviour that is now anticipated / expected from an unitialised shift register. As I understand it the shift register acts as a global variable and remains in place.

What you will probably need to do is initialise the shift register so that it does not remember the contents.
0 Kudos
Message 2 of 6
(3,510 Views)

Thanks Conseils,

Do you mean like the picture??. If you can, show me any example.

Regards, Fonsi.

0 Kudos
Message 3 of 6
(3,504 Views)
Try the following link for the NI example of using this type of shift register initialisation for storing values and resetting them.
http://zone.ni.com/devzone/cda/epd/p/id/356

0 Kudos
Message 4 of 6
(3,499 Views)
Hi Conseils,
 
Thank you very much for you help!, I got it.
I understood the shift register better. But thinking on my application, simply putting if/else when the out loop is = 1 and inner loop is = 1, i will put the shift register to 0, then I only loss 1 value. I also put asking if the CAll is the first, but in this way is simple and works fine.
So, all the time I will put the shift register to 0, each time the subvi is called. Perfect for me.
 
Regards, Fonsi.
 
 
0 Kudos
Message 5 of 6
(3,483 Views)
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for life.....

Enjoy the free meals.
Regards.
Message 6 of 6
(3,480 Views)