Pamux User’s Guide 73
READ DIGITAL BANK, EXPANDED 8
PURPOSE:
Reads a bank of eight digital I/O points.
COMMAND TYPE:
Digital
PARAMETERS:
COMMAND Contains the value 8.
ADDRESS Contains the address of the Pamux brain board.
POSITION Contains the bank number.
VALUE ARRAY Each element of this array contains returned data corresponding to a module
position within the bank. Element 0 corresponds to the first module position,
element 7 corresponds to the last. If an element is set to -1, the corresponding
module position is active (on). If an element is set to 0, the corresponding
module position is inactive (off).
EXAMPLE:
This example reads the status of eight points at address 32 at bank 0 and then displays the status
of each point.
100 COMMAND% = 8 ‘ Read Digital Bank, Expanded
110 ADDRESS% = 32 ‘ Address of brain board
12 0 POSITION% = 0 ‘ Bank number
130 GOSUB 1000 ‘ Call the driver
1 4 0 FOR I% = 0 TO 7
150 IF VALUE%(I%) = 0 THEN STAT$ = "OFF"
ELSE STAT$ = " ON" ‘ Update STAT$
160 PRINT "MODULE "; I%; " :"; STAT$
170 NEXT
.
.
1000 CALL
Pamux(ERRCOD%,ADDRESS%,COMMAND%,POSITION%,VALUE%(0))
1010 IF ERRCOD% < 0 THEN GOTO 2000
1020 RETURN
PROGRAMING WITH THE PAMUX DRIVER