Digwrite – Measurement Computing Personal488 rev.3.0 User Manual
Page 82

Personal488 for Windows 95/98/Me/NT/2000
04-10-01
API Reference 6-14
DigWrite
AT488pnp and PCI488 Only !
Syntax
INT WINAPI DigWrite(DevHandleT devHandle, BYTE byDigData);
devHandle
refers to an interface handle.
byDigData
refers to a value to write to the digital output port, where the integer range is
between
0
and
255
if the entire digital I/O port is configured for output, or between
0
and
15
if only one nibble (either low or high) is configured for output.
Returns
-1
if no part of the digital I/O port is configured for output.
Bus States
None
Example
DigRead(devHandle, 0x0A);
Writes the given value to the digital I/O port per
the current configuration.
See Also
DigSetup, DigRead
The
DigWrite
command writes the given value to the digital I/O port per the input/output configuration of
the port. If the entire port is configured for output, then the data value with a range from
0
to
255
is written
to the port. If either the upper or lower nibble is configured for input, and the other for output, then the data
value is truncated to the range from
0
to
15
and it is written to the appropriate nibble per the current
configuration.
Notes:
(1)
This function does not configure the digital I/O port for output. The caller must use
DigSetup
to configure the port before performing any reads or writes. If neither nibble is
configured for output the function returns
-1
and sets the error code to
IOT_BAD_VALUE2
.
(2)
Outputs do not persist after an interface is closed. At that time, all digital I/O lines are
configured for input.