User's Manual

Table Of Contents
16-Axis MACRO CPU User Manual
How to use the 16-Axis MACRO CPU 55
Setting up for a Single Pulse Output
If just a single compare pulse is wanted (not using the auto-increment feature), take the following steps:
1. Write the encoder value at the front edge into the Compare A register
2. Write the encoder value at the back edge into the Compare B register
3. Set the Auto-Increment register to zero
4. Set the initial state with the direct-write feature
Write a value to the initial state bit
Write a 1 to the direct-write enable bit (this is self-clearing to 0)
5. Start the move that will cause the compare function
Example: For axis 1 using node 0, with the axis sitting still at about encoder position 100, and a ‘1’ value of
position compare desired between encoder positions 1000 and 1010, the following code could be used:
MS0,MI925=1000 ; Set front end compare in A
MS0,MI926=1010 ; Set back end compare in B
MS0,MI923=0 ; No auto-increment
MS0,MI929=0 ; Prepare initial value of 0
MS0,MI928=1 ; Enable direct write (resets immediately to zero)
{Command to start the move}
Setting up for Multiple Pulse Outputs
By using the auto-increment feature, it is possible to create multiple compare pulses with a single software setup
operation. When the auto-increment register is a non-zero value, its value is added to or subtracted from one
compare register’s value automatically when the other compare value is matched. PMAC keeps track of the
direction of incrementing, so only positive values should be used in the auto-increment register, even if the
encoder will be counting in the negative direction.
The setup for multiple pulses is like the setup for a single pulse, except that a non-zero value must be entered
into the auto-increment register. In addition, the value entered for the back edge must be that of the first back
edge minus the auto-increment if the move will be positive or that of the first back edge plus the auto-increment
value if the move will be negative.
In other words, the starting values to the two compare registers must bracket the starting position. When either
compare value is matched by the encoder counter, the other compare value is incremented in the direction of
movement.
Starting Position
B
0
A
0
B
1
A
1
Auto-Increment
Example: Starting from the above example, desiring the compare output on between 1000 (A
0
) and 1010 (B
1
)
counts, but adding an auto-increment value of 2000 counts, with a starting position of about 100 counts, program
code to start the sequence could be:
MS0,MI925=2000 ; Auto-increment of 2000 encoder counts
MS0,MI926=1000 ; First front edge (A0) at 1000 counts
MS0,MI923=(1010-1000) ;[1010-MS0,MI926]First back edge (B1) at 1010 counts
MS0,MI929=0 ; Prepare initial value of 0
MS0,MI928=1 ; Enable direct write (resets immediately to zero)