LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuously measure and write waveform using tdms

Solved!
Go to solution

Hello everyone,

I am doing my thesis using Labview 2010(since it is only version avaliable in University currently Smiley Sad ). I need to read and record data from microphone(currently using simulate signal since i need to make program work first) then save and analise it(didn't reach that point yet). I tried to use event structure so i can record and then read tdms file. But unfortunatly it records only small piece, then i inserted while loop so it will record continuosly but program doesnt respond after i push record and i can only close it manualy from toolbar. Please could anyone help me or suggest something since i am not very good at Labview and any feedback is welcome. Here is what i have done till now. I tried to search forums for some similar solution but could not find anything usefull(some had much newer version so i could not open). Thank you.

0 Kudos
Message 1 of 3
(2,585 Views)
Solution
Accepted by topic author MihhailxD

Hi and welcome to the forums,

 

The reason you cannot stop the recording of the waveform or exit the application is because you have the event case configured to "lock panel until the case for this event completes" (in edit events). This means that LabVIEW will not respond to user interaction until that event structure completes but because you rely on being able to press the while loop stop button to finish the event structure means you have a deadlock and have to abort the VI.

 

The architecture of your application is not ideal - I would strong advise against having anything that takes a long time to execute inside your event structure for the very reason above (obviously you can untick lock panel as a quick solution). I would suggest having a look at the producer/consumer design pattern (events) (new... > from template > frameworks) as this would be more appropriate for your application. You can handle your button presses in the top event structure and have a state machine in the bottom loop for starting, running and stopping your data acquisition.

 

The idea is that you only do very little inside the event structure so it frees up the front panel but the messages (e.g. start/stop acquiring data, exit application) are handled by another loop.

 

I don't know if it ships in LabVIEW 2010, but in 2012/2013 there are sample projects that include a "continuous measurement and logging" project which might be suited to your application. There are also examples for state machines and queued message handlers.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 2 of 3
(2,572 Views)

Thank you, I will at this and yes i was thinking to change the structure to producer/consumer since i sow that its used a lot, but i will need to learn how to use it 😄 i will try to do it and i will post my solution asap. Thank you! Smiley Happy

0 Kudos
Message 3 of 3
(2,567 Views)