12
DIGITAL I/O CARD–16
2.3.4 S
OFTWARE
The Digital I/O Card–16 ships with an I/O suite of Windows
®
98/Me/XP,
Windows NT
®
, and Windows 2000 drivers. These drivers provide you with a
consistent and straightforward application program interface (API), allowing the
developer to concentrate on the details of the application as opposed to low-level
driver development. Popular development environments, including Visual C++,
Visual Basic, and Delphi, are supported for application development. I/O includes
a utility for configuring the driver parameters under Windows, further simplifying
installation.
For DOS, QNX, Linux
®
and other operating systems, please refer to the software
included with your card.
Programming Examples
All examples assume a base address of 300 Hex.
To read inputs at port A :
MOV DX,300H
;Set DX to Port A
IN AL,DX
;Get Input Port Data
NOT AL
;data read is negative
logic
Programming example to set Relay #3 on, write a “1” in bit position D3, to port
address Base+3, or 303 Hex.
MOV DX, 303H
;Set DX to Port D
MOV AL, 00001000B
;Set bit 3 to a ‘1’
OUT DX, AL
Another method that takes into account the read-back capability of the output
ports C and D:
MOV DX,303H
;Set DX To Port D
IN AL,DX
;Get old port setting
NOT AL
:Invert bits- see note below
OR AL,00001000B
;OR in bit 3
OUT DX,AL
;Set Bit 3
NOTE
Reading back the ports (C and D) results in the binary complement of
the output.