National Instruments PCI-6221/37 Digital Input

Digital Input block for PCI-6221/37 and PXI-6221/37 boards


Simulink® Real-Time™ Library for National Instruments®


Models can have multiple digital input blocks for one physical board. In this case, the Simulink Real-Time environment executes the blocks based on their sorted order as determined by the Simulink software.

Each board has one set of static digital I/O ports. You can independently configure each port to be input or output.

If a digital input block shares channels with a digital output block, the input block reads the last value written to the digital output block on the overlapping channels.

Scaling of Input to Output

I/O Module Input

Block Output Data Type




TTL low ≥ 0.0
TTL high = 1.0

Block Parameters

Channel vector

Enter numbers 1 or 2 to select the digital input lines used with this port. This driver allows the selection of individual digital input lines in arbitrary order. The number of elements defines the number of digital lines used.

For example, to use both digital inputs for one port, enter


Number the lines beginning with 1 even if this board manufacturer starts numbering the lines with 0.

Sample time

Enter the base sample time or a multiple of the base sample time (-1 means sample time is inherited).

PCI slot (-1:autosearch)

If only one board of this type is in the target computer, enter -1 to locate the board.

If two or more boards of this type are in the target computer, enter the bus number and the PCI slot number of the board associated with this driver block. Use the format [BusNumber,SlotNumber].

To determine the bus number and the PCI slot number, type:

tg = slrt;
getPCIInfo(tg, 'installed')

External Websites

Was this topic helpful?