LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Queues and software variables

Hi all, it's me again.
Anywho, I have a producer-consumer structure that is producing hardware data and consuming the data to write to file. I also have a variable that is calculated and needs to be written to the file when the hardware data is written. The hardware data is behaving nicely but the software variable "Mode Number" is writing to the file as fast as the loop iterates. So in my data file after a couple of data samples, I have hundreds of entries for the "Mode Number".
 
The question is how do I synchronize the writing of the mode number so that it corresponds to the appropriate hardware sample?
I attached a PNG of the loop.
 
Thanx for the help yet again.
 
/this forum is the best site to get a question answered bar none.
 
0 Kudos
Message 1 of 5
(2,811 Views)
I might be way wrong here (probably) but check your error in/error out wiring to the 3rd TDMS write function in the consumer loops true case structure. It just looks funky. Smiley Very Happy You might have wired around it or something breaking the data flow.
Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 2 of 5
(2,782 Views)

Hi punkmonkey,

where is the indicator for your mode value? I think it would be better if you send the mode number with your hardware data. Can you show a bit more of your code??

Mike

0 Kudos
Message 3 of 5
(2,760 Views)
It hit me on the way to work, if I initialize the array that needs to be sent to the TDMS with the size of the wave form array, then it won't write until it gets the waveform data and then synchs up. Attached is the minor change I needed to do to get it to work.
 
Thanx
0 Kudos
Message 4 of 5
(2,709 Views)
You could use semapohores to synch the loops(or processes) , or add an event structure with an event for data(value) change on that element.
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 5 of 5
(2,704 Views)