Duemmegi Contatto MCP 4 User manual

DUEMMEGI Contatto
Contatto
Contatto
MCP 4
MCP 4
Programmable Control Module
User's Manual
Release 1.2 – October 2018
Via Longhena 4 - 20139 MILANO
Tel. 02/57300377 - FAX 02/552136 6
www.duemmegi.it

Contatto MCP 4 – User's manual DUEMMEGI
INDEX
A1- LIST OF REVISIONS OF THIS MANUAL..............................................................................................................4
A2- RECOMMENDATIONS..........................................................................................................................................4
A3- NEWS OF MCP 4 AGAINST MCP XT AND AVAILABLE VERSIONS..................................................................5
1- MAIN FEATURES.....................................................................................................................................................6
1.1- Required Hardware and Software tools...........................................................................................................6
1.2- Main features of MCP 4....................................................................................................................................6
1.3- Terminology and syntax...................................................................................................................................7
2- EQUATIONS: TYPES AND SYNTAX.......................................................................................................................
2.1- Equations for the system configuration............................................................................................................
2.1.1- Configuration of the modules.............................................................................................................
2.1.2- Power ON status................................................................................................................................
2.1.3- Status of fault input modules..............................................................................................................
2.1.4- Communication Protocol....................................................................................................................9
2.1.5- Address of MCP 4............................................................................................................................11
2.1.6- Identifier of MCP 4............................................................................................................................11
2.1.7- Directive for the calculation of sunrise, sunset and sun position.....................................................11
2.1. - Publishing on the bus the status of virtual points and value of registers........................................12
2.1.9- Management of fault modules..........................................................................................................12
2.1.10- Alignment of the outputs.................................................................................................................12
2.1.11- Data exchange between MCP 4 controllers...................................................................................13
2.1.12- Number of nodes in a MCP 4 network...........................................................................................15
2.1.13- Scheduler........................................................................................................................................16
2.2- Event triggered Equations..............................................................................................................................17
2.2.1- Logic equations................................................................................................................................17
2.2.2- SET – RESET equations..................................................................................................................17
2.2.3- TOGGLE equations..........................................................................................................................1
2.2.4- COUNTER Equations.......................................................................................................................1
2.2.5- THRESHOLD Equations..................................................................................................................20
2.2.6- TIMER Equations.............................................................................................................................20
2.2.7- Equations for mathematical and logic calculation............................................................................21
2.2. - Equations for binary code generation..............................................................................................22
2.2.9- Equations for recording status changes (EVENT)...........................................................................23
2.2.10- Equations for recording value changes (LOG)...............................................................................24
2.2.11- Management of the external counter modules (ModCNT).............................................................25
2.2.12- Management of DALI module (ModDALI)......................................................................................25
2.3- Time triggered Equations...............................................................................................................................27
2.3.1- Scheduler Equations........................................................................................................................27
2.4- Macro..............................................................................................................................................................29
3- SCRIPT...................................................................................................................................................................31
3.1- Summary.........................................................................................................................................................31
3.2- Keywords and syntax.....................................................................................................................................32
3.2.1- Using the TRIGGER.........................................................................................................................32
3.2.2- VAR, GLOBAL VAR and EXTERN VAR..........................................................................................33
3.2.3- Logic and Mathematical operations.................................................................................................33
3.2.4- IF…THEN…ELSE…ENDIF..............................................................................................................34
3.2.5- CARRY and ZERO...........................................................................................................................35
3.2.6- DEFINE.............................................................................................................................................35
3.2.7- GOTO...............................................................................................................................................37
3.2. - SUBROUTINES and FUNCTIONS..................................................................................................37
3.2.9- BIT(x)................................................................................................................................................40
3.2.10- WORD(x) and pointers...................................................................................................................42
Page 2 of 7 Rel.: 1.2 October 201 DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it

DUEMMEGI MCP 4 – User's manual Contatto
3.2.11- @RAM k and @WORD k...............................................................................................................43
3.2.12- SWAP(x).........................................................................................................................................43
3.2.13- RANDOM(0)...................................................................................................................................43
3.2.14- BMASK(x).......................................................................................................................................44
4- PROGRAM WRITING.............................................................................................................................................45
4.1- Rule for program writing.................................................................................................................................45
4.2- Compiling the program...................................................................................................................................47
4.3- Uploading the program to MCP 4 memory.....................................................................................................47
5- SETTING UP...........................................................................................................................................................4
5.1- Connections....................................................................................................................................................4
5.2- Baud Rate selection.......................................................................................................................................49
5.3- TCP/IP parameters settings (Ethernet)..........................................................................................................50
5.4- RS232 and RS4 5 serial ports of MCP 4......................................................................................................51
5.5- WEBS communication port............................................................................................................................51
6- DIAGNOSTICS.......................................................................................................................................................52
6.1- Diagnostics of CONTATTO system through MCP 4......................................................................................52
7- TECHNICAL CHARACTERISTICS........................................................................................................................53
- OUTLINE DIMENSIONS.........................................................................................................................................53
9- FXP-XT COMMUNICATION PROTOCOL..............................................................................................................54
9.1- Messages format ad meaning........................................................................................................................54
9.2- RAM memory mapping...................................................................................................................................56
9.2.1- Main RAM memory mapping............................................................................................................56
9.2.2- RAM mapping of the Scheduler.......................................................................................................5
10- MCP IDE: INTEGRATED DEVELOPMENT ENVIRONMENT FOR APPLICATIONS USING MCP 4................60
10.1- Description of the software package............................................................................................................60
10.2- MCP IDE.......................................................................................................................................................60
10.2.1- MCP IDE.........................................................................................................................................64
10.2.2- Program transferring.......................................................................................................................64
10.3- MCP VISIO...................................................................................................................................................65
10.3.1- The Groups of MCP VISIO.............................................................................................................66
10.3.2- The Projects of MCP VISIO............................................................................................................69
10.3.3- The Simulator of MCP VISIO.........................................................................................................69
11- MODBUS COMMUNICATION PROTOCOL.........................................................................................................70
11.1- Abstract.........................................................................................................................................................70
11.2- Supported MODBUS functions....................................................................................................................70
11.3- Example of MODBUS functions...................................................................................................................70
11.3.1- Function 1: Reading the digital output status.................................................................................71
11.3.2- Function 2: Reading the digital input status...................................................................................72
11.3.3- Function 3: Reading the registers (RAM memory).........................................................................73
11.3.4- Function 4: Reading analog inputs.................................................................................................75
11.3.5- Function 5: Command of a single output digital point....................................................................75
11.3.6- Function 6: Writing a single register (RAM memory).....................................................................75
11.3.7- Function 16: Writing multiple registers (RAM memory).................................................................75
11.4- Tables for relationship Words-Parameters of MCP 4..................................................................................7
11.4.1- Physical inputs................................................................................................................................79
11.4.2- Physical outputs............................................................................................................................. 0
11.4.3- Virtual points................................................................................................................................... 1
11.4.4- Registers......................................................................................................................................... 3
11.4.5- Counters......................................................................................................................................... 5
DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it
Rel.: 1.2 October 201 Page 3 of 7

Contatto MCP 4 – User's manual DUEMMEGI
A1- LIST OF REVISIONS OF T IS MANUAL
Rel. 1.0 First emission (MCP 4)
Rel. 1.1 Par. 2.1.4 MODBUS directives better explained
Par. 5.3 TCP/IP parameter settings better explained
Rel. 1.2 Par. 1.2 Added special virtual points V2020 to V2027 (communication lost on ETH port)
Par. 2.1.4 Added information about the management of supported MODBUS MASTER functions
Par. 11.2 Added function 4 to functions supported by MCP 4 in MODBUS MASTER mode (in addition to 3 and 16)
A2- RECOMMENDATIONS
WARNING: this manual applies to MCP 4 with the following firmwares:
Main microcontroller: 2.3 or higher
Secondary microcontroller: 1.1 or higher
The features described in this manual require the program MCP IDE release 3.2.9 or higher.
This manual assumes that the user have an adequate knowledge about the Contatto bus system.
Correct disposal of this product
(Waste Electrical & Electronic Equipment)
(Applicable in the European Union and other European countries with separate collection systems). This marking on the product,
accessories or literature indicates that the product should not be disposed of with other household waste at the end of their working life. To
prevent possible harm to the environment or human health from uncontrolled waste disposal, please separate these items from other types
of waste and recycle them responsibly to promote the sustainable reuse of material resources. Household users should contact either the
retailer where they purchased this product, or their local government office, for details of where and how they can take these items for
environmentally safe recycling. This product and its electronic accessories should not be mixed with other commercial wastes for disposal.
Specifically about the battery, check local regulations for correct disposal. Never use municipal waste.
Installation and use restrictions
Standards and regulations
The design and the setting up of electrical systems must be performed according to the relevant standards, guidelines, specifications and regulations of the
relevant country. The installation, configuration and programming of the devices must be carried out by trained personnel. The installation and the wiring of
the bus line and the related devices must be performed according to the recommendations of the manufacturers (reported on the specific data sheet of the
product) and according to the applicable standards. All the relevant safety regulations, e.g. accident prevention regulations, law on technical work equipment,
must also be observed.
Safet instructions
Protect the unit against moisture, dirt and any kind of damage during transport, storage and operation. Do not operate the unit outside the specified technical
data. Never open the housing. If not otherwise specified, install in closed housing (e.g. distribution cabinet). Earth the unit at the terminals provided, if
existing, for this purpose. Do not obstruct cooling of the units. Keep out of the reach of children.
Setting up
The physical address assignment and the setting of parameters (if any) must be performed by the specific softwares provided together the device or by the
specific programmer. For the first installation of the device proceed according to the following guidelines:
Check that any voltage supplying the plant has been removed
Assign the address to module (if any)
Install and wire the device according to the schematic diagrams on the specific data sheet of the product
Only then switch on the 230Vac supplying the bus power supply and the other related circuits
Applied standards
This device complies with the essential requirements of the following directives:
2004/10 /CE (EMC)
2006/95/CE (Low Voltage)
2002/95/CE (RoHS)
EN 55022 Class B
Note
Technical characteristics and this data sheet are subject to change without notice.
Page 4 of 7 Rel.: 1.2 October 201 DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it

DUEMMEGI MCP 4 – User's manual Contatto
A3- NEWS OF MCP 4 AGAINST MCP XT AND AVAILABLE VERSIONS
Hardware:
•Fastest processors and memories
•Added one RS4 5 communication port (COM4)
•Added Ethernet connection
•Removed alarm relay
Functions:
•Integrated weekly Scheduler for management of 16 points ("zones") with time slots each one; each
time slot can be individually enabled or disabled
•A new program transferred to MCP 4 is stored in a different memory location and therefore, during
the download, the program previously loaded continues to operate without interruption; only when
downloading of the new program is completed, and if everything goes well, the automatic switch from
the old program to the new one will be performed.
•MODBUS TCP/IP Slave on ETH port
•Integrated Ethernet Bridge, multi-user up to simultaneous connections
•Integrated WEB Server, multi-user up to simultaneous connections, including sceneries
management
•Simple Diagnostic through a WEB browser, therefore without need to install MCP IDE program
The available versions are the following:
•MCP 4/STD: 1 RS232 + 2 RS4 5
•MCP 4/ET : 1 RS232 + 2 RS4 5 + ETH
DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it
Rel.: 1.2 October 201 Page 5 of 7

Contatto MCP 4 – User's manual DUEMMEGI
1- MAIN FEATURES
1.1- Required ardware and Software tools
To use MCP 4, the software tools MCP IDE is required, running on a PC (WXP, W7, W ). Minimum
hardware required: 1000 MHz processor and 512 Mbytes minimum RAM.
MCP IDE software tools also provides MCP Visio program, allowing to display in a graphical way the status of
the field and all parameters of MCP 4, and other programs allowing specific function.
1.2- Main features of MCP 4
2032 virtual digital points
1024 16-bit registers
1024 16-bit counters
512 16-bit timers
127 real input addresses up to 4-channel 16-bit each one
127 real output addresses up to 4-channel 16-bit each one
Special virtual points:
V2032: when set to 1, MCP 4 suspends the equations calculation and the execution of the scripts;
when reset to 0, the activity of MCP 4 restarts normally. The point V2032 will be however
automatically reset to 0 after a timeout
V2020 ÷ V2027: it becomes active in case of communication failure for more than 10 seconds on
the relative socket 1 ÷ of the ETH port
V2019: the activation of this point causes the reset and the re-initialization of Ethernet interface
V2018: activated when a communication loss on COM4 (RS4 5) occurs for more than 5 seconds
V2017: activated when one or more MODBUS slaves do not answer to MCP 4 (set in MODBUS
master mode) for more than 50 retries; it will be deactivated after a full polling cycle to slave
devices without errors
V2016: activated when the communication with WEBS fails
V2015: reserved, new data are present in the NOTIFY buffer
V2014: activated during times from sunrise to sunset
V2013: reserved
V2012: activated when a communication loss on COM2 (RS4 5) occurs for more than 5 seconds
V2011: activated when a communication loss on COM1 (RS232) occurs for more than 5 seconds
V2010: activated 0.5 seconds after the end of initialization procedure
V2009: the buffer of analog event (LOG or LOGC) is full or old events have been overwritten
V2008: the buffer of binary event (EVENT or EVENTC) is full or old events have been overwritten
V2007: reserved
V2006: reserved
V2005: error during the execution of a script (e.g. not valid instruction)
V2004: timeout during the execution of a script (>500msec)
V2003: 1sec period clock (toggle its status every 0.5 seconds)
V2002: bus failure
V2001: module failure
Page 6 of 7 Rel.: 1.2 October 201 DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it

DUEMMEGI MCP 4 – User's manual Contatto
1.3- Terminology and syntax
In this manual, some symbols and notations will be used; the meaning of these is here bottom explained.
General:
DI real or virtual digital input
DO real or virtual digital output
AI analog input or generic register
AO analog output or generic register
Ri generic register
Addresses, channels, points:
O3.1 point 1 of output 3 (channel 1)
O3:1.1 exactly as the previous one
O3:1.2 point 2 of channel 1 of output module 3
AO15:1 channel 1 of output module 15
AI20:2 channel 2 of input module 20
R12 register R12
R14.5 bit 5 of register R14 (for script only)
V100 virtual point 100
V17..V32 all virtual point from V17 to V32
O3:1.1..O4:2.16 all output points from O3:1.1 to O4:2.16
Numbers:
32 decimal number
0b0001010011111011 16-bit binary number
0b11110010 -bit binary number
0x14FB 16-bit hexadecimal number
Note: the channel of an input or output module, if not specified, will be assumed 1.
DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it
Rel.: 1.2 October 201 Page 7 of 7

Contatto MCP 4 – User's manual DUEMMEGI
2- EQUATIONS: TYPES AND SYNTAX
2.1- Equations for the system configuration
2.1.1- Configuration of the modules
Specify the module installed in the system (see MCP IDE Keyword List).
MOD8I/A = (I1)
MOD8I/A = (I2), (I3)
MOD8R = (O11)
MOD4-4R = (I4, O12)
MOD2DM = (I13, I14, O13, O14)
MOD2DM = (I15, I16, O15, O16)
2.1.2- Power ON status
Specify the status or value assigned to outputs or registers at power up or at reset.
POWERON = ( O3.1 = 1, \
O3:1.2 = 1, \
AO15:1 = 1000, \
AO16..AO17 = 247, \
R12 = -, \
32 = 1245, \
33.. 35 = -, \
V100 = 1, \
V1..V16 = 1, \
V17..V32 = - )
R12=- means that R12 maintains the value before the power down (RAM has a battery for back-up)
AO16..AO17 = 247 means that outputs AO16 channel 1, channel 2, channel 3, channel 4 and AO17
channel 1 will be set to the value 247 at the power ON. To specify all channels of module 16 and all channels
of module 17, the correct equation is: AO16:1..AO17:4 = 247.
2.1.3- Status of fault input modules
The status assumed by MCP 4 for a failed input module; if not specified, MCP 4 assumes the last available
value.
FAIL = ( I1.1 = 1, \
I1:3.2 = 0, \
I5:2.1..I5:2.15 = 1, \
AI15:2 = 2000, \
AI12:1 = 0x1234 )
Page of 7 Rel.: 1.2 October 201 DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it

DUEMMEGI MCP 4 – User's manual Contatto
2.1.4- Communication Protocol
Set the communication protocols to be used for each port of MCP 4. COM1 is the communication port on the
front panel (RS232), COM2 and COM4 are on the terminal block (RS4 5), COM3 is the special port under
the terminal cover on bottom left side (e.g. for WEBS module connected by a flat cable) and LAN1 is the
Ethernet port (MCP4/ETH only); on the ETH port, both MODBUS TCP/IP and RTU will be activated
(automatic detection). The directives are the followings (FXPXT can be omitted because however activated):
OM1 = (FXPXT, MODBUS) // RS232
OM2 = (FXPXT, MODBUS) // RS485
OM3 = (FXPXT, MODBUS) // Dedicated port (WEBS)
OM4 = (FXPXT, MODBUS) // RS485
LAN1 = (FXPXT, MODBUS) // ETH port
The available options for all 4 COM ports (COM3 through WEBS module) are the following:
FXPT proprietary protocol, always active even if not specified
MODBUS MODBUS RTU protocol: full correspondence between the number of the Word specified in
the Master MODBUS driver and the number of the Words listed in the RAM map in this own
manual. This is the preferred option.
MODBUS- MODBUS RTU protocol: the number of the Word specified in the Master MODBUS driver
must be increased by 1 in respect to what listed in the RAM map in this own manual. For
compatibility only when replacing a MCP Plus with a MCP 4 in old installations.
MODBUS MASTER
MCP 4, by the just described directive, behaves as a SLAVE device in a MODBUS network. Alternatively, the
MODBUS MASTER mode can be activated for MCP 4, exclusively on COM4, using the following directive:
MODBUS a (T, Vm) = ( Wx, n, Ry, \
........... )
where:
a is the address (in the range 1 to 31) of the MODBUS SLAVE node to communicate with
Tis the communication timeout in milliseconds; if omitted, the default is 1000 (1 second)
Vm is the virtual point that is activated if the slave “a” does not answer to MCP 4; this parameter
is optional and can be omitted. The cumulative point V2017 is always available, see paragraph 1.2
x is the number of the first MODBUS Word to be read/written
nis the number of Words to be read/written
yis the starting number of MCP register where the Words have to be stored
The same directive allows the writing of the specified Words when the value of the related register is modified
(by program, script, supervisor, etc.). If more blocks of non consecutive Words have to be read/written on the
same MODBUS peripheral device, more lines can be added as follows:
MODBUS a (T, Vm) = ( Wx, n, Ry, \
Wj, m, Rk, \
........... )
Note: if MODBUS MASTER has been activated all SLAVE protocols (FXPXT included) on COM4 will be deactivated.
To communicate with more MODBUS peripheral devices, add a directive for each SLAVE address as in the
following example; the timeout MUST be the same for all nodes.
MODBUS 1 (500) = ( W0, 10, R101, \
W100, 10, R111 )
MODBUS 2 (500) = ( W0, 10, R121, \
W100, 10, R131 )
MODBUS 3 (500) = ( W0, 10, R141, \
W100, 10, R151 )
MODBUS 4 (500) = ( W0, 10, R161, \
W100, 10, R171 )
DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it
Rel.: 1.2 October 201 Page 9 of 7

Contatto MCP 4 – User's manual DUEMMEGI
Regarding the functions used by MCP4 in MODBUS MASTER mode, the following rules apply:
➢If the specified WORD number is in the range 00000 to 30000, MCP4 performs reading via function 3
(Read Holding Registers) and writing via function 16 (Write Multiple Registers). The words read/written
are those mapped from WORD 00000 to 30000 in the slave
➢If the specified WORD number is in the range 30001 to 39999, MCP4 performs reading via function 4
(Read Input Registers) and no writing (being “Input” registers, thus read only). The words read are those
mapped from WORD 0000 to 999 in the slave
➢If the specified WORD number is in the range 40001 to 49999, MCP4 performs reading via function 3
(Read Holding Registers) and writing via function 16 (Write Multiple Registers). The words read/written
are those mapped from WORD 0000 to 999 in the slave
➢If the specified WORD number is in the range 50001 to 65535, MCP4 performs reading via function 3
(Read Holding Registers) and writing via function 16 (Write Multiple Registers). The words read/written
are those mapped from WORD 9999 to 25534 in the slave
The following table resumes what just listed:
Word in the directive
MCP 4 Word in the slave Used MODBUS
function
00000 ÷ 30000 00000 ÷ 30000 3 [R] and 16 [W]
30001 ÷ 39999 0000 ÷ 999 4 [R]
40001 ÷ 49999 0000 ÷ 999 3 [R] and 16 [W]
50000 ÷ 65535 9999 ÷ 25534 3 [R] and 16 [W]
Notes:
•The numbers shown in the previous table are all in decimal format.
•The first case (Word 00000 ÷ 30000) may seem redundant because it is already included in the last two and in fact it is but
allows the back compatibility with FW versions of MCP 4 less than 1.7.
Page 10 of 7 Rel.: 1.2 October 201 DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it

DUEMMEGI MCP 4 – User's manual Contatto
2.1.5- Address of MCP 4
Assign an address to MCP 4; allowed values: 1 to 255. It is mandatory when using MODBUS protocol.
ADDRESS = (12)
2.1.6- Identifier of MCP 4
Assign an identification string to MCP 4 (max 63 characters).
ID = (Building 1 controller)
2.1.7- Directive for the calculation of sunrise, sunset and sun position
MCP 4 can calculate every day the times of sunrise and sunset and the sun position (azimuth and elevation);
the calculated values will be loaded into 4 registers that must be defined through the LO ALIZE directive
here described. For these calculations, the data related to the position has to be provided to MCP 4
(Longitude and Latitude) together to the related time zone (e.g. for Italy this value is 1).
In addition, MCP 4 handles the virtual point V2014, activating it when the current time is inside the range
from sunrise to sunset, corrected, if needed, by an amount of minutes that can be declared in the SUNRISE
and SUNSET parameters.
LO ALIZE = ( \
LONGITUDE = 8.8638, \
LATITUDE = 45.3036, \
TIMEZONE = 1, \
SUNRISE = ( 0, R1 ), \
SUNSET = (0, R2 ), \
AZIMUTH = R3 , \
ELEVATION = R4, \
)
where:
LONGITUDE allowed values in the range -1 0.0000 to +1 0.0000
LATITUDE allowed values in the range -90.0000 to +90.0000
TIMEZONE in respect to Greenwich: allowed values in the range -12 to +12
SUNRISE minutes to be added or subtracted to the sunrise time (in the range -127 to +127) and the
(optional) register reporting the calculated sunrise time
SUNSET minutes to be added or subtracted to the sunset time (in the range -127 to +127) and the
(optional) register reporting the calculated sunset time
AZIMUTH (optional) register reporting the azimuth of the sun; value in the range 0 to 360 reporting the
angular position of the sun in respect to North, measured clockwise in degrees. For instance,
azimuth=90 means that the sun is located to East
ELEVATION (optional) register reporting the elevation of the sun; 2's complement value, the register
will contain a value 65446 to 65535 for negative values and 0 to 90 for positive values,
corresponding to a value in the range -90 to +90 reporting the position of the sun in respect to
the horizon, measured in degrees. A positive value means that the sun is above the horizon,
a negative value means that it is under the horizon. Elevation=0 means that the sun is exactly
at the horizon line
The times related to sunrise and sunset will be reported by the specified registers as value corresponding to
the number of minutes of the day starting from 0:00 (e.g.: 1439 = 23:59).
Note: the 4 registers can be optionally declared; this means that, if the calculation of sunrise, sunset and sun
position is not required, these ones can be omitted; in this case the virtual point V2014 will be however
handled.
DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it
Rel.: 1.2 October 201 Page 11 of 7

Contatto MCP 4 – User's manual DUEMMEGI
2.1.8- Publishing on the bus the status of virtual points and value of
registers
MCP 4 can be set to send (“publish”) on the bus the status of some virtual points and the value of some
registers. TO enable the function for the publishing of virtual point and registers, the following instructions has
to be added to the MCP 4 configuration:
SHARE = ( Vx .. Vy )
SHARE = ( Ri .. Rj )
Vx and Vy specify respectively a starting and an ending virtual point; for any entered value as Vx and Vy,
these one will be however forced to values multiple of 16 by the compiler of MCP IDE, therefore, specifying
for example V3..V9, the compiler will force to V1..V16.
Ri and Rj specify respectively a starting and an ending register; these two value can be freely assigned.
Up to 32 SHARE instruction can be added to the same MCP 4 program; each S ARE instruction must
contain no more than 128 virtual points or 8 registers.
The SHARE instruction is useful, for instance, when a ModGSM3 module has been installed in the system
and it must manage the information related to the virtual points and registers of MCP 4.
Example. The following instructions will enable the publishing on the bus of virtual points 1025 to 12 0 and of
the first 32 registers of MCP 4:
SHARE = ( V1025 .. V1152 )
SHARE = ( V1153 .. V1280 )
SHARE = ( R0.. R7 )
SHARE = ( R8.. R15)
SHARE = ( R16.. R23)
SHARE = ( R24.. R31)
2.1.9- Management of fault modules
Assign a virtual point to the failure condition of one or more modules.
MODFAIL(V10) = (I1, I2, O1, O2, O41)
MODFAIL(V11) = (I44)
2.1.10- Alignment of the outputs
MCP 4 cyclically executes, in addition its many activities, a status request to the output modules (both digital
and analog ones); if MCP 4 detects a mismatch between the status or the value read from the field and the
related value stored in the RAM memory of the controller, then it must execute an alignment between the field
and the RAM. Two alignment directions are available:
the status or the value in the RAM will be transferred to the field output
the status or the value of the field output will be transferred to the RAM memory
As default, MCP 4 executes the first alignment type (from RAM to field); in some cases (depending on the
module type and on the specific application) it is instead preferred, if not mandatory, the second alignment
type (from field to the RAM). To specify which outputs must be managed according to this alignment type, the
equation FIELDtoRAM must be used. This equation can include single output points, whole values or point
intervals as in the following example.
Page 12 of 7 Rel.: 1.2 October 201 DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it

DUEMMEGI MCP 4 – User's manual Contatto
FIELDtoRAM = ( O20.3, \
O20.4, \
AO1, AO2:3, \
O21:1.1..O21:1.8)
The alignment from field to RAM, however, is not allowed for all types of modules; when allowed, the related
technical sheet of the module will specify this, together to some suggestion on the best setting. Remember
that, unless otherwise specified in the FIELDtoRAM equation, the alignment will be always executed from
RAM to field.
2.1.11- Data exchange between MCP 4 controllers
If more MCP 4 controllers have been installed in a plant, it is possible to activate feature allowing to exchange
of data among them. To do this, simply connect each MCP to the other, in order to create a RS4 5 network
(exclusively using COM2 port), and instruct each MCP 4 belonging to this network to “publish” the data well
specified by proper directives; therefore, non more components are needed in addition to the RS4 5 cable
connecting the installed MCP 4 controllers.
Moreover, the data exchange mechanism here described also applies between Contatto MCP 4 controllers
and Domino DFCP controller, allowing interactions between the two systems.
The information that can be published on the network are the virtual points and the registers and therefore,
since any digital or analog variable can be supported by these ones, almost any information regarding each
MCP 4 or the modules connected to it can be transferred.
Each MCP 4 can publish a maximum of 125 Words; since each register takes 1 Word and a Word can
contains 16 contiguous virtual points, as an example the following combinations are allowed:
2000 virtual points - 0 registers
1000 virtual points - 62 registers
512 virtual points - 93 registers
0 virtual points - 125 registers
In other words, the number of virtual points divided by 16, added to the number of register, must be less or
equal to 125:
(nr.V) / 16 + nr.R <=125
As said before, the data exchange feature among more MCP 4 controllers must be activated, during
programming step, by one or more configuration directives specifying how many virtual points and/or
registers have to be published. These configuration directives are as follows:
NETWORK = (Vstart .. Vstop)
NETWORK = (Rstart .. Rstop)
Vstart and Vstop means respectively an initial and a final virtual point; any value chosen as Vstart and Vstop
will be however forced as multiple of 16 by the compiler of MCP IDE; for instance, choosing V3..V9, the
compiler will force V1..V16.
Rstart and Rstop means respectively an initial and a final register; these two values can be set as desired,
but remembering that the total number of Words that can be published (virtual points and registers) must be
less or equal to 125 as said before.
Each MCP 4 belonging to the network will write in its memory the information published by the other MCP 4
controllers; each Word will be stored in the same position from which it has been originated, therefore the
content of register R50 of a MCP 4, for instance, will be stored as R50 by all other MCP 4 controllers. For this
reason, of course, the Words published by each MCP 4 must be different from one to the others; in other
words, it is mandatory to avoid superimposition of the Words published by the controllers belonging to the
same network.
DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it
Rel.: 1.2 October 201 Page 13 of 7

Contatto MCP 4 – User's manual DUEMMEGI
It is also possible to publish non contiguous blocks of virtual points and registers, specifying more NETWORK
directives, up to a maximum of (as total of V-Words and R-Words). For instance, the following directive
may be enclosed in the same MCP 4:
NETWORK = (V1 .. V16)
NETWORK = (V513 .. V576)
NETWORK = (V1025 .. V1056)
NETWORK = (R0 .. R8)
NETWORK = (R33 .. R37)
NETWORK = (R50 .. R52)
NETWORK = (R100 .. R100)
NETWORK = (R251 .. R255)
To publish only one register, simply specify the same value for Rstart and Rstop (see R100 in the previous
example). Each MCP 4 acquires the information published by the other components of the same network
even if it does not contain any NETWORK directive; for instance, if only one MCP 4 has to send information to
the other components of the networks, but not vice-versa, then the NETWORK directive may be activated only
for the “master” MCP 4 controller.
Remember:
if a NETWORK directive has been inserted in a MCP 4, then also an ADDRESS directive must be insrted too
and this last one must be placed before any NETWORK directive
the Words published by a MCP 4 must be different from one to the other in order to avoid
superimposition
up to NETWORK directive can be enabled in each MCP 4 in the network
Each MCP 4 acquires the information published by the other components of the same network even if it
does not contain any NETWORK directive
the data exchange mechanism here described also applies between Contatto MCP 4 controllers and
Domino DFCP controller, allowing interactions between the two systems
Example:
Suppose to have installed 2 MCP 4; also suppose to have connected, to each one of them, 1 MOD I/A, 1
MOD R, both with address 1, 1 MOANI and 1 MOANU, both with address 2. Suppose that the application
requires to control the outputs of a bus by the input of the other one and vice-versa..
The programs to be written in the two MCP 4 controllers are:
// Program for M P-4 1
ADDRESS = ( 1 ) // Address of first M P
NETWORK = (V1..V16)// Send 16 virtual points to the other M P
NETWORK = (R0..R0)// Send 1 register to the other M P
V1 = I1.1 // opy the local inputs to first 8 virtual points
V2 = I1.2
V3 = I1.3
V4 = I1.4
V5 = I1.5
V6 = I1.6
V7 = I1.7
V8 = I1.8
O1.1 = V17 // opy the received virtual points to the outputs
O1.2 = V18
O1.3 = V19
O1.4 = V20
O1.5 = V21
O1.6 = V22
O1.7 = V23
O1.8 = V24
R0 = AI2 // opy the analog input to first register
AO2 = R1 // opy the second register to analog output
// Program for M P-4 2
ADDRESS = ( 2 ) // Address of second M P
NETWORK = (V17..V32 // Send 16 virtual points to the other M P
NETWORK = (R1..R1)// Send 1 register to the other M P
V17 = I1.1 // opy the local inputs to the virtual points to be sent
V18 = I1.2
Page 14 of 7 Rel.: 1.2 October 201 DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it

DUEMMEGI MCP 4 – User's manual Contatto
V19 = I1.3
V20 = I1.4
V21 = I1.5
V22 = I1.6
V23 = I1.7
V24 = I1.8
O1.1 = V1 // opy the received virtual points to the outputs
O1.2 = V2
O1.3 = V3
O1.4 = V4
O1.5 = V5
O1.6 = V6
O1.7 = V7
O1.8 = V8
R1 = AI2 // opy the analog input to second register
AO2 = R0 // opy the first register to analog output
In practice, the status of inputs I1.1..I1.8 of the module connected to the 1st MCP 4 will be copied to
V1..V8 of the same MCP 4 and published on the networks. The 2nd MCP 4 receives the status of these
virtual points and it stores them in the same position V1..V8, thus transferring the status to output module
O1 connected on its bus. The same thing happens in the reverse way through the virtual points V17..V24;
the same mechanism also applies to the registers.
2.1.12- Number of nodes in a MCP 4 network
In a network made as described in the previous paragraph, up to 32 MCP 4 may be installed, each one
publishing its data in order to make available them to the other components of the network. Since only one
MCP 4 at a time can access the RS4 5 communication line (COM2), being this of serial type, then the
publication of the information by all the components (or nodes) of the network needs a sure time.
Due to the particular management of the mechanism to access to the network, this time can be optimized
instructing each MCP 4 about how many are the participants to the same network; too do this, the following
directive has to be used:
NODESNUM = ( num )
where num is the number of nodes and must be in the range 1 to 32.
The time required by all the nodes to publish their information, in the worst case of 125 Words to be
published, at 115.2 Kbaud, ranges from a minimum of 0 milliseconds, in the case of 2 MCP 4, to a
maximum of 1 second in the case of 32 MCP 4.
If the number of nodes has not been specified by the NODESNUM directive, this parameter will be set to 32 by
default; in this case the network will work anyway but, if for instance the network is made by 2 MCP 4, the
time needed for a full cycle will result increased from 0 milliseconds to 340 milliseconds (at 115.2 Kbaud
and in the worst case of 125 Words to be published).
The NODESNUM directive is thus optional, but it is useful to drastically reduce the time needed to exchange
data among MCP 4 controllers when the number of nodes is less than the allowed maximum value.
DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it
Rel.: 1.2 October 201 Page 15 of 7

Contatto MCP 4 – User's manual DUEMMEGI
2.1.13- Scheduler
The Scheduler allows to control a digital output point (exclusively virtual point) as function of the current day
and time. MCP 4 includes a timekeeper circuit with back-up battery to avoid the date and time loss when
disconnecting the main power supply. The transition from standard to daylight saving time is made
automatically by MCP 4.
MCP 4 includes a complete weekly Scheduler: it allows to specify, for each day of the week, in which time
slots the specified output must be activated and which are not.
Such programming is repeated identical for all the weeks of the year. The virtual point controlled by the
Scheduler must then eventually reported to the desired physical outputs, in combination with other points if
required.
The Scheduler integrated in MCP 4 allows the control of 16 different points (“zones”) each one with time
slots ( ON-OFF intervals) for each day of the week. The resolution of the Scheduler is 1 minute.
The Scheduler will be activated by the following directive:
S HEDULER n ( Vx )
where:
n is the Scheduler number (“zone”) and it must be in the range 1 to 16
Vx is the controlled virtual point
I the points to be controlled are more than one, more directives must be added as in the following example.
S HEDULER 1 ( V100 )
S HEDULER 2 ( V101 )
S HEDULER 3 ( V102 )
Unlike CLOCK equation which will be described later, where the specified times are set in the user program
and then the change these ones requires reprogramming of MCP 4, the Scheduler here described allows
easy setting from any supervision program or through the WEB server (optional) integrated in MCP 4. For
details on entering and modification of schedules, refer to the specific documentation.
The following figure shows an example of a page that can be developed for the management of the
Scheduler.
Page 16 of 7 Rel.: 1.2 October 201 DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it

DUEMMEGI MCP 4 – User's manual Contatto
2.2- Event triggered Equations
2.2.1- Logic equations
Operators: & (AND), | (OR), ! (NOT), ^ (XOR)
(XOR is evaluated by the compiler as follows: A ^ B = !A & B | A & !B)
O10.3 = I1.1
O2.5 = (I1.1 | I1.2)
V6 = (I4.3 | I8.2) & V4
O1.6 = V100 & I1.7
O1.6 = !I1.3 & I1.7
O1.1 = I2.1 & (I4.3 | I2.4)
O8.1 = V7 ^ I43.2
2.2.2- SET – RESET equations
Operators:
SSET on the edge
SP SET priority on the edge
SL SET on the level
SPL SET priority and on the level
RRESET on the edge
RP RESET priority on the edge
RL RESET on the level
RPL RESET priority on the level
O1.1 = SI1.1 & RI1.2 Set/Reset edge triggered.
O1.1 = SI1.1 & RI1.2 Set/Reset edge triggered
O1.1 = SI1.1 & RLI1.2 Reset on the level: out is locked OFF if I1.2 is activated.
O1.1 = SPLI1.1 & RLI1.2 Set/Reset on the level, but out is locked ON if I1.1 is activated (since
it is specified to be a priority command).
O1.5 = I2.3 & RI2.1 & SI4.6 I2.3 is a consent.
O1.1 = (SI1.1 | SI1.2) & RI1.3 Parenthesis use: out goes ON activating I1.1 or I1.2.
O1.1 = SI1.1 & RI1.2 & RI1.3 Out goes OFF activating I1.2 or I1.3.
O1.1 = SLI1.1 & SLI1.2 & RI1.3 Out goes ON activating BOTH I1.1 and I1.2
DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it
Rel.: 1.2 October 201 Page 17 of 7

Contatto MCP 4 – User's manual DUEMMEGI
2.2.3- TOGGLE equations
Operators:
TTOGGLE on the edge
SSET on the edge
SP SET priority on the edge
SL SET on the level
SPL SET priority and on the level
RRESET on the edge
RP RESET priority on the edge
RL RESET on the level
RPL RESET priority on the level
Terms must be linked by OR operators; no “free” input can be used.
O1.1 = TI6.1 | TV6 Out toggles at every OFF-ON variation of I6.1 or V6.
O1.1 = T!I6.1 Out toggles at the variation ON-OFF of the input.
V100 = TV1 | SV2 | RV3 Set and Reset on the edge.
V100 = TV1 | SV2 | RLV3 Out is locked OFF until V3 is activated (being on the level) .
O1.1 = TI1.1 | TI1.2 | SI1.3 | SI1.4 | RI1.5 | RI1.6 More command inputs.
2.2.4- COUNTER Equations
Counter equation controls a digital output as function of the comparison between the counter value and a
threshold. 1024 counters can be defined. Each counter can be controlled by real or virtual inputs, each one
with its own specific function:
1. one or more inputs for forward or backward counting (S(k))
2. one or more inputs for the zeroing or to load the counter with a defined value (P(z), PP(z),
PL(z), PPL(z) )
3. one or more inputs to stop the counting (H, HP )
The counter, depending on the variations at its inputs, will be updated and then compared to the threshold
value, in order to control the output. Allowed operators are:
<lower than
<= lower or equal to
== equal to
!= not equal to
>greater than
>= greater or equal to
Control operators:
S(k) Sum k to counter on the edge (k range: -3276 to 32767)
P(z) Preset counter to z on the edge (z range: 0 to 65535)
PP(z) Priority Preset counter to z on the edge (z range: 0 to 65535)
PL(z) Preset counter to z on the level (z range: 0 to 65535)
PPL(z) Priority Preset counter to z on the level (z range: 0 to 65535)
HLock the counter to the current value on the level (Halt)
HP Priority Lock the counter to the current value on the level (Halt)
Page 1 of 7 Rel.: 1.2 October 201 DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it

DUEMMEGI MCP 4 – User's manual Contatto
All counters of MCP4 are in 16-bit format, thus the content of each counter is in the range 0 to 65535.
For the counter function, the following options can be also specified:
➢AUTORESET/AUTORELOAD
➢MIN
➢MAX
➢Cn,R copy the counter value to a register (with same identifier)
➢Variable parameters
The syntax allowing to specify these options is the following (Vx may be any allowed point):
Vx = y,R > 30, AR, MIN, MAX .........
where:
•R means that the counter value is continuously copied in a register (with the same identifier)
•AR is the (optional) value for the autoreset and the autoreload, in order to make possible the
automatic zeroing and the automatic loading of the counter: when the forward counting exceeds the
value AR, then the counter wil be automatically zeroed, while when the backward counting decrease
below the value 0, then the counter will be automatically reloaded with the value AR. This value can
be also the content of a register (see the examples in the following). Note: if the autoreset/autoreload
value has not been specified then the counting will be stopped to 0 (when down counting) and at the
maximum allowed value (when up counting) thus avoiding the underflow or the overflow of the counter.
•MIN is the minimum value that can be assumed by the counter; the default value is 0
•MAX is the maximum value that can be assumed by the counter; the default value is 65535
The values for the threshold, autoreset, minimum, maximum, step and preset can be also the content of
registers (see the examples in the following).
If one of the options AR, MIN and MAX has been omitted, the default value will be assumed. The described
options must be however separated by commas as in the following examples.
Examples:
V1 = 0>300 S(2)I1.1 & S(-1)I1.2 Up counting step 2, Down counting step 1, V1 goes
ON when counter is greater than 300.
V1 = 0>30,50 S(1)I1.1 & S(-1)I1.2 Autoreset/Autoreload: when counter exceeds 50, it is
reset to zero; when the counter goes below zero, it is
reloaded to 50.
V1 = 0>30,,5,50 S(1)I1.1 & S(-1)I1.2 MIN and MAX: the up counting is stopped to 50 and
the down counting is stopped to 5.
V1 = 0>3,5,1 S(1)I1.1 & S(-1)I1.2 Autoreset/Autoreload and MIN: when counter
exceeds 5, it is reloaded to 1; when the counter goes
below 1, it is reloaded to 5.
V15 = 10,R > 100 S(1)I1.1 & S(-1)I1.2 \ Copy Counter to Reg: the value of C10 is copied
& PL(0)I1.3 to register R10.
V10 = 1 > R0,R1,R2,R3 S(R4)I1.1 \ Variable parameters.
& P(R4)I1.3
DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it
Rel.: 1.2 October 201 Page 19 of 7

Contatto MCP 4 – User's manual DUEMMEGI
2.2.5- T RES OLD Equations
Threshold equation controls a digital output as function of the comparison between an analog value (input
module or register) and a Threshold and an Hysteresis. Allowed comparison operators:
<lower than
<= lower or equal to
== equal to
!= not equal to
>greater than
>= greater or equal to
Options:
➢Hysteresis
➢Variable parameters
The Hysteresis has a different meaning depending on the comparison operator:
<OUT goes ON when AI<T and OUT goes OFF when AI>=(T + H)
<= OUT goes ON when AI<=T and OUT goes OFF when AI>(T + H)
== OUT goes ON when AI==T and OUT goes OFF when AI>(T + H) or when AI<(T - H)
!= OUT goes OFF when AI==T and OUT goes ON when AI>(T + H) or when AI<(T - H). This
behavior is complementary to the previous case
>OUT goes ON when AI>T and OUT goes OFF when AI<=(T - H)
>= OUT goes ON when AI>=T and OUT goes OFF when AI<(T - H)
Threshold and Hysteresis must be in the range 0 to 65535. Other allowable operators: AND (&) and OR (|).
Examples:
O1.1 = AI1 >= 240,2
V2 = AI1 == 40 | AI2 == 30
V2 = AI1 == 40,5
O1.4 = AI1 < 128 & AI1 > 30
O1.5 = AI1 < 600 & R50 >= 30
O1.1 = AI1 > R51,R52 & AI1 < 1000,5
2.2.6- TIMER Equations
Timer equation controls a digital output as function of two delay times. 512 timers can be defined. The timer
resolution is 0.1s and time range is 0 to 6553.5s (1h:49’). The times specified in the timer equation are
intended in second multiplied by 10 (Te=100 means 10 seconds).
The input starting the timer is the “trigger” input and it always works on the edge.
Keyword:
TIMER Standard timer
TIMERP Non re-triggerable Pulse timer (monostable)
TIMERPR Re-triggerable Pulse timer (monostable)
E4ended control operators:
HLock the timer to the current value on the level (Halt)
ZZero, force the expiring of the current timer value (if running) on the edge
ZL Zero, force the expiring of the current timer value on the level
Page 20 of 7 Rel.: 1.2 October 201 DUEMMEGI s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/552136 6 – www.duemmegi.it
Table of contents
Other Duemmegi Control Unit manuals
Popular Control Unit manuals by other brands

APV
APV SLFSBV02 Series Installation, operation & maintenance manual

Festo
Festo HMP-...-SL Series operating instructions

Jung
Jung 2072 TSM operating instructions

Grundfos
Grundfos MP 204 Installation and operating instructions

Lab-T
Lab-T SP68 user manual

Behringer
Behringer DUAL ENVELOPE GENERATOR MODULE 1003 quick start guide