Automatic subroutines for monitoring conditions, Example - limit switch, Example - position error – Yaskawa SMC–4000 User Manual

Page 328

Advertising
background image

318

SMC–4000 User Manual

Automatic Subroutines for Monitoring Conditions

Often it is desirable to monitor certain conditions continuously without tying up the host or SMC–4000
program sequences. The SMC–4000 can monitor several important conditions in the background. These
conditions include checking for the occurrence of a limit switch, a defined input, position error, or a
command error. Automatic monitoring is enabled by inserting a special, pre-defined label in the
applications program. The pre-defined labels are:

For example, the #POSERR subroutine will automatically be executed when any axis exceeds its position
error limit. The commands in the #POSERR subroutine could decode which axis is in error and take the
appropriate action. In another example, the #ININT label could be used to designate an input interrupt
subroutine. When the specified input occurs, the program will be executed automatically.

*Note An application program must be running for automatic monitoring to function.

Example - Limit Switch:

This program prints a message upon the occurrence of a limit switch. Note, for the #LIMSWI routine to
function, the SMC–4000 must be executing an applications program from memory. This can be a very
simple program that does nothing but loop on a statement, such as #LOOP;JP #LOOP;EN. Motion
commands, such as JG 5000 can still be sent from the PC even while the "dummy" applications program is
being executed.

Now, when a forward limit switch occurs on the X axis, the #LIMSWI subroutine will be executed.

*Note The RE command is used to return from the #LIMSWI subroutine.

*Note The #LIMSWI will continue to be executed until the limit switch is cleared (goes high).

Example - Position Error

#CMDERR

Bad command given

#ININT

Input specified by II goes low

#LIMSWI

Limit switch on any axis goes low

#MCTIME

Timeout for In-position trippoint, MC

#POSERR

Position error exceeds limit specified by ER

#TCPERR

Ethernet error

#LOOP

Dummy Program

JP #LOOP;EN

Jump to Loop

#LIMSWI

Limit Switch Label

MG "LIMIT OCCURRED"

Print Message

RE

Return to main program

:XQ #LOOP

Execute Dummy Program

:JG 5000

Jog

:BGX

Begin Motion

#LOOP

Dummy Program

Advertising