11-18-2005 01:45 PM
11-18-2005 02:27 PM
11-19-2005 10:00 AM

Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.11-19-2005 01:02 PM
(Vivi: Waveform graphs don't remember anything. Maybe you were thinking of charts?)
Mark (eenui): Ed already gave you some great tips for the scope code.
SImilarly, if speed is an issue you should write everything to one single file, simply appending the current data, preferably in binary form. Use low level file I/O, opening the file outside the loop, and keeping it open during loop execution, just appending data using low level writes. At the end, you close the file on the right, outside the loop.
It is simply NOT a good idea to to create a new file every 20 ms for hours! (This is ~3000 files per minute!!!) I am sure some of the slowdown is from OS overhead due to the sheer number of files, especially if you have an explorer window open for that folder. You'll probably also run into fragmentation issues.
If you want seperate files later (why???), you can process it offline.
It is generally a bad idea to "run as fast as possible", because you loose all reproducibility. Suddenly, execution depends on the speed of the computer, other processes and radom events. What if the computer suddenly starts a weekly virus scan, checks for OS updates, etc.. Everything will behave different on a different computer.
If you don't pace your loop at a fixed speed, all data will be quite useless, because the time of each record cannot be known. You would probably need to also save a timestamp with it.
On an similar note: Your code seems to have some odd flaws. For example, your boolean control for the case structure probably belongs inside the while loop, else it would never get read during the run and would be quite useless. If you only need the control outside the loop, the entire loop would go inside the case structure.
11-21-2005 08:54 AM