National Instruments PC-OPDIO-16 Telescope User Manual


 
NI-DAQ Function Reference Chapter 6
PC-OPDIO-16 User Manual 6-6 © National Instruments Corporation
Note to C Programmers: state is a pass-by-reference parameter.
Using This Function
DIG_In_Line returns the digital logic state of the specified digital line in the specified port. If
the specified port is configured as an input port, NI-DAQ determines the state of the specified
line by the way in which some external device is driving it. If the port is configured as an output
port and the port has read-back capability, NI-DAQ determines the state of the line by the way in
which that port itself is driving it.
DIG_In_Port
Format
status = DIG_In_Port (deviceNumber, port, pattern)
Purpose
Returns digital input data from the specified digital I/O port.
Parameters
Direction Name Type Description
Input deviceNumber I16 assigned by configuration utility
port I16 digital I/O port number
Output pattern I16 8-bit digital data read from the specified port
Parameter Discussion
port is the digital I/O port number.
Range: 0 through 1
Port A = 0
Port B = 1
Note: You will normally use input port B with this function.
pattern returns the 8-bit digital data read from the specified port. NI-DAQ maps pattern to the
digital input lines making up the port such that bit 0, the least significant bit, corresponds to
digital input line 0. The high eight bits of pattern are always 0.
Note to C Programmers: pattern is a pass-by-reference parameter.
Using This Function
DIG_In_Port reads digital data from the port on the specified board. If the port is configured
as an input port, reading that port returns the digital logic state of the lines as some external
device is driving them. If the port is configured as an output port and has read-back capability,
reading the port returns the output state of that port, along with a warning that NI-DAQ has read
an output port.