National Instruments PC-OPDIO-16 Manuale Utente

Pagina di 92
NI-DAQ Function Reference
Chapter 6
PC-OPDIO-16 User Manual
6-8
© National Instruments Corporation
DIG_Out_Port
Format
status = DIG_Out_Port (deviceNumber, port, pattern)
Purpose
Writes digital output data to the specified digital port.
Parameters
Direction
Name
Type
Description
Input
deviceNumber
I16
assigned by configuration utility
port
I16
digital I/O port number
pattern
I16
8-bit digital pattern for the data written
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 output port A with this function.
pattern indicates the 8-bit digital pattern for the data written to the specified port.  NI-DAQ
ignores the high eight bits of pattern.  NI-DAQ maps the low eight bits of pattern to the digital
output lines making up the port so that bit 0, the least significant bit, corresponds to digital
output line 0.
Using This Function
DIG_Out_Port
 writes the specified digital data to the port on the specified board.  If you have
not configured the specified port as an output port, NI-DAQ does not perform the operation and
returns an error.  You must call 
DIG_Prt_Config
 to configure a digital I/O port as an output
port.