LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to clean the data stored in arrays from last running

每次打开vi,第一次运行会比较正常,第二次运行就会报错;我查看过中间文件,好像第一次运行的数据在运行结束后没能被清除,如果我想运行第二组,我只能通过关闭文件再打开的方式实现。所以我想求助一种运行结束自动清空所有数组的功能(不需要关闭vi),类似于matlab中的”clear“功能,请问是否有相应的功能可以实现?

0 Kudos
Message 1 of 3
(1,191 Views)

Hi,

 

您可以在应用程序的最终情况下添加一个常量值,如下所示:(这只是为了提供一个想法)

 

You can add a constant value at end case of your application as shown: (This is just to give an idea)

Clear array.png

 

Please see attached PNG.

0 Kudos
Message 2 of 3
(1,185 Views)

Do you use an uninitialized shift register? In that case you need to initialize the shift register with an empty array before the loop. (If you don't data inside the shift register will be retained between runs).

 

We can help much better if you show us your code because there are many other possibilities.

 

Is the retained data in shift registers, controls, or indicators? Do you use a lot of local variables? Is the VI set to clear indicator when called? What errors do you get on the second run and why?

0 Kudos
Message 3 of 3
(1,162 Views)