NI-845x DIO Basic Programming Model
- Updated2026-05-28
- 2 minute(s) read
When you use the DIO API, the first step is to configure the DIO port to be set for input or output as desired. Once the port is configured, you can write or read lines from the port. You can use either port or line I/O for all DIO calls. With the port calls, you can read or write all lines in a port at one time. Alternately, with the line calls, you can read or write the lines in a port one line at a time.
The following figure describes the basic programming model for the NI-845x DIO API. Within the application, you repeat this basic programming model for each DIO call you need to make. The figure is followed by a description of each step in the model.
Basic Programming Model for DIO Communication
DIO Port Configure
The DIO Port configuration is set with the NI-845x Device Property Node in LabVIEW and ni845xDioSet* calls in other languages. The following parameters are available for configuring the DIO Port:
- DIO:Active Port (LabVIEW only) is the active DIO port to configure. The subsequent property settings affect only the selected DIO port.
- DIO:Driver Type configures the driver type used when sourcing DIO signals. The two options are open-drain and push-pull.
- DIO:Line Direction Map indicates the direction (input or output) for each line in the 8-bit DIO port.
- I/O Voltage Level indicates the voltage level (when sourcing a high value) used for all push-pull I/O pins (SPI lines and DIO lines). It also affects the reference voltage that I²C pins are pulled-up to if using internal I²C pull-ups.
DIO Port Write
Use NI-845x DIO Port Write.vi in LabVIEW and ni845xDioWritePort in other languages to write an 8-bit pattern to the selected DIO port.
DIO Port Read
Use NI-845x DIO Port Read.vi in LabVIEW and ni845xDioReadPort in other languages to read an 8-bit pattern from the selected DIO port.
DIO Line Write
Use NI-845x DIO Line Write.vi in LabVIEW and ni845xDioWriteLine in other languages to write a value to a particular line within the selected DIO port.
DIO Line Read
Use NI-845x DIO Line Read.vi in LabVIEW and ni845xDioReadLine in other languages to read a value from a particular line within the selected DIO port.