50 cam registers – Rockwell Automation 57C422B 2 Axis Servo Module User Manual

Page 77

Advertising
background image

PROGRAMMING

4-49

15014 ! line 15010 ORs INT_ENA_X! with 80000000H
15020 ! to enable interrupts from bit 15 of register 72
15030 CMD66% = COMMAND%

\! loads value in COMMAND% into CMD66%

15032

! which is the first command

15034

! register on the X axis

15040 WAIT ON HW_EVENT
15042 ! after seeing the hardware event occur, test to see
15044 ! which interrupt occurred; if more than one interrupt
15046 ! is enabled, each must be chocked to see what caused
15048 ! the interrupt.
15049 !
15050 IF X_CMD_ACK@ THEN INT_SRC_X! = 0 \ INT_ENA_X! = 0 \ CMD66% = 0
15052 ! waiting on the hardware event here ensures that the
15054 ! Axis module responds with a command acknowledge
15056 ! before anything else is allowed to occur.
15060 !
15070 REG_64% = 0 \! reset interrupts (reg 64 for both X and Y)
15080 IF (INT_ENA_X! <> 0) THEN GOTO 15040
15082 ! line 15080 checks for an interrupt on the X axis
15090 RETURN

4.50 Cam Registers

The following sections describe how to implement the cam
profile registers. Two types of cam tables are available,
position-based, and time-based. The values in the cam table
are signed integers. These values represent either the
relative change in position for successive intervals of time in
the time-based cam, or the position of the axis with respect
to a master reference position in registers 126,127 if the
position-based cam is selected. Cam type is selected in
register 130, bit 8. The number of positions actually stored in
both the time-based cam and the position-based cam table is
defined in register 128.

Time Cam

The time-based cam table can be stored either as bytes or
words (16 bit registers). Byte values may range from -128 to
127 in encoder counts and are packed two per register. The
lower numbered byte is stored as the least significant 8 bits
of the register. There are a maximum of 3830 byte values in
the table. Note that if you use the byte format, you cannot
configure the values in the cam table in a configuration task
or in the Programming Executive variable configurator
application. You must use BASIC IOWRITE statements to
write the values to the cam table within your application
program.

Word values may range from -32768 to 32767 in encoder
counts. There are a maximum of 1915 word values in the
table. The values in the table represent the distance to move
in the selected amount of time.

Advertising