LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS File starts recording data at 20Hz, but after a short time drops to <10Hz as VI slows, why?

Should I move the destory queue to the consumer loop with the data writes? Doing that just freezes the program.

0 Kudos
Message 21 of 34
(1,541 Views)

What I do is have the queue destroyed after the consumer loop completes.  But you still need some way to tell the consumer to stop.  The simple way would be to add a field in the cluster telling the loop to stop.  When you see that field turn TRUE (I recommend a boolean), then stop reading and tell the loop to stop.  The queue can then be safely destroyed and we can guarantee that all of the data has been logged.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 22 of 34
(1,534 Views)

My program is stopped in the first producer loop (VISA read loop) and then the error from that queue triggers stop cascades throughout the program while loops first to the data queue loop then (before i put in the FOR loop) to the data write loop. I can't seem to keep it that way now without getting a queue error. Not sure what you mean by add a boolean to the cluster, do you mean a local variable from the VISA loop that when it is true it sends a TRUE through to the data write loop and that gets parsed to the stop button in that while loop?

0 Kudos
Message 23 of 34
(1,520 Views)

@crossrulz wrote:

What I do is have the queue destroyed after the consumer loop completes.  But you still need some way to tell the consumer to stop.  The simple way would be to add a field in the cluster telling the loop to stop.  When you see that field turn TRUE (I recommend a boolean), then stop reading and tell the loop to stop.  The queue can then be safely destroyed and we can guarantee that all of the data has been logged.


I know what's wrong, I have a case structure to either record data (ie send it to the data record loop) or just display it on screen. So if the data record button is off (which it will be whenever someone is going to hit stop) the data record consumer loop never sees that the button was stopped and it just hangs. How can i tell it that the stop button was pressed (local variable?) without losing this "data record? "  feature?

0 Kudos
Message 24 of 34
(1,511 Views)

When your producer stops, send a command to the consumer telling it to stop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 25 of 34
(1,501 Views)

@crossrulz wrote:

When your producer stops, send a command to the consumer telling it to stop.


How do I send a command to another while loop without using the queue? Got this by getting queue status before the for loop: Capture.PNG

 

Was this the correct way?

0 Kudos
Message 26 of 34
(1,499 Views)

Also I jsut noticed that using the for loop in the data write loop continously writes zeroes to all columns when the data record button is turned off. How can I prevent that? I only want it to be recording data when the data recording switch is on, and do nothing without that. but the for loop is always running and just saying the queue has zeroes in it so it writes that.

0 Kudos
Message 27 of 34
(1,491 Views)

See if this gives you some ideas...


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 28 of 34
(1,460 Views)

What is this symbol?

 

Capture.PNG

0 Kudos
Message 29 of 34
(1,443 Views)

First is the Conditional Index tunnel that is on the loop.  I think that came out with LabVIEW 2013, so you should have it.

 

Then there is the Empty Array? primitive.  It is in the Comparison palette.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 30 of 34
(1,433 Views)