02-12-2010 01:46 AM
I am acquiring an analog input and displaying it as a waveform. Then I'm recording the waveform for a certain time and then displaying the recording.
After this I want to record a new waveform, with the VI still running. For this the while loop needs to reset to scratch.
Would appreciate any help.
02-12-2010 02:16 AM
Reading your description, it appears to me that you have mayor flaws in the whole setup (architecture) of your application.
Could you please post your approach in order to enable us to give you valuable hints?
One hint without seeing the code:
Use Producer/Consumer design pattern.
Norbert
02-12-2010 05:38 AM
First:
1. Run the VI
2. You need to press CREATE to create a new file to save to.
3. If you created a new file, press the file path control and select the file you created, the Waveform data will now be saved to that file.
4. Now you can press RECORD. It will record for 1 second and stop and will show the recorded data.
Second:
1. Run VI.
2. You can now press on OPEN to open a previously recorded file. (Select "all file types")
3. You can select another file to open and display without restarting the VI.
The problem is, if you recorded a file and displayed it you cannot then deside to open and display a other file or record another file.
You need to stop the VI and start it again, then you can open or record another file.
I have never before worked with a Consumer/Producer Loop and I'm quite new to Labview.
Please any help will be appreciated.
Thanx
02-12-2010 06:19 AM
Your VI lacks of a proper architecture. You included three functionalities in three different loops which don't have much interaction due to the code, but at least to my understanding, have a certain logical connection.
So i want to ask you:
- Does it make sense to decide (as user) to create a new file during logging of data?
- Does it make sense to compute attributes like RMS twice?
- As a result: Does it make sense to have three loops?
You should take a look into the Producer/Consumer design pattern in order to get a better idea about proper architectures. The idea is that the Producer works on the UI interaction, the Consumer "executes" the desired functionality. Please note that it could be useful to split the Consumer in order to have a proper dataacquisition and still no mess up on the file IO.
Norbert