Instruction manual

AMPDIO DRIVERS
Page 179
array is wired correctly with suitable diodes and resistors, otherwise the board could get
damaged. See section 3.2.2 for details. Only one switch matrix implementation is available per
board.
i = DIOsetSwitchMatrix (h, order)
where h short: board handle as issued by the
registerBoardEx function
.
order short: order of the matrix (12, 24 or 36).
Returns short: OK
or ERRHANDLE
ERRCHAN
Prior Calls registerBoardEx
See Also DIOgetSwitchStatus
DIOfreeSwitchMatrix
6.4.12.2 Query Status of a Switch within the Scan Matrix DIOgetSwitchStatus
Queries the status of a particular switch in the switch matrix set up by the DIOsetSwitchMatrix
function. The grid reference of the switch is given, and the function performs a test on that
switch and returns 1 for switch on (closed) or 0 for switch off (open).
i = DIOgetSwitchStatus (h, xcoord, ycoord)
where h short: board handle as issued by the
registerBoardEx function.
xcoord short: X-co-ordinate of the position of the
switch in the matrix (origin is at port A0/B0 of
PPIX). Valid values should be in the range 0
order (as specified in DIOsetSwitchMatrix).
ycoord short: Y-co-ordinate of the position of the
switch in the matrix (origin is at port A0/B0 of
PPIX). Valid values should be in the range 0
order (as specified in DIOsetSwitchMatrix).
Returns short: Zero, if switch was OFF (open). Non-zero if switch was ON
(closed).
or ERRHANDLE
ERRCHAN
Prior Calls registerBoardEx
DIOsetSwitchMatrix
See Also DIOfreeSwitchMatrix
6.4.12.3 Free-up the Digital I/O Chip(s) from a Switch Matrix — DIOfreeSwitchMatrix
Frees the DIO resources used by the switch matrix as set up in function DIOsetSwitchMatrix.