The Digital Input and Digital Output blocks are generic blocks for all DAQ boards supported by SLDRT, so there is no specific board-related mapping for these blocks. As an example, the hardware pin configuration for the PFI pins for "NI PCI-6221 37-pin" according to the NI documentation is the following: For this board, the pin mapping has been verified to be as follows:
- Channels 1 to 2: P0.0 to P0.1
- Channels 3 to 32: P0.2 to P0.31 (not available on NI 6221 37-pin)
- Channels 33 to 40: P1.0 to P1.7 (PFI0 to PFI7)
- Channels 41 to 48: P2.0 to P2.7 (PFI8 to PFI16) (not available on NI 6221 37-pin)
To use all digital and PFI input pins for this board, uncheck all the square boxes in the Board Setup, and specify [1,2] for digital pins and [33:40] for the PFI pins in the 'Input channels' parameter of the Digital Input block, as shown in the screenshots below: To check which pins for plain digital I/O correspond to hardware pins for other boards, you can use the same approach. Uncheck all the checkboxes in the Board Setup and then specify the full channel vector (e.g. [1:8]) in the 'Input channels'. Then run the model while demuxing the input signal to find from which pins the corresponding inputs are coming in.
For example, for a 64-bit NI-PCI-6601 board, you will see the error message:
Digital Input channels must be between 1 and 8 for board 'National Instruments PCI-6601'
So the channels 1-8 correspond to PFI0.0 to PFI0.7, respectively.
IMPORTANT: Note that the Digital Input & Digital Output blocks are only intended for general-purpose I/O pins. Pins for counters (CTR), timers and encoders are mapped to specific blocks for best performance:
- Counter Input: Read from one or multiple counter-input channels
- Encoder Input: Read from one or multiple incremental encoder input channels
- Frequency Output: Write to one or multiple frequency or PWM output channels