9 automatic subroutines, 1 list of automatic routines, Automatic subroutines -30 – ElmoMC SimplIQ Software Manual User Manual

Page 59

Advertising
background image

SimplIQ

Software Manual

4BThe

SimplIQ

User Programming Language

MAN-SIMSW (Ver. 1.4)

5-30

5.8.9

Automatic Subroutines

5.8.9.1 List of Automatic Routines

An automatic routine (auto-routine) is a special type of routine that is executed
automatically according to system events. These routines are executed only when their
invocation condition is satisfied. Auto-routines have no output and input arguments.

Syntax:
An auto-routine can defined either as a function or as a subroutine:
ƒ

If defined as a function, all syntax rules for function definition are relevant (see

section

5.7.1

).

ƒ

If defined as a subroutine, the auto-routine name follows the sequence of characters ## or
#@ in the definition line. The body of the auto-routine follows the definition line and
ends with the return keyword unless this return is inside a flow control block (see

section

5.7.1

).

After calling the auto-routine and performing its body, the return keyword

instructs the program to return to the line in the code after which execution was
halted by a interrupt event.

There are no default handlers for auto-routines. If a user does not define the auto-routine, no
handling will be activated when an automatic event is asserted.

The following table summarizes all automatic routines, ordered from highest to lowest
priority.

Routine Name Priority Activated by

Mask (MI)

AUTOEXEC

0

An autoexec code is executed automatically
upon power on. An autoexec function can be
called subsequently at any time.

1 (0x1)

AUTO_PERR

1

Called when a run-time error occurs (see

section

5.6.1

).

32,768
(0x8000)

AUTO_ER

2

A motor fault event, in which MO=0 is set
automatically.

2 (0x2)

AUTO_STOP

3

Called when a digital input configured to the
“Hard Stop” function is activated.*

4 (0x4)

AUTO_BG

4

Called when a digital input configured to the
“Begin” function is activated.*

8 (0x8)

AUTO_RLS

5

Called when a digital input configured to the
“RSL” function is activated.*

16 (0x10)

AUTO_FLS

6

Called when a digital input configured to the
“FLS” function is activated.*

32 (0x20)

AUTO_ENA

7

Called when a digital input configured to the
“Enable” function is activated.*

64 (0x40)

AUTO_I1

8

Called when a digital input #1 configured to
the “GPI” (General Purpose Input) function is
activated.*

128 (0x80)

Advertising