LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx acq to queue, queue grows too fast

Solved!
Go to solution

@Patrem1 wrote:

Thank you ng,

 

I did not know this behavior of the DAQmx Read to send empty data in this case. Was not that clear in the help. 

Putting something else than 1 works. 

 

Ben, what do you mean quality this? 

To explain what this goes into I'm in the process of learning QMH architecture and doing a data acquisition and logging program to pratice this. 

 

In my program the samping rate can be modified and I want the data to be read as fast as possible and send to the queue to be logged in a file by another loop.

 


Qualify

 

You can only send as fast as the data is acquired.

 

With NO timer and a "-1" you are burning up CPU posting empty queue entries.

 

Just try out what I suggested.

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 11 of 13
(311 Views)

I did it's working as I said. 

I understand I can only read data as fast as it's acquired. I meant that's what I want my Acq loop to do as fast as possible. 

 

I realize I have some reading to do about continous sampling settings, timing, etc. 

Before I only worked with samples on demand as I worked with slow processes. 

 

The thing is my sampling rate can vary, this is what I put for now after checking the 'Continuous Measurement and Logging (NI-DAQmx)' NI exemple project : 

DAQmx Timing :
Sample Rate = X
Sample per channel = Sample rate/10

DAQmx Read :

Number of sample per channel : DAQmx timing property node : quantity sample per channel

 

With this it reads 1 sample when I put Sample Rate at 10.

 

Any additional tips are welcome. 

 

Thank you, 

0 Kudos
Message 12 of 13
(299 Views)

Some of the example are old, but my advice is to NOT do a consumer - producer type system for saving DAQmx data if it can be avoided. Look at the examples in the example folder for DAQmx and see how they do logging. Hint logging is built directly into the API, no separate loops, no queues, no memory overflows.

 

mcduff

 

Below is part of the Voltage - Continuous Input VI.

 

 

Snap13.png

 

0 Kudos
Message 13 of 13
(285 Views)