From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

speed up DAQmx with cRIO

I will stay out of the weeds but will comment generally that...

 

Keeping an output running at the same rate as an input is a lot like reaching out over the front of a railroad locomotive to lay down track you just picked from behind the train.

 

If you do not stay ahead of the progress it will not go well.

 

Another point to keep in mind is outputs and inputs do not always run at exactly the rate we ask. The rate is hardware dependent. In which case hardware timing, using the output to clock the input can keep things lined up.

 

BUT...

 

If we are just trying to keep outputs updated with the right value to control the hardware, single point I/O updated after each cycle of the PI control loop will be just fine.

 

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 14
(824 Views)

If I don't include the timeout on the Dequeue element, then the .vi hangs when I hit "Stop."

 

The example that I modified to get this code does say that the consumer loop stops when the queue is released, which clearly isn't happening, or rather, I'm not releasing the queue when I think I am.  I'll try implementing your solution, thank you!

 

Regardless, I don't think that this is the overarching issue, because the .vi doesn't output an analog signal with or without the timeout.  Your assistance is greatly appreciated, however.

0 Kudos
Message 12 of 14
(818 Views)

Your comments (and analogies) make sense.

 

I'm fine with using single-point I/O, but hardware-timed single-point generation does not appear to be supported by my hardware.

 

I hacked in a Wait function that allows the producer to run a few times before the consumer starts (just to be sure it was working), with a sample rate of 100 Hz and 10 samples read per cycle.  The idea here is to make sure that I have enough track laid before the train gets going, so to speak.  Even though the producer clearly runs a time or three before the consumer starts, I still get the same error as before.

 

I'm thoroughly confused.  I appreciate both of you taking the time to help me, but I may just go back to what I had before, without the MATLAB loop.  At least then I am getting some sort of output.

 

 

0 Kudos
Message 13 of 14
(815 Views)

I would just do software timed single point updates.

 

The rate of the updates would depend on how often your control loop iterates.

 

Ben

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