LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why doesn't stop button always stop my VI?

We are using the default "Continuous Acquisition to Spreadsheet" VI that came with Labview. Our application is recording 32 temperature readings to a text file, and displaying them simultaneously to the monitor. The scan rate is one per minute, the buffer size is 1 and the number of scans to write at a time is 1. When the stop button is hit, sometimes the VI stops soon (after the next write?), sometimes it doesn't and the stop button needs to be hit repeatedly to get the VI to stop. I'm not sure what is happening. Any suggestions? Thank you in advance.
0 Kudos
Message 1 of 3
(2,657 Views)
Can you post your code?
0 Kudos
Message 2 of 3
(2,656 Views)
I have a feeling that this has to do with your data acquisition being so slow.

If you are only doing one scan per minute, I suggest you do use the AI Sample Channels VI, rather than a continuous acquisition.

The reason is, in the VI you are using, LabVIEW ties up the processor when the AI Read VI is called, and it is waiting for the data to be available in the buffer. Since you are scanning at 1 scan per minute, it will have to wait a minute until the data is ready, and it will take control of all the CPU time in the process.

Depending on when in the cycle you pressed the stop button determines how long you'd have to wait until the AI Read comes back with the data, and allows the CPU to process the stop button.

Using the AI Sample Channels VI with
a 1 minute delay will accomplish the same task, but it won't tie up the CPU like it is currently.

Mark
0 Kudos
Message 3 of 3
(2,656 Views)