48
4 Functional Description
4.6 Sequence programs
The CALL command
The CALL command enables subroutines to be called from different points, any number of times.
You can only jump back from a subroutine again with the RET command.
All commands are permitted within a subroutine except for a repeated CALL command.
General
If a sequence program is completely processed (no jump at the end of a program), then an “n” is
sent to the RS232, if ANSW1 or ANSW2 is set.
In order to generate an endless program (useful for standalone operation), a jump command is
required at the end of the program.
Memory size
The sequence programs are stored in binary coding in the Flash memory; 2 bytes are stored for each
command, and 0 to 4 bytes for the argument. The maximum memory size available for sequence
programs is 6656 bytes (3328 words).
Examples:
1.) Positioning routines called via RS232
The program enables the calling of different routines from the RS232 interface:
JMP2: Homing Sequence. First move to a limit switch and then to the Hall sensor zero point (Hall
index), in order to obtain the most precise reference point possible.
JMP3: Move to position 0 and stop there.
JMP4: Attempt to approach a position with low current limitation. As there may be an obstacle in
the way in the application, the target position may not be attained. The motor should be stopped
after 5 seconds, in any event. (Further evaluation occurs in the higher level control).
JMP5: 1000 cycles with following sequence: 10 revolutions forwards, 1 second pause, 5 revolutions
back again and then 0.5 seconds pause.
Configuration:
SOR0
… Digital velocity presetting via RS232
LR0
… Set current position as target position
M
… Switch to position control (Motion 0)
SHA1
… Homing Sequence with Notify at AnIn
SHN1
SHL1
HOSP200
… Homing speed 200 rpm
HP1
… Rising edge at limit switch effective
ENPROG
… Start motion program after power-on
ANSW0
… No asynchronous responses
EEPSAV
… Save configuration