Pamux User’s Guide 79
CONFIGURE ANALOG BANK, EXPANDED 14
PURPOSE:
Configures a bank of eight analog I/O points.
COMMAND TYPE:
Analog
PARAMETERS:
COMMAND Contains the value 14.
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 0, the corresponding module position will be
configured as an input. If an element is set to 1, the corresponding module
position will be configured as an output.
REMARKS:
All output module positions must first be configured as outputs before values can be written to
them. 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% = 14 ‘ Configure Analog Bank, Expanded
110 ADDRESS% = 5 ‘ Address of brain board
12 0 POSITION% = 0 ‘ Bank number
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