Inputs and outputs (I/O) on FPGA targets allow you to connect the FPGA target to other hardware in the system. FPGA I/O resources are fixed parts of the FPGA targets that you use to transfer data among the different parts of the system. On some FPGA targets, FPGA I/O resources correspond to lines on front panel connectors, PXI backplanes, or RTSI connectors. On other FPGA targets, FPGA I/O resources are nodes inside FPGAs that connect the part of the FPGA designed by National Instruments with the part of the FPGA you design. Each FPGA I/O resource has a specific type, such as digital or analog. An FPGA target might have multiple resources of the same or different types. You can create FPGA I/O items, determine the I/O resources on the FPGA target that you want to use, and then assign unique names to the I/O resources you use.
![]() |
Note Refer to the specific FPGA target hardware documentation for information about supported features and I/O functionality on the FPGA target you use. Refer to Managing Shared Resources, Contention, and Arbitration for information about arbitrating I/O resources. |
Resources translate physical quantities to or from a digital value that you manipulate in FPGA Module software. An I/O resource has a terminal for receiving or generating a physical quantity. Many I/O resources on FPGA targets have physical terminals to which you can directly connect elements of the system. For example, digital signals, sensors, actuators, and so on, on some resources are associated with terminals built into the device, such as an on-board temperature sensor.
When the FPGA VI runs on the FPGA target, it performs the I/O operations in hardware. For example, if you configure an FPGA I/O Node to read a digital line, the FPGA I/O Node reads the line and returns the result to the FPGA VI. Because FPGA VIs run on the FPGA, the VI can react to the input with the speed and determinism available in the FPGA target hardware.
You can put inputs and outputs, analog and digital, all in the same node on the block diagram. You can use target-specific properties and methods on the FPGA I/O items with the FPGA I/O Property Node and the FPGA I/O Method Node, respectively.
FPGA targets might organize digital I/O resources as individual lines or as groups of lines called ports. Some FPGA targets provide access to digital I/O resources as only lines or ports. Other FPGA targets allow you to access the same physical lines as both individual lines and as ports. Use the following categories of digital I/O resources for different types of applications.
You can read digital input FPGA I/O resources with the FPGA I/O Node. Use digital input resources to monitor circuitry outside the FPGA target.
You can write digital output FPGA I/O resources with the FPGA I/O Node. Use digital output resources to control circuitry outside the FPGA target. Some targets might allow you to read digital output resources.
You can read and write digital input and output FPGA I/O resources with the FPGA I/O Node. You can use digital input and output resources to monitor and control circuitry outside the FPGA target. Digital input and output resources allow you to configure the resource and control the direction. The default direction typically is input.
If you use an FPGA I/O Node to read a digital input and output resource, the FPGA I/O Node does not change the direction of the resource. If you use a digital input and output resource for output, you must disable the output before you can use the same resource to read an external signal. Use the FPGA I/O Method Node with the Set Output Enable method to disable the output line before you use an FPGA I/O Node configured with a digital input resource to read the state of an external signal.
If you use the FPGA I/O Node to write a digital input and output resource, the FPGA I/O Node both writes the data and enables the terminal for output. You also can use the FPGA I/O Method Node with the Set Output Data method to write data without enabling the output. Use the FPGA I/O Method Node with the Set Output Enable method to enable the digital terminal, which allows the data to be driven out. Use the Set Output Data method before the Set Output Enable method to specify the state of the digital input and output resource when you enable the output. For example, you might have one portion of the block diagram continuously generating an internal signal. Use the FPGA I/O Method Node with the Set Output Enable method in another portion of the block diagram to independently control when the internal signal is actually driven out to an external device.
If the FPGA target you use includes analog input resources, you can configure an FPGA I/O Node to read an analog input value. If you configure the FPGA I/O Node to read an analog input, the FPGA I/O Node might initiate a conversion, wait for the result, then return the binary representation of the voltage as a signed integer. The analog input process and the size of the data type of the result varies by FPGA target. For many FPGA targets, you create the FPGA VI to use the binary representation for operations within the FPGA VI. You also can pass the binary representation back to the host VI and convert the binary representation to a voltage or other physical quantity if you have a transducer attached to the FPGA target analog input.
The equation you use to convert the binary representation to a physical quantity depends on the FPGA target and transducer. Refer to the specific FPGA target hardware documentation for more information. For example, with an NI PXI-7831R device, use the following equation to convert the binary representation to voltage: Input Voltage = (Binary Code / 32768) x 10.0V.
![]() |
Note Avoid executing this calculation in the FPGA VI because the FPGA only supports integer operations. Also, performing the calculation consumes space on the FPGA. Refer to Understanding How to Program FPGA VIs for more information about mathematical operations in FPGA VIs. |
If the FPGA target you use includes analog output resources, you can configure an FPGA I/O Node to write an analog output value. If you configure the FPGA I/O Node to write an analog output, the FPGA I/O Node writes the binary representation of the voltage to the digital-to-analog converter (DAC), which sets the analog output voltage. The size of the data type varies by FPGA target. You can generate voltage information in two sources—the host VI or the FPGA VI. Typically the host VI converts the voltage to an appropriate binary representation before writing the value to the FPGA VI. If the FPGA VI determines the voltage, typically the FPGA VI performs the calculations using the appropriate binary representations. In both cases, the DAC produces a voltage that corresponds to the binary representation.
The equation you use to convert a voltage to a binary representation depends on the specific FPGA target. Refer to the specific FPGA target hardware documentation for more information. For example, with an NI PXI-7831R device, use the following equation to convert the voltage to the binary representation: Binary Code = (Output Voltage x 32768) / 10.0V.
![]() |
Note Avoid executing this calculation in the FPGA VI because the FPGA only supports integer operations. Also, performing this type of calculation on the FPGA uses additional space. Refer to Understanding How to Program FPGA VIs for more information about mathematical operations in FPGA VIs. |