Ni tutorial-2903-en

1
1/1 www.ni.com Simultaneous Analog Input and Output Publish Date: Sep 06, 2006 1. Description You can set up simultaneous analog input (AI) and analog output (AO) operations by using one of the following methods: Set up the AI and AO operations to both start and run independently Set up the AI and AO operations to start at the same time using a hardware or software trigger, but run independently Set up the AI and AO operations to use the same clock, thus preserving a phase relationship Independent AI and AO When you are not interested in data dependency between the input and output data, you can set up the AI and AO operations to run completely independently. For example, let's say that you want to measure a thermocouple and write a sine wave to a speaker. These are two unrelated operations that occur on two different systems. You can set up two totally independent parallel loops doing continuously buffered input and output, or you can use single-point AI and AO operations. Triggering for Independent AI and AO When you're not interested in data dependency, but you would like the two independent AI and AO operations to start at the same time, you can use hardware or software triggering to start the AI and AO operations at the same time. Software triggering just involves polling a certain channel for the value until it passes a threshold. When the triggering criteria are met, the software then launches the AI and AO operations simultaneously. (Since you're relying on software commands to start both operations, this method is not completely precise). When you use hardware triggering, the hardware waits to read data from the input buffer and write data to the DAC, until a trigger is sent to the PFI (programmable function input) pin. The PFI pin is the start trigger. Synchronized AI and AO When you need to synchronize your AI and AO operations on a point-to-point basis, you can use an external clock. The clock is used for the input point conversions for the ADC and the output point writes to the DAC. To see if your device supports external clocking, refer to the documentation for your device. 2. Common Applications You often use simultaneous AI and AO in control systems where there is a mathematical importance of the time between reading a corresponding input point, and writing the output point. If this delay is not constant (as in synchronized AI and AO), you could change the dynamics of your system and cause the control loop to perform erratically or even become unstable.

Transcript of Ni tutorial-2903-en

Page 1: Ni tutorial-2903-en

1/1 www.ni.com

Simultaneous Analog Input and OutputPublish Date: Sep 06, 2006

1. DescriptionYou can set up simultaneous analog input (AI) and analog output (AO) operations by using one of the following methods:

Set up the AI and AO operations to both start and run independently

Set up the AI and AO operations to start at the same time using a hardware or software trigger, but run independently

Set up the AI and AO operations to use the same clock, thus preserving a phase relationship

Independent AI and AOWhen you are not interested in data dependency between the input and output data, you can set up the AI and AO operations to run completely independently. For example, let's say that you wantto measure a thermocouple and write a sine wave to a speaker. These are two unrelated operations that occur on two different systems. You can set up two totally independent parallel loops doingcontinuously buffered input and output, or you can use single-point AI and AO operations.

Triggering for Independent AI and AOWhen you're not interested in data dependency, but you would like the two independent AI and AO operations to start at the same time, you can use hardware or software triggering to start the AIand AO operations at the same time. Software triggering just involves polling a certain channel for the value until it passes a threshold. When the triggering criteria are met, the software thenlaunches the AI and AO operations simultaneously. (Since you're relying on software commands to start both operations, this method is not completely precise). When you use hardware triggering,the hardware waits to read data from the input buffer and write data to the DAC, until a trigger is sent to the PFI (programmable function input) pin. The PFI pin is the start trigger.

Synchronized AI and AOWhen you need to synchronize your AI and AO operations on a point-to-point basis, you can use an external clock. The clock is used for the input point conversions for the ADC and the outputpoint writes to the DAC. To see if your device supports external clocking, refer to the documentation for your device. 2. Common Applications

You often use simultaneous AI and AO in control systems where there is a mathematical importance of the time between reading a corresponding input point, and writing the output point. If thisdelay is not constant (as in synchronized AI and AO), you could change the dynamics of your system and cause the control loop to perform erratically or even become unstable.