10-17-2018 05:12 PM
I am trying to acquire voltage measurements for times between 1 and 5 minutes, but whenever I run my code I keep getting errors. Is there a better way for me to set up my block diagram to fix these problems?
Thanks
10-17-2018 09:27 PM
What is the error message you are getting?
Benoit
10-18-2018 02:05 AM
Hi flame,
- don't convert your waveforms to large text files.
- don't hide delete the label of terminals in the block diagram!
- don't use ExpressVIs in tight loops…
Have the DAQmx task store the data directly to a TDMS file. See the example VIs coming with LabVIEW and DAQmx to learn about that feature!
10-18-2018 12:35 PM
The error I get is Error -200279, it occurs whenever I stop and then restart the vi.
10-18-2018 08:10 PM
According to the error description:
The application is not able to keep up with the hardware acquisition.
Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.
Your loop is running slower than the acquisition rate.
I suggest you to have two loop in parallel. 1 for high speed... acquisition and another one for user interface and saving data.
Actually, the buffer on the acquisition card is full before you can go to read it. the LabVIEW report you this error meaning you are mission some acquisition point.
Benoit
10-18-2018 09:58 PM
How are you stopping your VI? The only thing that stops that while loop is the error wire coming from the DAQmx read. So if you have an error, it will stop. If you don't have an error it will run forever.
So if the error occurs when you stop and restart, how did you stop the VI?
10-19-2018 10:15 AM - edited 10-19-2018 10:42 AM
Benoit,
Thanks for the suggestion, I'll try that out. I definitely don't want to miss any data points.
10-19-2018 10:43 AM
In addition, get rid of the property nodes in your block diagram and use a local variable instead. The value property causes a switch to the UI thread, which may make you loop wait.
mcduff
11-07-2018 12:49 PM
So I added a stream to my VI and moved the data writing to a separate loop, which seemed to fix my problem.
What I'm worried about now, is if having my timed write loop in a separate while loop, might cause me to collect old data and not up to date data, if the stream has to buffer.
Does anyone know if this is the case or not.
11-07-2018 01:22 PM
Since your are writing in TDMS why not use the automatic logging features of it? Your consumer loop may be behind your read loop, but the data is buffered, should not be a problem.
I modified one of the Examples in the Example finder that may suit your needs, that uses the built in logging features.
mcduff