Reference Manual

Turbo PMAC/PMAC2 Software Reference
Turbo PMAC On-line Command Specification 359
the optional second{constant} must be at least as great as the first {constant} it represents
the number of the end of the range;
{multiplex address} is an integer constant, divisible by 4, in the range 0 to 124, representing
the address in the multiplexing scheme of the first of four bytes in the 32-bit input or output word.
Adding 1 to the {multiplex address} designates it as a read-only variable and adding 2
designates it as a write-only variable.
This command causes Turbo PMAC to define the specified M-variable or range of M-variables to point to
a 32-bit word of input or output serially multiplexed on the thumbwheel port on an Accessory 34x board.
Note:
The individual bits of the thumbwheel port on an Acc-34x board cannot be directly
assigned to an M-variable. Only 32-bit words (ports) of input or output can be
accessed.
The base address of the Acc-34x on the multiplexer port is set by a DIP switch bank on the board. The
base address can take a value from 0 to 248, evenly divisible by 8.
The address of the 32-bit input port on the Acc-34x board is equal to the base address plus 1. (If the base
address is 16, the address of the input port is 17.)
The address of the 32-bit output port on the Acc-34x board is equal to the base address plus 6. (If the
base address is 32, the address of the output port is 38.)
The address of the optional supplemental input port available on some Acc-34x boards is equal to the
base address plus 3. (If the base address is 128, the address of the supplemental input port is 131.)
The address on the multiplex port specified here must match the address set by the DIP switch on board
the Acc-34x. The Acc-34x manual contains a table listing all of the possibilities.
Because the individual bits of the thumbwheel port cannot be accessed directly on an Accessory 34x
board and because of the relatively long time it takes to clock the data in or out of Turbo PMAC (A 32-bit
Read or a 32-bit Write to an individual port takes approximately 16 microseconds of time in the Turbo
PMAC's background time slot), it is best to keep an image of each M-variable of this type in internal
memory. The image variable would preferably be a 32-bit or 48-bit fixed point M-variable, but it could
also be a 48-bit floating point P or Q variable.
The best procedure for using TWS M-variables in a program is as follows. The input word (TWS M-
variable) should be copied into its image variable at the beginning of a sequence of operations. The
operations can then be done on the image variable without requiring Turbo PMAC to actually read or
write to the I/O port for each operation. The output word is first assembled into its image variable, then
copied to the actual output word once at the end of a sequence of operations. This procedure will allow
the most efficient and flexible use of TWS M-variables.
Note:
This type of variable can only be used in background tasks (on-line commands,
plus PLCs and PLCCs 1-31). They cannot be used in foreground tasks (motion
programs and PLC and PLCC 0).