beautypg.com

3 definitions, 2 program, 3 startup and termination – ElmoMC Multi-Axis Motion Controller-Maestro User Manual

Page 72: 1 program startup – the run function, 2 program termination, 1 exit operator

background image

5.2.1.3

5.2.3.1

5.2.3.2

Maestro

Software Manual

MAXL Program Language

MAN-MASSW (Ver. Q)

Definitions

A definition is a unique specification of a function or callback. Because definitions
must be unique, a program can contain only one definition for a given program
element.

5.2.2

Program

A program consists of one-translation unit. Execution, in concept, begins in the
translation unit that contains the function run.

MAXL programs consist of following parts:

• Global variables declarations

• Functions and callback definitions

o

global variable declaration for access inside of functions

o

local variables declaration

o

Program lines.

5.2.3

Startup and Termination

RUN is used to start a program startup. Programs are terminated at the end of a run
function or with the exit keyword.

Program Startup – the run Function

A special function called run is the entry point to all MAXL programs. The compiler
does not predefine this function; rather, it must be supplied in the program text. The
declaration syntax for run is:

Syntax

function run( )
//… Some code
end function

Program Termination

In MAXL, there are several ways to exit a program:

• Call the exit operator
• Finish program by finishing the run function
• Call the return operator from function run

5.2.3.2.1

exit Operator

exit operator immediately ends program flow.

5-10