Solution
The technique used to accomplish this task differs depending on whether the output of interest is analog or digital.
Reading Back Analog Output
LabVIEW
While you cannot read this channel with the default settings for a DAQmx Physical Channel, you can read the Analog Output in relation to the Analog Output Ground by enabling the selection of Internal Channels:
- Place a DAQmx Physical Channel Control/Constant in your program. (All Controls»I/O»DAQmx Name Controls»DAQmx Physical Channel)
- Right click on the Constant and click I/O Name Filtering...
- In the window that opens make sure to select Internal Channels and click OK.
- Now select the channel _aoX_vs_aognd where X is the desired output channel.
You are now able to select any of these internal channels as a voltage that you are able to read. You can also select the various other physical channels that you want to read by clicking
Browse and selecting the desired lines.
The following screenshot illustrates provides an example of monitoring a continuous analog output. The code is a modification of a DAQmx shipping example for analog generation designed to also read the output.
LabWindows/CVI
- In a source (.c) file, type the function and then right-click on the text, and select Recall Function Panel.
- In the function panel, click the ”…” button next to the text box beneath Physical Channel, and select Filter…
- In the Filter Settings dialogue that pops up, select Internal Channels and click OK.
- Now select the channel _aoX_vs_aognd where X is the desired output channel.
Reading Back Digital Output
LabVIEW
With digital I/O lines, you can use a DAQmx Read to read the value back from the same output channel without having to internally route signals. The following VI Snippet illustrates how to accomplish this:
LabWindows/CVI
The same operation programming flow shown above for LabVIEW can be used in LabWindows/CVI when using digital lines. You can simply call a DAQmxRead
function on a digital output channel to read the current line state.