From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reseting while loop to start all over with VI still running

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.

0 Kudos
Message 1 of 4
(2,433 Views)

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
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(2,425 Views)

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

0 Kudos
Message 3 of 4
(2,413 Views)

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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 4
(2,407 Views)