LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I reset an array

How can I reset an array so that it empty or zeros the next time the vi is called to run?
 
Thanks,
Brad
0 Kudos
Message 1 of 9
(4,986 Views)
Hello Brad,
 
you can use the function "Initilize Array" to initialize the array to a specified value.
 
 
Regards
ThomasD
0 Kudos
Message 2 of 9
(4,975 Views)
 
Hello Thomas,
 
I thought of that but I couldn't figure out how I could incorporate that into my example.  Any suggestions?
 
 
0 Kudos
Message 3 of 9
(4,963 Views)

Can you post a picture or VI? But I have only LV6.i.

 

0 Kudos
Message 4 of 9
(4,957 Views)
The initialize array will allow you to initialize an array to any single value (ie zeros) and set the size of the array, the other method of initializing an array is to wire the array to a constant.  The second method is nice when you need to initialize an array of different values, it is a little more versatile but requires more memory because you are storing a copy of the data as a constant.
 
Paul 
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 5 of 9
(4,950 Views)
I think I figured it out, what do you think of it?  I have 6.i too.
 
0 Kudos
Message 6 of 9
(4,950 Views)
It doesnt need to be that complicated actually.  If you delete the initialize VI you can right click on the shift register and choose Create>>Constant.
Message 7 of 9
(4,937 Views)

I think it works fine.

If you use the "wait until next ms multiple" instead of the "wait ms" function, you have a definite time for the VI runtime. In your case exact 1000ms for a cycle. 

If you post a picture in the future, it shoud be a *.jpg or *.png or another compressed fromat. 2,3MB are very big.

 

Regards ThomasD

 

Message 8 of 9
(4,934 Views)
Thanks everyone for your help!Smiley Happy
 
You saved me much time and frustration with something that I knew should be quite simple.
 
Brad
0 Kudos
Message 9 of 9
(4,916 Views)