LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-7041 pid loop rate

Hello,
I have PCI-7041/6040 card with which I would like to perform single point PID control. I have looked at the DAQmx example PID control - single channel.vi to do this. The only thing I am unsure on how to do, is set the loop rate to a specific kHz value. Is this done by using the 'Input Rate' control and how could I verify that the loop is running deterministically and to the rate I have set?
thanks,
David
0 Kudos
Message 1 of 2
(2,231 Views)
Hi David

You are correct that the "Input Rate" control will set the loop rate for the example that you are using. There are a few ways to determine if the loop is running deterministically.

One thing you can do is use the "DAQmx is Read or Write Late" VI. If the "is late?" output goes true, your loop is not keeping up with the specified hardware timed acquisition and generation.

Another recommended method to determine if your loop is running determinisitically is to benchmark it using the TimeStamp VI's.
There is a great example in the LabVIEW Example Finder that you can use for this. From the Example Finder, go to
Tookits and Modules >> Real-Time >> Timing >> NI Timestamp Code Timer.

You can combine your PID example code with this example to determine how long it takes for your PID code to execute when running on the real-time target. Just place the code you wish to benchmark in sequence 0 of the sequence structure of the Timestamp Code Timer example VI. This VI will give you some great information including average execution time and maximum jitter.
0 Kudos
Message 2 of 2
(2,215 Views)