PROGRAMING WITHOUT THE PAMUX DRIVER
4-6
Pamux User’s Guide
WRITING DIGITAL OUTPUTS
You must be especially careful when writing to Pamux stations. When writing to a bank of eight
modules that includes both inputs and outputs, you
must
be sure to write 0’s to input module
positions. If you write a 1 to an input module, the module will read back as being active (on) even if it
is inactive (off).
The following example writes to 16 digital output channels using dummy data that implements a ring
counter, which is used to shift the bits of the register to the left one bit at a time. Note that an output
mask is used to prevent input channels from being turned on. If an input is turned on, it will read “on”
regardless of its actual input state.
DIM a&: a& = 1
DIM OutputData%
‘ Prevents a 1 from being written to an input
DO WHILE 1
‘ Loop until ctrl-break
a& = a& * 2: IF a& > &HFFFF& THEN a& = 1
‘ Generate some dummy data
OutputData% = a& AND MyDigitalOutMask%
CALL GetUpperAndLowerBytes(OutputData%, UpperByte%, LowerByte%)
OUT MyAc28IoPort% + MyDigitalBoard% + 1, UpperByte%
OUT MyAc28IoPort% + MyDigitalBoard%, LowerByte%
LOOP
READING FROM AND WRITING TO ANALOG PAMUX
STATIONS
Each Pamux B6 analog brain board interfaces to the Pamux bus through a dual-port RAM device. The
on-board microprocessor constantly reads from and writes to this dual-port RAM. For the host
computer to access data, the host must first request permission to access the contents of the RAM.
This handshaking scheme prevents contention problems.
Each analog Pamux brain board takes up two byte locations on the bus. The upper address is the
control register, the lower address is the data register. The control and data registers are at the
following locations:
•
Control Register Address
=
AC28 Base A Pamux A 1
•
Data Register Address
=
AC28 Base A Pamux Address
The Pamux address is set by configuration jumpers on the B6 brain board. Configuration jumpers on
the AC28 determine its base address.
Содержание 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...