Galil DMC-3425 user manual Automatic Subroutines for Monitoring Conditions, Example - Limit Switch

Models: DMC-3425

1 210
Download 210 pages 53.34 Kb
Page 132
Image 132
Automatic Subroutines for Monitoring Conditions

Automatic Subroutines for Monitoring Conditions

Often it is desirable to monitor certain conditions continuously without tying up the host or DMC-3425 program sequences. The DMC-3425 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, predefined label in the applications program, and having an application program actively executing on the controller. The pre-defined labels are:

SUBROUTINE

DESCRIPTION

 

 

#LIMSWI

Limit switch on any axis goes low

 

 

#ININT

Input specified by II goes low

 

 

#POSERR

Position error exceeds limit specified by ER

 

 

#MCTIME

Motion Complete timeout occurred. Timeout period set by TW command

 

 

#CMDERR

Bad command given

#TCPERR

Ethernet Communication Error

 

 

 

 

The following examples illustrate the use of the automatic subroutines:

Example - Limit Switch:

This simple program prints a message upon the occurrence of a limit switch. For the #LIMSWI sub- routine to execute, the DMC-3425 must be executing an applications program from memory and the controller must be commanding the motor to move. The RE command is used to return from the #LIMSWI subroutine. The #LIMSWI subroutine will be re-executed if the limit switch remains active.

Instruction

Interpretation

#LOOP

Dummy Program

JP #LOOP;EN

Jump to Loop

#LIMSWI

Limit Switch Label

MG "LIMIT OCCURRED"

Print Message

RE

Return to main program

Example - Position Error

Instruction

Interpretation

:ED

 

Edit Mode

000

#LOOP

Dummy Program

001 JP #LOOP;EN

Loop

002

#POSERR

Position Error Routine

003

V1=_TEA

Read Position Error

004 MG "EXCESS POSITION ERROR"

Print Message

005 MG "ERROR=",V1=

Print Error

006

RE

Return from Error

<control> Q

Quit Edit Mode

:XQ #LOOP

Execute Dummy Program

:JG 100000

Jog at High Speed

:BGA

Begin Motion

124 • Chapter 7 Application Programming

DMC-3425

Page 132
Image 132
Galil DMC-3425 Automatic Subroutines for Monitoring Conditions, Example - Limit Switch, Example - Position Error