07-06-2016 05:02 PM
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!
caleb1993
Solved! Go to Solution.
07-06-2016 08:11 PM
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?
07-07-2016 07:25 AM
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.)
07-07-2016 07:36 AM
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
07-07-2016 07:46 AM
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.
07-07-2016 07:52 AM
So attach your VI, already, and let us chew on it for a few minutes ...
BS
07-07-2016 08:05 AM
I attached the three Sub.VIsthat make up what I was asking. Im not attaching the whole VI.
CL
07-07-2016 08:42 AM
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
07-07-2016 09:03 AM
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).
07-07-2016 09:06 AM
I solved what the problem is and that was the solution.
CL