Download DLC Single Axis Control Card for Firmware

Transcript
Programming 5-41
DLC-A and DLC-G
CST Change Subroutine Stack
E
1
0201 CST
4
1 -
Changes subroutine level (0-2)
0= changes subroutine level in Task 1 and Task 2.
1= changes subroutine level in Task 1 only.
2= changes subroutine level in Task 2 only.
4 -
Set subroutine stack to this level
0= sets stack to zero (See Note below.)
1-9= change subroutine stack level from one to nine levels
The starting block for Task 2 is set up in "Parameter B006 - Start Task 2 &
3". Task 1 programming does not need to be set up in parameters.
The CST command is used to change to different subroutine stack levels.
It is used in conjunction with JSR and RTS. Task 1 and Task 2 have a
maximum number of nine stack levels that can be changed in a single CST
command. The CST command can be used in subroutines to allow for
more functions when program space is limited.
After using a CST command to correct a stack, the next RTS command will
jump the program beyond undesirable subroutines to a selected level.
Note:
If the stack is set to zero, an RTS command cannot be used as this
becomes the programs main level. If an RTS command is used
after setting the stack to zero, the error "RTS Nesting" will occur.
Example:
The following example shows the program flow and the CST command
(Subroutine level 3, block, "E0309 CST 1 1", is used to change the
subroutine stack level to level 1, in Task 1).
Figure 5-1: Program Flow, CST Command
DOK-CONTRL-DLC*A+DLC*G-AW03-AE-P • 12/99