Danfoss MCO 305 Design Manual page 158

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

Advertisement

MCO 305 Design Guide
Followed by the main program loop:
main:
...
GOTO main
Sub program areas are defined as follows:
SUBMAINPROG
SUBPROG name
...
RETURN
ENDPROG
Functions, Declarations, and Pragma directives
Function declarations and function definitions can be anywhere in the program code except the subprogram
section. Pragma directives, if present, must be directly after the DIM statement.
That means a program can look like:
Or it could also look like:
158
__ How to Program __
main:
IF (IN 3 == 1) THEN
// Go into synchronizing mode, if input 3 = 1
ELSE
GOTO main
SUBMAINPROG SUBPROG syncprog
SYNCP
RETURN
SUBPROG errhandle
RETURN
ENDPROG
DIM statement
pragmas
...
variable declarations
...
function declarations
...
program code
...
function definitions
...
SUBMAINPROG
subprogram definitions
...
ENDPROG
DIM statement
pragmas
...
SUBMAINPROG
subprogram definitions
...
ENDPROG
variable declarations
...
function declarations
...
program code
...
function definitions
...
®
MG.33.L5.02 – VLT
is a registered Danfoss trademark
GOSUB syncprog
// If input 3 not 1, run in speed mode
GOSUB speedprog
IF (sync_flag == 0) THEN
// synchronize, if not already synchronized
sync_flag = 1
ENDIF
WAITI 18 on
// waiting for digital input 18,
// clear the error
sync_flag = 0
ERRCLR

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents