PROGRAMING WITH THE PAMUX DRIVER
3-20
Pamux User’s Guide
CONFIGURE ANALOG BANK
13
P
URPOSE
:
Configures a bank of eight analog I/O points.
C
OMMAND
T
YPE
:
Analog
P
ARAMETERS
:
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.
R
EMARKS
:
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.
E
XAMPLE
:
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
120
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
Содержание PAMUX
Страница 10: ...TABLE OF CONTENTS x Pamux User s Guide...
Страница 14: ...TABLE OF CONTENTS xiv Pamux User s Guide...
Страница 103: ...PROGRAMING WITH THE PAMUX DRIVER 3 42 Pamux User s Guide...
Страница 121: ...PROGRAMING WITHOUT THE PAMUX DRIVER 4 18 Pamux User s Guide...
Страница 125: ...TROUBLESHOOTING AND TIPS A 4 A 4 A 4 A 4 A 4 Pamux User s Guide...
Страница 135: ...SPECIFICATIONS B 10 Pamux User s Guide...
Страница 141: ...TEMPERATURE CONVERSIONS ROUTINES C 6 Pamux User s Guide...
Страница 143: ...PRODUCT SUPPORT D 2 Pamux User s Guide...
Страница 149: ...GLOSSARY E 6 Pamux User s Guide...