78 Pamux User’s Guide
CONFIGURE ANALOG BANK 13
PURPOSE:
Configures a bank of eight analog I/O points.
COMMAND TYPE:
Analog
PARAMETERS:
COMMAND Contains the value 13.
ADDRESS Contains the address of the Pamux brain board.
POSITION Contains the bank number.
VALUE ARRAY The first element of this array contains a one-byte bitmask (0–255) specifying
the configuration of the bank. Each bit corresponds to one module position. If a
bit is set to 1, the corresponding module position will be configured as an
output. If a bit is set to 0, the corresponding module position will be configured
as an input.
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 1 at address 4 with the first four positions as inputs and the second
four positions as outputs. Remember, bank 1 represents modules at positions 8 through 15, so in
this example bit 0 of the bitmask corresponds to module position 8 and bit 7 of the bitmask
corresponds to module position 15.
BIT POSITION 7 6 5 4 3 2 1 0
VALUE%(0) 1 1 1 1 0 0 0 0 = F0 hex or 240 decimal
100 COMMAND% = 13 ‘ Configure Analog Bank command
110 ADDRESS% = 4 ‘ Address of brain board
12 0 POSITION% = 1 ‘ Bank number
130 VALUE%(0) = &HF0 ‘ High nibble = outputs,
low nibble = inputs
140 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