Danfoss MCO 305 Design Manual page 160

Programmable motion controller
Hide thumbs Also See for MCO 305:
Table of Contents

Advertisement

MCO 305 Design Guide
Command Structure
All instructions consist of: COMMAND WORD + possible Parameter. A variable can also be used as
parameter instead of an absolute number.
Example
POSA 10000
or
pos = 10000
POSA pos
Input Values
As in other programming languages the values inputted are not tested. Thus, it is the programmer's
responsibility to ensure that extreme values do not lead to problems. When searching for such potential
problems use the debug mode.
Error Handling
Possible errors like timeout, position error, or an emergency stop must be considered and error handling
subroutines must be programmed for that. Otherwise the program would be aborted without any possibility
to clear the error.
The program sample evaluates an error status by the error number and defines a subroutine (error
handler), called if an error occurs.
ON ERROR GOSUB errhandle
PRINT "Please create a temporary error status"
PRINT " by pushing a limit switch."
endless:
GOTO endless
/******* SUBROUTINE-AREA **********/
SUBMAINPROG
SUBPROG errhandle
PRINT "Current error number: ",ERRNO
IF (ERRNO == 25) THEN
PRINT "HW end limit activated"
ELSE
PRINT "It's o.k., although it wasn't a limit switch"
ENDIF
PRINT "You can re-set the cause of the error";
PRINT "within the next 10 seconds"
DELAY 10000
PRINT "Re-set error status ..."
ERRCLR
PRINT "... and program terminated."
EXIT
/* program termination */
RETURN
ENDPROG
160
__ How to Program __
/* Endless loop */
// Evaluate error number and re-set error status
/* limit switch or control stop */
/* Wait 10 seconds */
/* Re-set error status */
®
MG.33.L5.02 – VLT
is a registered Danfoss trademark

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents