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.
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.