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.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

I need to develop a RT control algorith

m using the AT-MIO-16E and AT-AO-6 boards that I currently have. I need to get input from 2 channels and post outputs to 3 channels once every 5 ms. Can this be done? If so could someone tell me how or provide me with the title of a good reference book.
0 Kudos
Message 1 of 2
(2,681 Views)
m using the AT-MIO-16E and AT-AO-6 boards that I currently have. I need to get input from 2 channels and post outputs to 3 channels once every 5 ms. Can this be done? If so could someone tell me how or provide me with the title of a good reference book.This is a rather advanced application, and success depends on many factors.

The general procedure in this case is to use hardware timing for the analog input acquisition. You would configure the AT-MIO-16E board for continuous clocked analog input at a scan rate of 200-Hz (200hz = 5ms period). The program would then do an AI_Read(), extract the 2 inputs, do whatever math you want in your algorithm, and then write out to the AO points. This general procedure is referred to as a "hardware timed" control loop, as the loop will run at the scan rate of 200-hz. For a sample of this structure, look for "Simultaneous Analog Input and Output" examples that ship with most of the NI programming environments (LabVIEW, CVI, etc).

The main problem is this : Can the hardware, comput
er, and software keep up with the 200-hz acquisition? The answer to this question is difficult, and depends greatly on the computer, operating system, user-interface updates, other running tasks, efficiency of the control loop, etc. Also, keep in mind that if Windows is your platform, you could potentially even run into the problem of building this program, having it run great, but then have the computer momentarily not keep up with the 200-hz acquisition because someone decides to move a Window. If this becomes a problem, you can opt for a Realtime operating system, such as LabVIEW RT.

My best recommendation would be to start with the simultaneous input/output examples running on your hardware. Modify the loop for the 2 input / 3 output requirement, and add some math or user-interface updates to approximate your final design. Then run a series of benchmark tests to see what kind of loop-rate you can reliably achieve. If it's not at least an order of magnitude above the 200-hz,
then you should consider a realtime OS.

Greg
0 Kudos
Message 2 of 2
(2,681 Views)