Archived: How Do I Configure the PFI Lines on the NI 6601 or 6602 for Digital I/O?This document has been archived and is no longer updated by National Instruments
Primary Software: Driver Software>>NI-DAQ
Primary Software Version: 7.3
Primary Software Fixed Version: N/A
Secondary Software: N/A
Hardware: Counter/Timers (TIO)>>Devices>>PCI-6602, Counter/Timers (TIO)>>Devices>>PXI-6602, Counter/Timers (TIO)>>Devices>>PXI-6608
There are 8 lines dedicated to digital input and output (DIO) on the PCI-660x boards. The manual says that I can have 24 extra digital lines by configuring some of the counter PFI lines as digital lines. How do I do this in the software?
If you are doing digital input, you do not need to distinguish between counter lines and digital lines. You can read from any line by using the digital read VIs (Data Acquisition >> Digital I/O). If you want to use the programmable function input (PFI) lines for digital output, then you can configure them for digital output on a line-by-line basis. Refer to page 28/62 of the 660x User Manual for information on the pin assignments for digital I/O applications.
In LabVIEW, you can call the DIO Port Config.vi (Data Acquisition >> Digital I/O >> Advanced Digital I/O) and provide the appropriate line direction map to configure individual lines as output (the line direction map is defined below). You can then call the DIO Port Write.vi (Data Acquisition >> Digital I/O >> Advanced Digital I/O) with a proper line mask to perform output only on those specific lines (the line mask is defined below).
In the C application programming interface (API), you can use the DIG_Line_Config function to configure the lines individually as output, and you can use the DIG_Out_Line function to perform the output.
For counter applications, you can use the Select_Signal function (Route Signal.vi in LabVIEW) to enable a counter output.
Definitions (See the LabVIEW Data Acquisition Basics Manual or the NI-DAQ Function Reference Manual for more details):
Line Direction Map (DIO Port Config.vi)
The line direction map specifies the direction of each line in the port. If a bit is 0 in the line map, the line is an input line. If a bit is 1, the line is an output line. Set line direction map to -1 to make all the lines in a port output lines. Set line direction map to 0 to make all the lines in a port input lines. The line direction map parameter defaults to 0.
Line Mask (DIO Port Write.vi)
The line mask determines which lines a write affects. The default setting for line mask is -1, where you will write to the entire port and set all lines in the port to the states specified by the bits in the pattern input. The pattern input is a bit pattern of 1s and 0s. If you set only bit n in the line mask, the VI changes only port line n to the state that bit n of pattern specifies.
Product Manuals: LabVIEW Data Acquisition Basics Manual
Product Manuals: NI 660x User Manual
Developer Zone Example: Simultaneous Digital I/O and Event Counting with a 6602 Board
Developer Zone Example: Specifying the Function of Individual I/O Lines on E Series Devices
Report Date: 05/21/1999
Last Updated: 10/04/2011
Document ID: 1LK9SPX4