Bad command example – Yaskawa SMC–4000 User Manual

Page 330

Advertising
background image

320

SMC–4000 User Manual

Bad Command Example

The above program prompts the operator to enter a jog speed. If a number is entered out of range (greater
than 12 million), the #CMDERR routine will be executed prompting the operator to enter a new number.

#BEGIN

Begin main program

IN "ENTER SPEED", SPEED

Prompt for speed

JG SPEED;BGX;

Begin motion

JP #BEGIN

Repeat

EN

End main program

#CMDERR

Command error utility

JP#DONE,_TC<>6

Check if out of range

MG "SPEED TOO HIGH"

Send message

MG "TRY AGAIN"

Send message

ZS1

Adjust stack

JP #BEGIN

Return to main program

#DONE

End program if other error

ZS0

Zero stack

EN

End program

Advertising