LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

missing a second of data

Solved!
Go to solution

 Hello,

 

I have a DAQMx reading temeratures, pressure sensors, and speeds and flow meters from a motor hooked to a dynamomator. I am reading these in and writing theses to a TDMS file at a rate of 1 Hz.When I open the file to run some post processing it skips a second inconsistantly. I have tried finding out how fast my loops are running. They run at +-.00001 seconds of 1 Hz so it cant be from slow loops. The architecture is a producer consumer loop where the data is written in the consumer loop. I've tried every I could think of. Any help is welcome. I am aware you need the code but I would need to post my whole project which I'm not doing. Here are pictures, please tell me what VI I need to post. Producer is on top, Consumer is bottom. Thanks for your help!

 

caleb1993Consumer loop.PNGConsumer loop.PNG 

0 Kudos
Message 1 of 10
(3,115 Views)

Why are you adding data to an array each loop iteration and then sending the entire (possibly HUGE) array through the queue?  You do not need to use the Build Array in your producer loop.  That will just cause some major slow downs.

 

And where is your 1 second of data missing?  At the end of the test?  Randomly in the middle?


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 2 of 10
(3,095 Views)

I added a sample logged test to help. I need to use the build array VI so I can show a waveform graph. I dont like the display of a waveformchart because it wasnt showing the data as clearly. I've tried that over and over and get the same result. Please let me know if anything wrong stands out. ( I dont have enough thermalcouples yet and power supply for the others.)

0 Kudos
Message 3 of 10
(3,072 Views)

Please attach the VI itself.  A picture of part of the VI is not helpful -- we can't "play" with it (like clean it up, simplify it so we can figure out what you are trying to do and see where the "time block" is occurring).  It is possible (probable?) that you are trying to "do too much" within your loop -- putting 11 pounds of fertilizer in a 10 pound bag -- and don't realize that LabVIEW has a way of allowing you to "fill two bags at the same time" (known as "parallel loops") ...

 

Bob Schor

Message 4 of 10
(3,070 Views)
Solution
Accepted by topic author caleb1993

I got a quick cup of coffee and on my way back it hit me. I got it to start logging every second. I replaced a control with a constant. I have been stuck on this dilemma for a couple weeks.  

0 Kudos
Message 5 of 10
(3,067 Views)

So attach your VI, already, and let us chew on it for a few minutes ...

 

BS

0 Kudos
Message 6 of 10
(3,061 Views)

I attached the three Sub.VIsthat make up what I was asking.  Im not attaching the whole VI.

 

CL

0 Kudos
Message 7 of 10
(3,059 Views)

Terrific!  You attached everything except the critical piece, the routine that calls Data Log (which is probably the same routine that does the other time-consuming step, acquiring the data).

 

You have a timing problem in some routine.  You want help with it, namely "missing a second of data".  Doesn't it make sense to you that if you want help with a routine that is "missing a second of data", you should provide us with this (potentially problematic) routine?

 

Bob Schor

0 Kudos
Message 8 of 10
(3,056 Views)

What is the timing of your tasks that read 2D DBL? If they take 1 second, then they start conflicting with wait until next ms multiplier (1000). 

0 Kudos
Message 9 of 10
(3,050 Views)

I solved what the problem is and that was the solution.

 

CL

0 Kudos
Message 10 of 10
(3,046 Views)