LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with high speed voltage measurement (10 kHz)

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

0 Kudos
Message 1 of 13
(3,255 Views)

What is the error message you are getting?

Benoit

0 Kudos
Message 2 of 13
(3,219 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 13
(3,207 Views)

The error I get is Error -200279, it occurs whenever I stop and then restart the vi.

 

 

 

0 Kudos
Message 4 of 13
(3,188 Views)

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

0 Kudos
Message 5 of 13
(3,175 Views)

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?

0 Kudos
Message 6 of 13
(3,169 Views)

Benoit,

 

 

Thanks for the suggestion, I'll try that out. I definitely don't want to miss any data points. 

0 Kudos
Message 7 of 13
(3,144 Views)

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

0 Kudos
Message 8 of 13
(3,141 Views)

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.

0 Kudos
Message 9 of 13
(3,060 Views)

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

 

 

0 Kudos
Message 10 of 13
(3,055 Views)