LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cDAQ Timing with Labview RT issue...

Hello Friends,

 

I am having trouble with a timed loop and data acquisition on a new cDAQ device (9136). I have been quite familiar with PXI devices in the past. I am trying to read data (one counter input, one analog input) at a fixed rate inside a timed loop. However, the device does not seem to be capable to read two channels at 10 kHz, with one channel all is well, but if I read two channels in parallel, problems appear. I can not believe that this device should be that slow (from the spec everything looks well.) With a six year old PXI controller I could do much more!

 

Is there any general difference between PXI and cDAQ controllers in terms of data acquisition and timing?

 

I'll attach my code, just in case I am making something wrong.

 

Best regards

Matthias

0 Kudos
Message 1 of 7
(3,348 Views)

Hi Matthias,

 

why do you think you need to use a TWL for DAQmx tasks?

 

Convert the TWL to a simple while loop and set the "samples to read" at both DAQmxRead functions to 3000…

Best regards,
GerdW


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

Hi Gerd,

 

thanks for your reply. What I've attached is only a test - the goal is to port a real time PID controller from the old PXI system to the new cDAQ system. Since it is supposed to control a highly dynamic system, I need the timed while loop.

 

But I am stuck at the very beginning of the port!

 

BTW, with the PXI system, I used HW timed acquisition... this does not seem to be available with cDAQ, as I was afraid to learn.

 

Best regards

Matthias

0 Kudos
Message 3 of 7
(3,304 Views)

Hi Matthias,

 

Since it is supposed to control a highly dynamic system, I need the timed while loop.

I don't think you need  a TWL here.

The iteration speed is limited by the DAQmx functions, so I would go with a standard while loop.

When the loop will spin too fast you may add a "wait for next multiple".

 

I used HW timed acquisition... this does not seem to be available with cDAQ, as I was afraid to learn.

Which error do you get when you try to use HW timed acquisition?

(Which modules do you use? Which OS do you use?)

Best regards,
GerdW


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

Hi Gerd,

 

I need a strong deterministic system, at a 10 kHz rate, and I need to input three different channels, do some calculations and output on one other analog out channel, with an exact repetition rate of 10 kHz with as little jitter as possible. This worked almost ideally on a PXI system.

 

The HW timed single point acquisition is simply not available with cDAQ, as I learned (Link), it is a hardware design feature (or flaw?). That could be a major delay for the project if I do not find a workaround...

 

I did some further testing. The data from the two channels in the test vi posted earlier arrives in bunches, some loops see no data, some see 20-30 data points.

 

Any ideas are appreciated...

 

Best regards

Matthias

0 Kudos
Message 5 of 7
(3,286 Views)

Hi Matthias,

 

what about using hardware-timed multiple points sampling mode?

You can set the number of points to a low number like 1 or 2…

 

I still think you are better done using a simple while loop and letting DAQmx do the timing of the loop…

 

I need a strong deterministic system, at a 10 kHz rate

Then you should use either a PXI or a RIO RT system, maybe even use the embedded FPGA in such devices…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(3,283 Views)

Hi Gerd,

 

from what I learned in the meantime, I believe that you are right - PXI or RIO would be right. cDAQ is simply not able to do what I need...

 

Thanks for your patience and support,

 

Matthias

0 Kudos
Message 7 of 7
(3,157 Views)