Special labels, Meaning that a, Poserr – Yaskawa SMC–4000 User Manual

Page 366: Automatic error subroutine, E begins with the, Excessive position error special label, Subr

Advertising
background image

356

SMC–4000 User Manual

Special Labels

This program demonstrates five of the SPECIAL LABELS as part of an SMC–4000 application program.
#AUTO is usually the first line of a program. When this program is burned into the SMC–4000 using the
BP command, the program will begin executing when the power is turned ON or after the RS command is
given, or the RESET button on the front is pressed.

#POSERR-- This special label is used to handle a situation in which a servo is not able to remain in
position. The special label works with the ER command. When the value of the ER command is exceeded,
thread zero automatically jumps to the #POSERR label. In this program example, ERX=150 counts. If
there are low gains or if using a small motor, it is possible to cause more than 150 counts of error by hand,
causing the #POSERR label to execute. In the following example, the program displays a message and
waits for input #1 to go low (falling edge). The servo is then re-energized.

There are three ways to return from a special label like this. The example below uses RE1; i.e., to return
from the error routine to the line in thread zero that was being executed when the #POSERR occurred.
The “1” means to restore a trip point if one was in progress, such as WT, AI, AM, AT, etc.

The second method is to do an RE, meaning that any trip points that were in progress are cleared. If thread
zero was waiting for an AM command, it would continue as if the profiler had completed the path.

The third method is to use the ZS command, which clears the subroutine stack, and the LEGEND forgets
it is in the middle of an error routine. After the ZS is given, it is possible to do a JP anywhere in the
program. Typically, there would be a jump back to a main loop where manual jogging can take place.

Instruction

#AUTO

ERX=150; OEX=1, II3

SHX WT 500

#BUSY

JGX=@AN[1]*10000

BGX

MG “BUSY...”

WT500

JP#BUSY

EN

Instruction

#POSERR

SB1

MG “FOLLOWING ERROR IS HIGH!”

MG “TOGGLE INPUT #1 TO CONTINUE”

AI1; AI-1

CB1; SHX; WT 500

RE1

Advertising