70 Pamux User’s Guide
CONFIGURE DIGITAL BANK, EXPANDED 5
PURPOSE:
Configures a bank of eight digital I/O points.
COMMAND TYPE:
Digital
PARAMETERS:
COMMAND Contains the value 5.
ADDRESS Contains the address of the Pamux brain board.
POSITION Contains the bank number.
VALUE ARRAY Each element of this array corresponds 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
configured as an output. If an element is set to 0, the corresponding module
position is configured as an input.
REMARKS:
All output module positions must first be configured as outputs before they can be activated. The
driver will ignore any write commands to positions configured as inputs and no errors will be
returned.
EXAMPLE:
This example configures bank 0 at address 5 with module positions 0, 2, 4, and 6 configured as
inputs and positions 1, 3, 5, and 7 configured as outputs.
100 COMMAND% = 5
‘ Configure Digital Bank, Expanded
110 ADDRESS% = 5
‘ Address of brain board
12 0 POSITION% = 0
‘ Bank number 0
13 0 VALUE%(0) = 0
‘ Input module 0
14 0 VALUE%(1) = 1
‘ Output module 1
15 0 VALUE%(2) = 0
‘ Input module 2
16 0 VALUE%(3) = 1
‘ Output module 3
17 0 VALUE%(4) = 0
‘ Input module 4
18 0 VALUE%(5) = 1
‘ Output module 5
19 0 VALUE%(6) = 0
‘ Input module 6
20 0 VALUE%(7) = 1
‘ Output module 7
210 GOSUB 1000
‘ Call the driver
.
.
1000 CALL
Pamux(ERRCOD%,ADDRESS%,COMMAND%,POSITION%,VALUE%(0))
1010 IF ERRCOD% < 0 THEN GOTO 2000
1020 RETURN
PROGRAMING WITH THE PAMUX DRIVER