07-16-2018 11:20 PM
Hello Everyone !! I am using the attached program to gain two different inputs. Based on the inputs I generate 5 V signals. I also need to acquire data at certain times. The problem is that as soon as I turn on Write to Measurement File using a Boolean Operator, the program becomes really slow and it misses a lot of lot points while writing it.
Is there any alternate way of writing it? How can I avoid missing the data points?
Kindly Guide!
Thank you!
Solved! Go to Solution.
07-17-2018 02:19 AM - edited 07-17-2018 02:20 AM
Hi umairshaw,
first: posting VIs is good and appreciated, but using the latest LV2018 version will provide problems for all those people not having upgraded right now. (Can you attach a "saved for previous" version of your VI? Or atleast make clear which LabVIEW version you are using…)
The problem is that as soon as I turn on Write to Measurement File using a Boolean Operator, the program becomes really slow and it misses a lot of lot points while writing it.
Generic answer for such problems: use a producer-consumer scheme. (LabVIEW comes with ready-to-use example projects you can utilize.)
Generic answer 2: how many samples are you reading per iteration and which sample rate do you use? It may help to increase the block size (=number of sample per read operation), especially when you read very low sample counts (like 1 in the worst case)…
07-17-2018 07:54 AM
Where is your loop? If you are using the Run Continuous, stop it! That is a tool for debugging code and has no place for actually looping a VI.
Where are you actually acquiring the data? I just see simulation Express VIs.
07-17-2018 11:59 AM
Hello GerdW,
Attached VI in the old version. I will try using Producer Consumer Loops. I need to acquire two input signals (Sin Waves) collected at 40K (sample rate) and the number of samples is 1000. Please see the other attached files. As long as I start acquiring slows down the entire VI. I have tried using three while to run processes in parallel but still, it is not helping. Can you please look at the Simulated Actual DAQ-2.vi. This is working but I am not able to get anything on the drive.(There is no log filed generated).
07-17-2018 12:03 PM
Hello,
I am acquiring data for analysis and triggering an output. I have put everything in the loop but still, there are some errors. I have tried it with and without Queues. Please see the attached file. Actual DAQ(with Queues) is giving an error(attached). Actual DAQ 2 is not logging any file.
Thanks!
07-17-2018 12:51 PM
Just an Update,
I used the attached program as well in the while loop to acquire data from two inputs. It also slows down as soon as I start logging. This program is available in the examples of Labview Help Directory.
07-18-2018 05:03 PM
This is what your program does in a loop, over and over ...
And then the whole cycle starts over, reconfiguring the Task, reconfiguring the TDMS, starting the single finite sample, plotting it three times, stopping the Task.
How slow is it?
More important, What do you want to do? I'm 99% certain it isn't what you are doing. Some questions to ponder:
And the most important question (since you seem to want to take data from something) -- Have you ever opened NI MAX (the Measurement and Automation Explorer) and used it to "play" with your device, and the various settings for the DAQmx Task?
Bob Schor
P.S. -- there is good DAQmx Tutorial material available -- do a Web search for "DAQmx Tutorial".
07-18-2018 11:19 PM
Hi Bob,
AIM:
I need to acquire inputs continuously (sin waves at 40 kHz). Based on one of the inputs I want to generate an output in real time to trigger another machine. At the same time, I need to log data continuously but it logs data the whole program slows down and it misses data points.
PROBLEM:
If I turn ON Data writing using a boolean control I can clearly see that the display on the graph is slow and data points are missing.
APPROACHES:
Based on the recommendations, I tried putting everything in three while loops. One acquire inputs, second generates output and the third loop write it using Queues. It works well for TDMS format but not with Xlsx format. It is really slow and takes a lot of time to write the file in excel format.
Then I start using "Channels" to stream data between loops and now it works fine. It doesn't slow down.
Response to your Questions:
How slow is it?
Voltage Finite Input is the example program that comes with LabVIEW software. Even using that program at 40kHz it slows down the programs as soon as I start logging. I am just curious to know why it is behaving like it?
More important, What do you want to do? I'm 99% certain it isn't what you are doing. Some questions to ponder:
Why are you recording for only 0.1 seconds at a time?
I need 40kHz(sample rate) and want to acquire 1000 number of samples.
Why are you starting everything over each time through the loop?
With loops, all three steps(acquiring, generating output and writing) are running in parallel.
Why are you overwriting your TDMS file? (or have you set it up to extend it each loop by 100 samples?)
I am appending it. What do you mean by extending the loop to 100 samples? Kindly guide!
Why are you creating three plots each time you sample?
I can plot one graph as well.
And the most important question (since you seem to want to take data from something) -- Have you ever opened NI MAX (the Measurement and Automation Explorer) and used it to "play" with your device, and the various settings for the DAQmx Task?
In what sense? I configured it once as recommended before using it.
I hope it answers your questions.