08-24-2017 09:38 AM
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
08-24-2017 09:51 AM
08-25-2017 01:25 AM - edited 08-25-2017 01:30 AM
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
08-25-2017 02:18 AM
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?)
08-25-2017 03:54 AM
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
08-25-2017 04:29 AM - edited 08-25-2017 04:29 AM
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…
08-28-2017 01:35 AM
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