Contatto
MCP 4 – User's manual
DUEMMEGI
Quite all notations belonging to the equation syntax of MCP 4 may be used in the scripts. For instance, the
following notations are allowed:
IF
AI1:2
> 230; THEN………
AO4
= 197
R54
.1 = 1
IF
I81.1
== 1; THEN………
O34.7
= 0
V781
= 1
IF
V542
== 0; THEN………
Refer to the examples in the following pages for more allowed notations.
Notes:
1. the writing operations on the outputs and on the registers will be executed as a sequential sequence, in
the same order as they appear in the script
2. the keywords can be written both in upper and lower case
3. more instruction (statements) on the same line must be separated by the symbol “;”
4. when writing scripts, use the tab in order to enhance the readability of the script itself (e.g. increase the
indent of the instructions in the blocks IF…ENDIF); see example for more details.
3.2- Keywords and syntax
3.2.1- Using the TRIGGER
The keywords SCRIPT and ENDSCRIPT “enclose” the script. The keyword SCRIPT must be followed by a
number in the range 1 to 127.
The keyword TRIGGER specifies the event triggering the execution of the script or every how many time it
must be executed.
The events triggering the scripts can be only real inputs (direct or complemented) or virtual points
(direct or complemented).
It is allowed, in the same MCP 4 program, to have a script triggered by the a real
or virtual point and another script triggered by the same but complemented point; in this way it is possible to
execute a script at the activation of a point and another script at the de-activation of the same point.
The following script (SCRIPT 1) will be executed every 1 second (TRIGGER=1):
SCRIPT
1
TRIGGER
= 1
…………………
ENDSCRIPT
The following script (SCRIPT 2) will be executed at every change OFF to ON of V1:
SCRIPT
2
TRIGGER
=
v1
…………………
ENDSCRIPT
The following script (SCRIPT 3) will be executed at every change ON to OFF of V1:
SCRIPT
3
TRIGGER
= !
v1
…………………
ENDSCRIPT
The following script (SCRIPT 4) will be executed at every change OFF to ON of I2.1:
SCRIPT
4
TRIGGER
=
I2.1
…………………
ENDSCRIPT
Page 32 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