Using Set Output Data and Set Output Enable

NI R Series Multifunction RIO Device Drivers Help

Edition Date: May 2018

Part Number: 371508V-01

»View Product Info
Download Help (Windows Only)

All of the digital lines on the R Series devices are bidirectional. These lines can be individually configured for input or output. Internal to the R Series device, a Digital Enable (DE) signal controls whether the line is configured for input or output. When the DE is set to True, the digital line is configured as an output, and the value stored in Digital Data (DD) will be driven on the digital line. When the DE is set to False, the digital line is configured as a high-impedance input allowing the line to be driven by an external device. Regardless of the state of the DE, the Digital Input (DI) can be monitored to observe the current state of the digital line.

The following figure shows how the Digital Input (DI), Digital Data (DD), and Digital Enable (DE) signals operate to control a single digital line on the I/O connector.

When an FPGA I/O Node configured for output is executed, the data written to the FPGA I/O Node is written to the DD of the digital line, and the DE for the digital line is automatically set to True. This causes the line to be configured as an output driving the specified data. When an FPGA I/O Node configured for input is executed, the current state of the digital line is sampled using the DI signal and returned by the FPGA I/O Node. The DE value is not updated by an FPGA I/O Node configured for input.

If you need more precise control over the DD and DE signals, use the Set Output Data and Set Output Enable methods. The Set Output Enable method takes the value wired to the input of the method and writes it to the DE control signal. This allows you to change the direction of the digital line without affecting the data on the line. The Set Output Data method takes the value wired to the input of the method and writes it to the DD signal. This allows you to change the data driven on the line when the line is configured as an output without affecting the currently configured direction (DE).

Two-Way Communication

To perform two-way communication, after executing an FPGA I/O Node configured for output, run a Set Output Enable method with a False wired to the input before allowing the line to be powered externally. After this step, you can read the input value using an FPGA I/O Node configured for input. When the line is no longer powered externally, you can configure the line for output again using either an FPGA I/O Node configured for output or by running a Set Output Enable method with a True wired to the input.

WAS THIS ARTICLE HELPFUL?

Not Helpful