Digread – Measurement Computing Personal488 rev.3.0 User Manual
Page 80

Personal488 for Windows 95/98/Me/NT/2000
04-10-01
API Reference 6-12
DigRead
AT488pnp and PCI488 Only !
Syntax
INT WINAPI DigRead(DevHandleT devHandle);
devHandle
refers to an interface handle.
Returns
-1
if no part of the port is configured for input, or other error
otherwise, integer between
0
and
255
if the entire digital I/O port is configured for input; or
integer between
0
and
15
if only one nibble (either low or high) is configured for input
Bus States
None
Example
int i = DigRead(devHandle);
Returns the current value of the digital I/O
port per the current configuration.
See Also
DigSetup, DigWrite
The
DigRead
command reads the current value of the digital IO port per the input/output configuration of
the port. If the entire port is configured for input, a value between
0
and
255
is returned. If either the
upper or lower nibble is configured for input, and the other for output, a value between
0
and
15
is
returned.
Note:
This function does not configure the digital I/O port for input. The caller must use
DigSetup
to configure the port for input before performing any reads. If neither nibble is configured for
input the function returns
-1
and sets the error code to
IOT_BAD_VALUE2
.