Contatto
MCP 4 – User's manual
DUEMMEGI
The following rules have to be observed:
Spaces and TAB characters have no significance. They will be ignored by the compiler but
the use of
some space characters between the terms of an equation or other are strongly recommended for
a best readability of the program
An equation (but not a line in a SCRIPT) can be broken on several lines using the symbol
\
(backslash) at
the line end to specify that the equation will continue on the next line
The equation finishes at the end of the line (if the \ symbol is not specified)
The
//
symbol (two slashes) declares that the following words, until the line end, are comments, and so
they will be ignored by the compiler.
The comments are very useful for best readability and
documentation of the program file
. The use of the comment is strongly recommended to describe each
equation in the program
Both upper case and lower case characters can be used during the equation writing
Instead of the input and output symbols (
Ij.k, Ox.y, Vn, Aj
), it is possible to employ some variable
names defined by the programmer through the
define
directive as here below described:
define
Pump1
O1.1
// Output definition
define
Command
I1.1
// Input definition
Pump1 = Command
// Equation
The previous equation is fully equivalent to:
O1.1
=
I1.1
but it can be easily interpreted. The variable names defined through the
define
directive cannot contain
spacing characters. In addition, the compiler will ignore upper or lower case.
The following example shows a possible and simple program using the
define
:
////////////////////////
// Definitions /////////
////////////////////////
define
StairLight
O1.1
define
Floor1Button
I1.1
define
Floor2Button
I1.2
define
Floor3Button
I1.3
// Define a virtual point as OR of each button (parallel connection)
V1
= Floor1Button | Floor2Button | Floor3Button
// Light Output
StairLight =
TIMER
(
V1
, 0, 450)
In the above example there are 3 buttons, one per each floor of a building; the pressing of a button switches
on the stair light. This light will remain on during 45 seconds after the button release, then it will be
automatically switched off thanks to the TIMER function. The same program may be written without using the
definition of variable names as follows:
// Command by the buttons
V1
=
I1.1
|
I1.2
|
I1.3
// Light output
O1.1
=
TIMER
(
V1
, 0, 450)
Note that using the
define
directive, the program has a best and mnemonic readability.
About the using of the
define
directive in the SCRIPT, refer to the related chapter.
Page 46 of 87
Rel.: 1.2 October 2018
DUEMMEGI
s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/55213686 –
www.duemmegi.it