Home
Contatto MCP XT
Contents
1. 20139 MILANO Rel 2 1 September 2011 Page 35 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual 3 2 11 RAM k and WORD k The functions GRAM k and WORD k allow to access to pairs of RAM locations or single Words The specified value k is the starting RAM address or the Word number and must be a constant value in the range 0 to 65535 in the first case and 0 to 32767 in the second one For instance the day of the month is mapped in RAM memory at the address corresponding to Word 1924 to copy this value therefore the content of the Word 1924 for instance into register R2 the following notations can be used R2 RAMOx0F08 or R2 WORD1924 On the other hand the Word content can be also written RAMOxOFO8 R2 or WORD1924 R2 These functions are useful when the Word to be accessed to both for reading and writing cannot be identified in other ways in other words when it cannot be identified by notations as Cx Ry etc and they are an option to the pointer method described before 3 2 12 SWAP x The SWAP x function exchange the high byte with the low byte of the specified Word x The Word can be specified in one of the following ways 1 directly by its symbolic name e g R34 C48 AI24 3 etc 2 directly by WORD or RAM 3 by pointer Examples of the first way RO SWAP 118 2 R1 SWAP R1 Examples of the second way R66 SWAP GWORD1
2. MCP XT will answer with a number of bytes equal to Number divided by 8 Example 1 Read the input status of module 43 for instance a MOD8I A that as known features 8 input points and a single channel 1 The parameters to be passed to MODBUS driver are Start 688 Number 16 MCP XT will answer with 2 bytes containing the status of the input points of module 43 according to the binary code 1 input ON O input OFF The less significant bit of the lower byte is related to the input point 1 the most significant bit is related to the input point 8 the higher byte will be in this case always 0x00 zero Example 2 Read the input status of modules 57 58 59 and 60 for instance all MOD8I A modules that as known features 8 input points each one The parameters to be passed to MODBUS driver are Start 912 Number 64 MCP XT will answer with 8 bytes containing the status of the input points of modules from 57 to 60 included DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 63 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual 11 3 3 Function 3 Reading the registers RAM memory The MODBUS function 3 is the most used because of general use and it allows to read the content of the RAM memory of MCP XT with all information about the status of the system The following parameters have to be specified a starting point Start this value is the ad
3. Register Dec Hex Register Counter Counter DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 65 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual 11 3 4 Function 4 Reading analog inputs The MODBUS function 4 is substantially equivalent to the function 3 therefore refer to this last one 11 3 5 Function 5 Command of a single output digital point The function 5 allows to force the status of a single output digital point both real and virtual one it is necessary to specify e REAL OUTPUT the number of the real output point to be forced Number said i the address of the real module of COTATI system a point of which has to be changed and said p the output point to be changed then Number must be set to i 71 x 64 p 1 CH 1 x 16 Allowed values for i range from 1 to 127 for p they range from 1 to 16 and for CH they range from 1 to 4 e VIRTUAL OUPUT the number of the output virtual point to be forced Number said n the number of the virtual point to be changed then Number must be set to 16384 n 1 Allowed values for n range from 1 to 2032 new status of the output point OXFF00 ON 0x0000 OFF Example Switch on the point 3 channel 1 of the output module addressed 29 The parameters to be passed to the MODBUS driver are Number 1794 Status 11 3 6 Function 6 Writing a single register RAM me
4. gt Greater than or equal to Equal to lt Less than lt Less than or equal to Not equal to The following script includes two IF THEN ENDIF blocks note that the first block is written on the same line therefore the 5 symbol must be used to split the several instructions The second IF THEN ENDIF um block on the contrary is written on more lines therefore the symbol is not required SCRIPT 1 TRIGGER 1 IF RO gt 25 THEN RO 1 ENDIF IF RO 0 THEN R1 140 R2 50 151 ENDIF ENDSCRIPT The following script includes an IF block with ELSE SCRIPT 1 TRIGGER 1 IF I4 7 1 THEN 01 1 Il 1 ELSE 01 12 0 ENDIF ENDSCRIPT DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 27 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual Note in both examples how tabulations help to better identify the beginning and the end of the IF blocks If the argument of the condition is a bit then the comparison operator can be omitted for instance the two notations if RO 1 1 then and if 50 1 then are absolutely equivalent statements 3 2 5 CARRY and ZERO CARRY and ZERO are two system bits also called flags providing information about the result of the just executed mathematical or logic operation The CARRY flag value is 1 if the result of the previous operation exceeds the value 65535 overflow or if the result of the pre
5. 20139 MILANO Rel 2 1 September 2011 Page 59 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual DUFMMEGI If the module is used to measure a pressure through a proper transducer with 0 10V output in the range 1 bar at OV output to 15 bar at 10V output then the settings required by MCP VISIO to show the read value in bar unit will be Zero Value 1 Full scale Value 15 D The Value Bit will be updated by the program according to the other two values For the special analog modules e g MOD2PT and MODNTC the scale setting should be opt left to the default value because the measured parameters are well defined ofca Regarding the counter modules MODCNT see figure on this right side it is possible to reset each one of the 4 counting values clicking on the related box text while holding down the Shift button on the keyboard 10 3 2 The Projects of MCP VISIO MCP VISIO allows to save all its current settings intended as opened groups windows positions and dimensions of the windows zoom levels and graphic levels etc To create a project press the button E of MCP VISIO or select the menu item Save project from the Visio menu To recall a previously saved project press the button a of MCP VISIO or select the menu item Open Project from the Visio menu 10 3 3 The Simulator of MCP VISIO MCP VISIO features a simulator allow
6. RS485 Baud Rate Wait Time msec 115200 10 Press Read to read the current MCP XT setting for the Baud Rate on RS 232 and RS485 port The other two parameters T Wait are the delay time before the answer of MCP XT to a Host request these wait times are suggested to be not changed if not really needed Choose the wanted Baud Rate for each port and then press the Write button to transfer the new setting to MCP XT Finally press the Close button take in account that when changing the Baud Rate of the port to which the PC is currently connected to a new communication enable procedure at the new Baud Rate is needed The allowed Baud Rates are 2400 4800 9600 19200 38400 57600 115200 Page 42 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 5 3 RS232 and RS485 serial ports of MCP XT MCP XT provides both RS232 on the front panel and RS485 terminals 1 to 5 serial ports These ports are electrically insulated from other circuits by means of some internal opto couplers and a dc dc converter no additional external power supply is required However RS232 and RS485 ports are not insulated each one to the other RS485 port of MCP Plus is doubled into 4 terminals plus another terminal for the shield in order to make easy the multi drop connection in other words terminals 1 and 4 signal A are internally sh
7. call TEST R1 100 WORD O1 6 BMASK 6 call TEST R2 150 WORD O1 7 BMASK 7 call TEST R3 200 WORD 01 8 BMASK 8 exit sub TEST REGIN KAPPA WOUT MSK if REGIN gt KAPPA then WOUT WOUT MSK output ON else WOUT WOUT amp MSK output OFF endif endsub endscript DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 37 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual 4 PROGRAM WRITING The program writing is the first step of the MCP XT controller The equations SCRIPTS and all concerning the operating program must be written according to the related syntax as described in the previous paragraphs To write a program for MCP XT the software package MCP IDE Integrated Design Environment has to be used this package is provided free of charge by DUEMMEGI together to MCP XT module This program must be installed on a Personal Computer with the following minimum characteristics operative system WINDOWS XP Vista or 7 processor with 800MHz clock minimum 512M RAM memory HD with 50MB free space Video with graphic resolution 1024x768 pixel minimum mouse MCP IDE in addition to the program writing support allows all operation related to the setting up an to the maintenance For more details on the using of this program refer to the related documentation Essentially MCP IDE software tool includes a text edito
8. group to another one To copy a module in the Clipboard Click on any area of the module itself while holding down the Ctrl button on the keyboard To paste a the module from the Clipboard to a group press the button al in the destination group zi Each group can be saved or updated in a file by the button or by the related menu item and then reloaded by the button i Set Scale For analog modules MCP VISIO SE 5 allows the setting of the m mn ED EZ measurement scale The figure on this right side shows 3 analog modules MOAN I4 MOD2PT e Value Bit 0039216 MODNTO inside a group of MCP VISIO MOAN I4 Zero Value 0 000 Full Scale Value 10 000 Each text box inside the graphic representation of the module is the values read from the field or the simulated value Clicking on these text boxes with the right button of the mouse a window allowing to change the measurement scale setting appears the values shown in this window depend on the considered module For instance clicking with right button on a text box of MOAN I4 module the window shown on this left side will appear the zero value and the full scale value can be set in this window The Value Bit is the achieved resolution using the currently setting of zero and full scale values As shown the default settings for this module are Zero Value 0 and Full scale Value 10 DUEMMEGI s r l Via Longhena 4
9. o54 oos ora 984 aoa 1004 1014 Coo sos sis 925 sas ses oes oos sys 985 ses 1005 tots DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Tel 02 57300377 Fax 02 55213686 www duemmegi it Page 71 of 78 CONTATTO MCP XT User s manual 11 4 3 Virtual points Criss 3154 1155 1156 1187 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1166 Bto v vi ve v ves ver ver vns vos vias vier vir7 vies vane v225 vou Ceia v2 vie vea vso ves vez vos via viso viae viez vire vies vzro vaz vs vie ves vsi ver ves voo vs vios viar vies viro vios vzn voor vz Bita va vo ve vg ves vea vioo ve visz vise vies vieo vies vez vs Ceia vs va ver vss veo ves vior ver viss vias vies vier vior vers vas Bits ve v vee vee vro vee vioz viie visa viso vise viez viee vere vaso vas Eme vr v vs vss vr ver vios vne vies vier vier vies vies vars v ar Bito vio vzs v vse vra veo vios viz viss visa viro vies v2o2 vase vasa vas Bero vii v ves v vrs ver vior vizs viso viss vim vier vzo vzro vss mis vis vao vee vez vre voa vro vize viaz vis
10. vissz vive v2000 vzore vao 11 4 4 Registers R 000 oro 020 oso oao oso oso oro oso 090 009 2048 2058 2068 2078 2088 2096 2108 2118 2128 2138 214 Foot 2049 2059 2069 zor 2080 2099 2109 2119 2129 2130 2 002 2050 2060 2070 2080 2090 2100 2110 2120 2130 2140 2 Loos 2051 2061 2071 2081 2001 2101 21 2121 2131 2141 2 Los 2053 2063 2073 2083 2003 2108 2113 2123 2133 2145 oos 2054 2064 2074 2084 2004 2104 2114 2124 2134 2124 2 2 2 Coo 2057 2067 zorr 2087 2097 2107 2117 2127 2137 zr 2167 100 004 2052 2062 2072 2082 2092 2102 2112 2122 2132 2142 2152 2157 Page 74 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual ONTATIO C220 230 240 250 260 270 250 2528 2241 2251 2261 2271 2281 2291 2301 2311 2321 233 23 zn 2251 2281 2271 2281 2291 2301 2311 2321 2331 2322 233 06 2214 2224 2234 2244 2254 2264 2274 2284 2294 2304 2314 2324 2334 2345 C009 2217 2227 2237 2247 2257 2267 2277 2287 2207 2307 2317 2327 2337 2347 R azo 390 340 sso 360 sro sso so 200 a0 a20 aso 440 450
11. 1 372 December 31 the formula giving the number related to the day DD 1 31 of month MM 1 12 is the following MM 1 x 31 DD Variable absolute dates specified in a register Rx or in a Word QWORD x containing 8 number in the range 1 to 37200 corresponding to the day of the century starting from January 1 00 37200 December 31 99 the formula giving the number related to the day DD 1 31 of month MM 1 12 of year YY 0 99 is the following 372 x YY MM 1 x 31 DD Out is ON everyday from 8 15 to 17 30 daily scheduling CLOCK MON 8 00 FRI 20 00 Out is on from Monday 8 00 to Friday 20 00 weekly scheduling DATE 31 07 02 09 Out is ON from July 31 to September 9 yearly scheduling DATE 31 07 05 02 09 05 Out is ON from July 31 2005 to September 9 2005 absolute scheduling CLOCK TUE 8 00 TUE 12 00 Out is ON the Tuesday 8 00 to 12 00 and it is also CLOCK THU 14 30 SAT 00 00 DATE 12 01 06 15 01 06 DATE 20 01 06 22 01 06 DATE 12 01 06 15 01 06 amp ON from Thursday 14 30 to Saturday 0 00 Out is ON from 12 01 06 to 15 01 06 and from 20 01 06 to 22 01 06 Out is ON from 10 00 to 17 00 but only in the CLOCK 10 00 17 00 specified days CLOCK XX RO XX R1 Daily switching ON at time specified by RO and daily switching OFF at the time specified by R1 For example if RO 675 and R1 1280 then out will be ON everyday from 11 15 to 21 20 CLOCK XX WORD
12. 1 Word The output modules are modules 127 Note 1 0502 05FF 641 767 Status or value of CH2 of output Each status or value takes 1 Word The output modules are modules 127 Note 1 0602 06FF 769 895 Status or value of CH3 of output Each status or value takes 1 Word The output modules are modules 127 Note 1 0702 07FF 897 1023 Status or value of CH4 of output Each status or value takes 1 Word The output modules are modules 127 Note 1 0902 09FF 1153 1279 Map of the virtual points 2032 virtual points digital only organized as block of 16 points for each Word 8 points for per byte Note 2 1920 Hours in BCD format Read from the MCP XT timekeeper chip Note 3 OF02 0F03 1921 Minutes in BCD format Read from the MCP XT timekeeper chip Note 3 OF04 0F05 1922 Seconds in BCD format Read from the MCP XT timekeeper chip Note 3 OF06 0F07 1923 Day of the week in BCD format Read from the MCP XT chip TIMERO TIMER511 4 Words for each timer the first containing the current time and the other three reserved Note 4 Note 5 2 bytes for each modules offset 2 x Module Address Note 6 Note 7 Note 6 Note 8 1 byte for each modules offset Module Address modules MODCNT Note 6 Note 9 Note 1 Generally for digital inputs and outputs bit 1 means active status and bit 0 means non active status For analog modules the Word contains the value referred to that channel The less significant bit of a
13. 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual Css 1280 1251 1252 1253 1254 1255 1256 asr 1258 1259 1260 1261 1262 1263 1264 Lic visos vissa visro visae vieo2 visse vies vieso vies vieez vieoe viria vis viras virez virze V1755 V1771 V1787 1205 1266 1267 1268 126 1270 1271 1272 ars 1274 1275 sare 1277 1219 Bits vires vier vieze visas vieso viere vieez vioos viene vieso viese viorz vies vaoos vaoz Bita virer vies vieze visas viest vierr visos vieoo viezs visar viesr viera vroes vaoos vao Bits viros viera vieso visse vies2 viere visos roro vio visez viese viora vaooo vaozz Bite vireo views viesr visar viesa viere visos ions viezr vioas vieso viers vieer vaoor vaozs Bito vreoz viere viesa vieso viese vieez viso viota vies visas vroez viere vieea voro vao Fait viso views viess vies visor vrees eoo oss vies viser vises vio vies vaoss v2027 Fait visos viezz viese vies viero vieee vianz viore vieoa vise vieoo vieez vaosa vaoxo Fait vie vies vies viess ers vieer vioo viero vieas viser vieer vives visse vaoss vao Fits vios vieza vieao visse viera vieee vans vies
14. Add U Add H Add L N Reading from microcontroller memory of N bytes 12255 starting from address specified by the first 3 data bytes N 0 means reading of 256 bytes Note 2 Ox7C 5 256 Add U Add H Add L N Data1 Writing to microcontroller memory of N DataN bytes 15252 starting from address Se by the first 3 data bytes Note 2 Ox7B Mod Add N Reading of N 1 32 output modules starting from module address Mod Addr Ox7A 2 Mod Add N Reading of N 1 32 input modules starting from module address Mod Addr Ox79 Mod Addr Ch Status H Status L Writing of a channel Ch 1 4 of an Mask H Mask L output module Mod_Addr 1 127 The mask bit set to 1 identifies which output points have to be modified ERBEN V H V L Status Virtual point writing V H V L is the point number 1 2032 Status can be 0x00 for Bul ID request The data field contains the ASCII code of the two characters 1 and D therefore 0x49 and 0x44 Note 1 If a writing operation modifies an output a virtual point a register a counter etc then the command will be executed when the less significant byte of the Word is written while no command is executed when writing the most significant byte of the Word Note 2 To read write the EEPROM memory of MCPXT the messages 0x7D 0x7C with address starting from Ox7FFO000 have to be used Page 46 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377
15. Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO MCP to HOST answers Data Bytes Ox7F 1 256 Data1 DataN Answer to reading message of N bytes from RAM memory Ox7E 1 OxFF if writing OK Answer to writing message of N bytes to RAM 0x00 se writing KO memory Ox7D 1 256 Data1 DataN Answer to reading message of N bytes from microcontroller memory Ox7C 1 OxFF if writing OK Answer to writing message of N bytes to 0x00 if writing KO microcontroller memory Ox7B 8 256 Data1 Data Nx8 Answer to reading message of N 1 32 output modules starting from address module Mod Addr The answer contains Nx8 bytes in the data field The meaning of each block of 8 bytes is the following Data1 Data2 CH1 of module Mod Addr Data3 Data4 CH2 of module Mod Addr Data5 Data6 CH3 of module Mod Addr Data7 Data8 CH4 of module Mod Addr Ox7A 8 256 Data1 Data Nx8 Answer to reading message of N 1 32 input modules starting from address module Mod_Addr The answer contains Nx8 bytes in the data field The meaning of each block of 8 bytes is the following Data1 Data2 CH1 of module Mod_Addr Data3 Data4 CH2 of module Mod_Addr Data5 Data6 CH3 of module Mod_Addr Data7 Data8 CH4 of module Mod Addr 0x79 1 OxFF if writing OK Answer to channel writing Ch 1 4 of an output 0x00 if writing KO module Mod_Addr 1 127 0x78 1 OxFF if writing OK Answer to writing message of a virtual point 0x00 if writing KO 0x70 FV1_H FV1_L
16. LOGC then the virtual point V2009 will be activated to report this occurrence LOGC N Block start the buffer is circular type AI47 2 changes of input Al47 channel 2 changes to zero excluded AI3 ZERO changes of input 3 channel 1 changes to zero included R230 ZERO changes of register R230 changes to zero included R321 changes of register R321 changes to zero excluded Note commas are mandatory symbols DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 19 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual 2 2 11 Management of the external counter modules ModCNT The counter module code number ModCNT is an external module connected to the EDirimrim bus which counts the pulses applied to its inputs it stores the total amount of the counting in its non volatile memory The management of this module by MCP XT needs a special function specified by an equation very similar to that one for the management of the internal counters Each ModCNT counter module features 4 counting channels thus the equation must specify the channel to be managed MCP XT through a threshold equation can continuously read the content of each external counter and it can compare it to the threshold value the result of the comparison controls a digital real or virtual output Allowed comparison operators are lt lower than lt lower or equal to eq
17. MCP IDE tool software then it can be referred to in the program as many times as needed in the Equations TAB of MCP IDE Each MACRO can have several arguments parameters the number of arguments must be the same in the MACRO definition and in each call The compiler will link the arguments in the call to the arguments in the MACRO definition in the same order they were written It is important to understand that e the MACRO directive only applies to standard MCP XT equations it cannot be applied to SCRIPTs e the MACRO directive is an utility of the compiler it is not a feature of MCP XT in other words the compiler explodes each call to a MACRO into the equations specified in the definition of the same MACRO simply replacing each argument in the definition with the related argument passed by the call Up to 256 MACROs each one with up to 32 arguments can be defined in a MCP XT program The definition of a MACRO is opened by the keyword MACRO followed by the name chosen for the MACRO and inside round brackets the arguments to be passed to The definition of a MACRO is closed by the keyword ENDMACRO The required equations have to included inside this block taking in account that the arguments in the MACRO definition that are variable parameters because they change from a call to the other one cannot have the same names reserved to the parameters or the keywords of MCP XT The following example defines a MACRO named DIMM
18. Word refers to point 1 the most significant bit refers to point 16 Page 48 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO Note 2 The less significant bit of the first Word in the map of virtual points Word 1153 is the status of virtual point V1 the most significant bit of the same Word is the status of the virtual point V16 and so on for the next Words Bit 1 means active status and bit 0 means non active status The virtual point n is the bit n 1 16 n 1 module 16 of the Word 1153 INT n 1 16 Note 3 These Words contain the current status of MCP XT internal timekeeper chip in addition to reading these cells may be written and in this case the timekeeper chip will be updated with new passed parameters also in MODBUS protocol All Words related to the timekeeper information have the MSByte always set to zero while the LSByte contains the related information hh mm ss day of the week day month year in BCD format Note 4 The binary event list can store up to 2048 events and it is organized in blocks of 8 bytes for each event Each 8 byte block related to an event is coded as follows Bit7 Bite Bits Bit4 Bits Bit2 Bita Bito VIRT Module Address 14127 STATUS SYS F Channel 0 3 Point 0 15 NGC ENARRARE enn Hours Loc bp Minutes Lo
19. a program it must be complied again and it must be reload in the simulator Page 60 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 11 MODBUS COMMUNICATION PROTOCOL 11 1 Abstract MCP Plus can interface to external world through MODBUS RTU protocol This protocol is integrated into MCP XT and coexist if enabled by the PROTOCOL directive see related paragraph together to the FXP XT proprietary protocol as described previously this means gt MCP Plus will answer according to the MODBUS protocol if enabled to any MODBUS requests gt MCP Plus will answer according to the proprietary FXP XT protocol to any FXP XT requests This chapter will describe some traces about using of MODBUS protocol The communication parameters for MODBUS protocol implemented into MCP XT are the followings gt 1 start bit gt 8 data bits gt no parity gt 1or2 stop bits automatic detection The baud rate may be set as described in paragraph 5 2 to the following values 2400 4800 9600 19200 38400 57600 115200 baud MCP XT always acts as slave it is a MODBUS peripheral unit this means that it only answers to the requests of a MASTER MODBUS DEVICE In a MODBUS networks each peripheral device must its own address normally named station address the address of MCP XT has to be set by the ADDRESS function as described
20. e UR ANM 56 103 1 The ccu pride raa aen SM 57 10 3 2 The Projects 6f MCP VIS IQ baee htc eh iu tu ex Rede bo tva cunt Ee 60 10 3 3 The Simulator of MCP 60 11 MODBUS COMMUNICATION PROTOCOL sss e nenne nenn nnns ene 61 EE EE 61 11 2 Supported MODBUS functions sssssssssssssssssssssssseeneeeeeen eee eneehne enhn n EEEE E ener nnne 61 11 3 Example of 9 61 11 3 1 Function 1 Reading the digital output status sseeeee 62 11 3 2 Function 2 Reading the digital input 63 11 3 3 Function 3 Reading the registers RAM memory sseeee 64 11 3 4 Function 4 Reading analog inputs essssne mener 66 11 3 5 Function 5 Command of a single output digital point 66 11 3 6 Function 6 Writing a single register RAM memory sese 66 11 3 7 Function 16 Writing multiple registers RAM memory eem e 66 11 4 Tables for relationship Words Parameters of MCP XT 69 EE E PHYSICA
21. in the system and it must manage the information related to the virtual points and registers of MCP XT Example The following instructions will enable the publishing on the bus of virtual points 1025 to 1280 and of the first 32 registers of MCP XT SHARE V1025 V1152 SHARE V1153 V1280 SHARE R0 R7 SHARE R8 R15 SHARE R16 R23 SHARE R24 R31 Page 8 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 2 1 9 Management of fault modules Assign a virtual point to the failure condition of one or more modules MODFAIL V10 MODFAIL V11 I1 I2 O1 02 041 I44 2 1 10 Alignment of the outputs MCP XT cyclically executes in addition its many activities a status request to the output modules both digital and analog ones if MCP XT 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 gt the status or the value of the field output will be transferred to the RAM memory As default MCP XT executes the first alignment type from RAM to field in some cases depending on the module type and on the specif
22. in the two MCP XT controllers are Program for MCP XT 1 ADDRESS 1 Address of first MCP NETWORK V1 V16 Send 16 virtual points to the other MCP NETWORK RO RO Send 1 register to the other MCP TI IIO Copy the local inputs to first 8 virtual points v2 11 2 Y3 v4 11 4 Us 11 5 V6 11 6 Y7 11 7 v8 11 8 01 1 V17 Copy the received virtual points to the outputs 01 2 V18 01 3 V19 01 4 V20 01 5 V21 01 6 V22 01 7 V23 01 8 24 RO AI2 Copy the analog input to first register R1 Copy the second register to analog output Program for MCP XT 2 ADDRESS 2 Address of second MCP NETWORK V17 V32 Send 16 virtual points to the other MCP NETWORK R1 R1 Send 1 register to the other MCP IL l Copy the local inputs to the virtual points to be sent V18 I1 2 1719 V20 I1 4 V21 I1 5 v22 11 6 Il 7 v24 11 8 01 1 v1 Copy the received virtual points to the outputs 01 2 V2 01 3 V3 01 4 V4 01 5 v5 01 6 V6 01 7 V7 01 8 V8 Rl AI2 Copy the analog input to second register AO2 RO Copy the first register to analog output In practice the status of inputs I1 1 1I1 8 of the module connected to the 13 MCP XT will be copied to V1 V8 of the same MCP XT and published on the networks The 2 MCP XT receives the status of these virtual points and it stores them in th
23. sunrise sunset and sun position esessssss 7 2 1 8 Publishing on the bus the status of virtual points and value of registers 8 2 1 9 Management of fault Modules sesionin a aE nennen nennt n nnn nnn nnn enne 9 2 1 10 Alignment of the outputs essssssssssseeeeeeeeeen nmn nnne enhn herren nnn n nnne nennen neis 9 2 1 11 Data exchange between MCP XT controllers sssssm eee 9 2 1 12 Number of nodes in a MCP XT network sssssssssen eene 12 2 2 Event triggered Equations ssssssssssssssssseeseeeeeeeeee enne nnne n nnne nnne nennen nnns nns 12 2 2 1 Logic equations sacris araa Ei AERES ARAE AREKEA A nennt nhe nnne nnne nnne 12 2 2 2 SET RESET equations cccccccccccccccceeeeeeeeeeeeeeeeeteeeeeseeseeeeaaaaaeaeeeeeeeeeeeeeeeesaaaceeeeseeeaaeees 12 2 2 9 TOGGLE equatiohns er rre 13 2 2 4 COUNTER Equations 14 2 2 5 THRESHOLD Equations ERE o hela dsl eo et Chad ate ecd pex ba eer arte FE ocu Re cesta 15 2 2 6 TIMER iE T 16 2 2 7 Equations for mathematical and logic calculation eeeneenen 17 2 2 8 Equations for binary code generation ssssssse eene 17 2 2 9 E
24. timer monostable Extended control operators H Lock the timer to the current value on the level Halt Z Zero 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 Note if the Zero on the level command is activated the trigger status is transferred to the output without delays The priority sequence for the timer controls is fixed to Halt Zero and Trigger Options Variable parameters 01 1 TIMER I2 5 30 10 3s delay from 12 5 activation to the out activation 1s delay from 12 5 deactivation to out deactivation V23 TIMER I1 1 0 23 Out is complemented in respect to the trigger input 01 1 TIMER I2 5 amp HI5 1 amp ZI5 2 90 50 Trigger Halt and Zero 15 1 halts the timer 15 2 forces the expiring of the currently running time if the timer is in stand by Halt and Zero controls have not any effect O1 1 TIMERP I1 1 0 20 2s pulse at the activation of the trigger input no action at the deactivation of the input 01 1 TIMERP I1 1 10 20 2s pulse delayed 1s from the activation of the trigger input 01 1 TIMERPR I1 1 0 20 Re triggerable 2s pulse computed from last activation of the trigger 01 1 TIMERPR I1 1 10 20 Re triggerable 2s pulse delayed 1s from the first activation of the trigger input 01 1 TIMER I1 1 R47 R48 Variable parameters Page 16 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Lon
25. wanted parameter The following tables are valid if the directive PROTOCOL MODBUS and not PROTOCOL MODBUS has been used see description of the PROTOCOL directive All numbers in the tables are in decimal format As option DUEMMEGI provides free of charge a small program named WordFinder which immediately gives the address of the MODBUS Word and the bit if required of the wanted parameter This program can be downloaded fro the site www duemmegi it section Software Support DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 69 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP User s manual 11 4 1 Physical inputs 1 ooo oro 020 oso oao oso oco oro oso oso 100 140 120 m pos OOO Foot o or o ost os os1 os or os or 101 1 121 Loo oz or2 ozz 52 os 052 os orz os sz 102 tz 122 Fons oos ois 023 083 oss 053 oss ors oss oss 103 113 125 Fone 004 o4 024 osa osa osa osa ora ose oos 114 120 s cos ois 025 cas oss oss oss ors oss oos 105 115 125 Fone oos 026 036 ose ose ose ore ose ose 106 tz6 oos oos ors 28 ose oss ose ose ors ose oe 108 ne Coos oo ois oze ose ose ose oce ove ose ose wos ie Channel 2
26. 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 01 1 Output definition define Command I1 1 Input definition Pump1 Command Equation The previous equation is fully equivalent to Di 1 11 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 7 7 Definitions define StairLight 01 1 define FloorlButton I1 1 define Floor2Button I1 2 define Floor3Button II 3 Define a virtual point as OR of each button parallel connection V1 FloorlButton Floor2Button Floor3Button Light Output StairLight TIMER Vi 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 Vi 11 1 I1 2 11 3 Light output 01 1 TIMER V1 0 450 Note that using the define directive the p
27. x e e 8 e e t t e e e qT e eo N st e e st e e o t e e o e e o e 1 e 1 NS e e Ite 1 H e X x e e Ie x e w e ce e e e o 1o e N e D 3 N D 8 e e e o o e e N e to X e e o 1 e e e x Mi x e e eo e e N N x x e e o e e N e e e e o o e e e e Page 77 of 78 2 1 September 2011 Rel DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it eo sro 980 sso 1000 4070 1020 og 4052 2042 4os2 2062 4072 2082 4002 L001 2083 2043 4053 4063 4073 4083 4009 002 4034 2044 4054 2064 4074 4084 2094 Loos 2035 2045 oss 2005 ors 2085 2095 o4 2036 4046 2056 4006 4076 4086 os 2037 2047 2057 2067 4077 2087 os 2038 4048 4058 a008 4078 2088 oor 2039 4049 oss 4060 4079 4089 oos 2040 4050 2060 aoro 4080 4090 Coo 2041 os 2061 2071 4081 aoo Page 78 of 78 Rel 2 1 September 2011 MCP XT User s manual DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi
28. 0 WORDX x and pointers eessssseeeeeeeeneeneen nm enne nnne enhn nennen nnne rennes 35 3 2 11 RAM k and WORD K sssssssssssseeeeennn eene enreennn nennen enhn nenne nennen nnne s nnns 36 Page 2 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 3 2 12 SWAP Oa EE 36 RANDOM m 36 RAM E Else dg 37 iine CR B RMINNCH 38 4 1 Rule Tor program Writllig sid peg Fees E eon 38 4 2 Compiling the program 2 c corona nerui mio na nta ober ur re ERES ER OR Me Fea EAE quad 40 4 3 Uploading the program to MCP XT 40 5s SETTING UP EUER 41 SM 41 SEALS retis 42 5 3 RS232 and RS485 serial ports Of MCP XT ensem errre nennen nene 43 5 4 WEBS communication 49 6 DIAGNOSTICS e 44 6 1 Diagnostics of CONTATTO system through MCP XT eee nennen nnne 44 T TECHNICAL CHARAGTERIST IS ide utente
29. 000 oro 020 oso oao oso oco oro oso ooo 100 170 120 a pue se se pie pur sm ise me me 538 zw me Poot 129 139 140 159 160 179 teo 109 209 zto 229 zso 249 F002 130 140 150 160 470 180 19 200 210 220 230 240 250 Coos i 14 i5 6r ri 38r 19 zo 20i zzi s 2 251 Loos 132 142 152 162 172 182 192 202 212 222 232 242 252 oos 133 ts iss 63 73 183 193 203 213 223 233 243 253 oos 134 154 64 tra 184 194 204 214 224 234 244 254 oos 136 146 156 166 176 186 196 208 216 226 zo 46 Loos 17 ar 15r rr ter 39r 207 217 zer zer ze _ Id 3 ooo oro 020 oso oao oso oco oro oso ooo 170 120 oss ze ze pue pss ow ss ss oe ase 36 are oot 257 zer 27r 287 sr 307 a17 ser 331 ser 357 sev 377 o2 258 258 zr amp 288 208 308 318 ses ass 348 ase 368 378 Coos 259 20 zre 289 200 309 319 ss 339 sse ase seo 370 4 250 27 260 290 soo 310 320 sso so sso aco sro 380 Coos 261 271 261 291 sw st az oan se 351 ser srt 301 ooe 262 272 282 292 302 312 szz a2 342 ss ez 872 32 Coos 264 274 264 294 so aia a24 aaa aaa ao
30. 011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it Options Notes the argument x of the notation WORD x may be in the range 0 to 65535 this is true unless otherwise specified for the CLOCK and DATE equations only the timing 24 00 is not allowed use instead the timing 00 00 taking attention that it is the morning of the specified day ol v3 03 03 v4 V6 v8 ol ol ol DUEMMEGI s r l Via Longhena 4 20139 MILANO 1 CLOCK 8 15 17 30 MCP XT User s manual CONTATTO Variable daily scheduling times specified in a register Rx or in a Word WORD x containing a number in the range 0 to 1439 corresponding to the number of minutes of the day starting from 0 00 1439 23 59 the formula giving the number related to time hh mm is the following hh x 60 mm Variable weekly scheduling times specified in a register Rx or in a Word WORD x containing a number in the range O to 10079 corresponding to the number of minutes of the week starting from 0 00 of Monday 10079 23 59 of Sunday the formula giving the number related to time DW hh mm assuming for the days of the week DW MON 0 SUN 6 is the following DW x 1440 hh x 60 mm Variable yearly dates specified in a register Rx or in a Word QWORD x containing a number in the range 1 to 372 corresponding to the day of the year starting from January
31. 20139 MILANO Rel 2 1 September 2011 Page 53 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual DUEMMEGI The Configuration workspace allows writing the module list and other information e g ADDRESS x MCPIDE D Programmi MCPIDEW 305 Example equ File Edit View Preferences Compiling Communication Programming Supervisor Help EO 303 23 0 C AS RUE 18 8 08 17 CO 2 Equations Scripts Configuration Resources Decompiling 11 I2 I3 01 02 03 04 05 06 MOD4 4S I50 050 15 07 INS Line 1 595 262144 Bytes The Resources workspace read only contains after compiling information about the resources used in the just compiled program MCPIDE D Programmi MCPIDEW305 Example equ DER Eile Edit View Preferences Compiling Communication Programming Supervisor Help i d TEAS ME ae A 7 053 Equations Macros Scripts Configuration Resources Decompiling HE I E E E E E E LI E OUTPUTS 01 i 47047047047 47 a7 aT am am aT am a gom 1 ge gc qm d g em um 1 pog y 7 7 a 1 ee ae aa al ye a Fe 1 p oam g p acm gm 1 a gt gt 1 m LS 7 7 y E E E B E E E E E LH E E E E TATA TET TT INPUTS 1508 INS Line 1 595 262144 Bytes The Decompiling workspace read only is reserved to expert user and
32. 3 2885 2006 Tone 2654 2864 2874 2884 2804 2904 2914 2024 2934 2044 2954 2064 2074 2084 2006 297 2976 9 3039 3040 3050 06 ka EA oos 3017 5027 3037 3047 2057 300r 11 4 5 Counters ooo oro 020 oso oao oso 060 oro oso 090 100 two 326 ooo 3072 3082 2092 3102 112 stz2 3132 8142 3152 sez 3172 3182 3102 oot sors 3083 3003 3103 3113 9723 iss stas 3153 9185 3173 9185 3795 F002 3074 3084 oos 3104 ria 3124 3134 a124 3154 3164 174 3i Tons sors 3085 3005 3105 iis 0125 3135 sias 3165 sies 3175 31 Fone sors 3086 2006 3106 3116 3126 9105 stas 3156 stes 9176 3186 3196 Loos 2077 3087 2097 3107 avr star 3137 war 3157 8167 a177 31 os 2078 3088 soos 3108 3118 3128 8138 stas 3168 8168 3178 008 76 180 190 200 210 220 230 240 250 3252 3332 33 55 265 3275 333 3 w Io Wy ow WwW ow NIO w Ww ow A S Oo 3 3288 3938 3 wo w 60 ojo w o w als ojo Page 76 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual e e e o D e e o T e eo eo st e e KR st e e
33. 32770 XX WORD32771 As the previous equation but the times are specified by the shown Words CLOCK RO R1 Weekly switching ON at time specified by RO and weekly switching OFF at time specified by R1 For example if RO 675 and R1 6780 then out will be ON every week from Monday 11 15 to Friday 17 00 Rel 2 1 September 2011 Page 21 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual ol H Il CLOCK WORD32770 WORD32771 As the previous equation but time are specified by the shown Words ol H a DATE RO XX Switching ON every year at the date specified by register RO and switching OFF every year at the date specified by R1 For example if RO 48 and R1 82 then out will be ON every year from February 17 to March 20 01 1 DATE WORD32770 XX WORD32771 Xx As the previous equation but the dates are specified by the shown Words 03 2 DATE R3 R4 Switching ON at the absolute date specified by register R3 and switching OFF at the date specified by R4 If R3 675 e R4 6780 the output will be ON from October 24 01 to March 22 18 03 2 DATE WORD32776 WORD32777 As the previous equation but the absolute dates are specified by the shown Words 2 4 Macro A MACRO is a sequence of equations that can be inserted in more points of MCP XT source program by using a single call to the MACRO itself The MACRO must first be defined in the Macros TAB of
34. 70 120 ooo ze ree os eos e18 sos ese sas ese see ere 565 Low 76o 770 ee res soe 819 sco ese 849 ese aso sre 860 o2 770 zeo a00 sio 820 sso 840 aso seo zo 680 000 Coos 771 zer sor e11 821 e81 ear ast ser eri ser oor ooa 772 ez zs amp oz e12 822 e32 642 852 sez 872 682 002 Coos 773 es es os sis zs ess ees asa eco 873 e83 593 ooe 774 rea 704 aoa tia 824 aoa Baa ase aoa 874 684 00a oos 775 zae zoe e06 ate 826 e36 eae ase ses 87e e86 ws 777 er zer 607 wr 827 ssr eer asr sev amp r Sv Channel 4 ooo oro 020 oso oao oso oco oro oso ooo 100 170 120 o0 906 ore 926 936 4s 956 966 ore one 096 1006 7076 oot 897 sor err ser oar oar esr ser err ser eer 1007 1017 o2 sss sos ote 2 sss sas oss oes 978 oes ose 1018 oos sse sos sie 2 sse sas oso oes 979 see 099 1009 vois ova soo szo sso 940 oso oso sro 9 amp 0 900 000 1070 1020 oos e01 om 921 991 se 95r o5 sri os 901 1001 1011 102 Loos 902 012 922 sz o42 952 sz srz 982 092 oo2 1012 1022 oos 904 914 924 934 aa
35. 924 Examples of the third way ptr 1924 R45 SWAP ptr 3 2 13 RANDOM 0 The RANDOM 0 function returns a random number The number is generated according to a particular algorithm Lehmer Random Number Generator which returns a pseudo random value uniformly distributed The parameter passed to the RANDOM function must be always zero The following script call the RANDOM 0 function every 60 seconds and the returned random value will be copied to RO script 1 trigger 60 RO RANDOM 0 Endscript Page 36 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 3 2 14 BMASK x The BMASK x function returns a 16 bit number having in its binary format only one bit set to 1 at the position of x 1 16 This notation means x 1 module 16 and it is equivalent to the remainder of the division of x 1 by 16 The BMASK x function is therefore a mask which can be useful for bit operations The script in the following example calls 4 times a subroutine which must set or reset a virtual point if the value of a register is respectively greater or less than a constant value since both the virtual point and the register and the constant value change at each call then these parameters have to be passed to the subroutine Since the virtual point has to be written then this parameter should be passed as reference but th
36. BLE that therefore has been specified by the declaration BIT ENABLE the function returns a value RSET script 1 TRIGGER 5 var RTEMP R82 RSET R50 V1 R83 RSET R51 V2 R84 RSET R52 V3 R85 RSET R53 V4 exit sub RSET REG BIT ENABLE if ENABLE 1 then RSET REG 2 RSET RSET 128 else RSET 0 endif endsub endscript The following script uses a function having as input parameters two values REG1 and REG2 the function returns a bit TEST that therefore has been specified by the declaration BIT TEST REG1 REG2 DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 33 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it script 2 TRIGGER 5 var RTEMP RTEMP 1 TEST RO R1 if RTEMP 1 1 then R20 100 else R20 0 endif RTEMP 1 TEST R2 R3 if RTEMP 1 1 then R21 200 else R21 0 endif exit sub BIT TEST REG1 REG2 REG1 REG1 2 REG2 REG2 4 if REG1 gt REG2 then TEST 1 else TEST 0 endif endsub endscript MCP XT User s manual The following script o script is a combination of the previous two examples This script uses a function having as input parameters a value REG and a bit ENABLE therefore declared by BIT ENABLE the function returns a bit TEST therefore declared by BIT TEST REG1 BIT ENABLE script 3 TRIGGER 5 5 V17 V18 19 v20 exit sub BIT TEST R
37. BUS 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 Use this option only when replacing a MCP Plus with a MCP XT in old installations having a MODBUS supervision system already developed for MCP Plus 2 1 5 Address of MCP XT Assign the address to MCP XT The address must be in the range 1 to 255 ADDRESS 12 2 1 6 Identifier of MCP XT Assign an identification string to MCP XT max 63 characters ID Building 1 controller 2 1 7 Directive for the calculation of sunrise sunset and sun position MCP XT 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 LOCALIZE directive here described For these calculations the data related to the position has to be provided to MCP XT Longitude and Latitude together to the related time zone e g for Italy this value is 1 In addition MCP XT 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
38. DUEMMEGI CONTATTO MCP XT Programmable Control Module User s Manual Release 2 1 September 2011 tt mococ m RS485 awe CONTATTO DUEMMEGI MILANO ITALY Via Longhena 4 20139 MILANO Tel 02 57300377 FAX 02 55213686 Gj www duemmegi it CONTATTO MCP XT User s manual INDEX A1 CHANGES MADE TO THIS MANUAL IN RESPECT TO THE PREVIOUS 4 A2 RECOMMENDATIONS c aie 4 usd 5 1 1 Required Hardware and Software tools ccccccccccceeeeeeeeeeeeeeeeeteeeeeeeeeaaaaaaaeeeeeeeeeeseaaaeeeseeeaaaeeees 5 1 2 Main features of MCP X om 5 LES Terminology and 371 SEE 5 2 EQUATIONS TYPES AND SYNTAX ccrece tide trente nest tone Rue urere kou End ER e ka Y e EVER Era a ERR 6 2 1 Equations for the system configuration esssssssssseseeeeennemeeenenn nennen nnn 6 2 1 1 Configuration of the Modules cracas EE EEE DEAE nnne nnne 6 2 1 2 Power ON E pian eve 6 2 1 3 Status of fault input MOCUIES iniiae naii ian aiaa aa kE EEEE 6 2 1 4 Communication Protocol AE AE ERE 7 2 1 5 Address of MCP JT ite edere ecc Fever Feeds 7 VES 7 2 1 7 Directive for the calculation of
39. EG BIT ENABLE TEST R50 V1 TEST R51 V2 TEST R52 V3 TEST R53 V4 if ENABLE 1 then REG REG 2 if REG gt 100 then TEST 1 else TEST 0 endif else TEST 0 endif endsub endscript Page 34 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it DUEMMEGI MCP XT User s manual CONTATTO 3 2 10 WORD x and pointers The WORD x function returns the number address of the Word containing the parameter x where the parameter x is intended to be an input an output a virtual point a register or a counter as in the following examples Al WORD I18 2 returns the number of the Word containing I18 channel 2 A2 WORD I18 2 1 returns the number of the Word containing I18 2 1 A3 WORD 093 returns the number of the Word containing O93 channel 1 A4 WORD V46 returns the number of the Word containing V46 A5 WORD R37 returns the number of the Word containing R37 A6 WORD returns the number of the Word containing C42 The following script shows how to use the WORD x function and the pointers Suppose that the application requires a script that every 2 seconds counts how many registers in the range RO to R10 contain a value other tan zero the results the amount of register 0 must be placed into register R15 The function WORD RO returns the number of the Word where register RO is locat
40. ER this MACRO allow to control a dimmer output e g aMOD2DM module whose address is OUT the brightness level is controlled by an UP pushbutton and by a DOWN pushbutton and to implement the needed equation a counter CX and a register RX are also used the argument list is closed by two virtual points VP1 and VP2 needed to realize the wanted function The MACRO definition is the following refer to the technical sheet of MOD2DM module for more details about the meaning of the used equations Page 22 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO MACRO DIMMER OUT UP DOWN X VP1 VP2 VP1 UP DOWN VP2 CX R 1 P 129 UP amp P 130 DOWN amp P 128 VP1 OUT RX ENDMACRO If for instance 6 dimmer outputs must be controlled in the plant with identical operation but with different command inputs the just defined MACRO can be called 6 times as follows DIMMER AO1 11 1 11 2 0 V1 V2 DIMMER A02 11 3 11 4 1 V3 V4 DIMMER A03 11 5 11 6 2 V5 V6 DIMMER A04 11 7 11 8 3 V7 V8 DIMMER AO5 12 1 12 2 4 V9 V10 DIMMER 306 12 3 12 4 5 V11 V12 As it can be seen a different argument list is passed at each call The compiler will explode this program in a sequence of equations that is more difficult to be interpreted and to be modified In other words the compiler
41. FV2_H FV2_L Answer to the identification code request Bytes ID1 ID64 FV1 H FV2_L return the version number of the firmware loaded into MCP XT ID1 ID64 are the ASCII codes of the 64 characters of the identification string DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 47 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP User s manual 9 2 RAM memory mapping The following table describes the RAM mapping of MCP XT for the commonly used parameters Notes Unspecified RAM locations in the following table are intended to be reserved or not used When using MODBUS RTU protocol the number of each Word in the table of next paragraph must be increased by 1 IF AND ONLY IF the MODBUS option was used see 2 1 4 9 2 1 Main RAM memory mapping Byte Word Description Comments HEX DEC 0002 00FF 1 127 Status or value of CH1 of input modules Each status or value takes 1 Word The input modules are 127 Note 1 0102 01FF 129 255 Status or value of CH2 of input modules Each status or value takes 1 Word The input modules are 127 Note 1 0202 02FF 257 383 Status or value of CH3 of input modules Each status or value takes 1 Word The input modules are 127 Note 1 0302 03FF 385 511 Status or value of CH4 of input modules Each status or value takes 1 Word The input modules are 127 Note 1 0402 04FF 513 639 Status or value of CH1 of output Each status or value takes
42. HEN RAMP1 140 PERC1 0 ENDIF IF Step 53 THEN RAMP1 140 PERC1 50 ENDIF IF Step 55 THEN RAMP1 150 PERC1 0 ENDIF Step Step tl IF Step gt 60 THEN Step 0 ENDIF ENDSCRIPT Of course other dimmer outputs may be inserted in the same script in order to realize a multi channel dynamic light game DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 29 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual 3 2 7 GOTO The GOTO instruction causes an unconditional jump to the line of the same script identified by a label The label used to identify the destination of a jump must be followed by symbol and placed on an empty line The label on the GOTO line instead must not be followed by the symbol see next example script 1 trigger 1 if RO 1 then goto ABC endif if RO 2 then goto DEF endif R10 0 exit ABC R10 101 exit DEF R10 237 exit endscript 3 2 8 SUBROUTINES and FUNCTIONS A Subroutine or a Function is a sequence of instructions that can be executed many times by one or more scripts The instructions in a subroutine must be surrounded by SUB and ENSUB keywords All the subroutines of a program optionally may be contained in an single script in this case the script containing the subroutine does not need the TRIGGER instruction but only if the same script contains only subroutines The definition of a subr
43. L IM DUS oes em 70 11 4 2 PHYSICAL OUTDUTS cod 71 11 ES ER RR 72 M MH 74 114 5 CoUnt rs Vannes Aga reda ao ERES So NER e EE Sue 76 DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 3 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual A1 CHANGES MADE TO THIS MANUAL IN RESPECT TO THE PREVIOUS RELEASE Par 2 1 7 Added details about azimuth and elevation of the sun Par 2 1 8 Added instruction for the publishing on the bus of virtual points and registers noe A2 RECOMMENDATIONS WARNING this manual applies to MCP XT with the following firmwares Main microcontroller 3 5 or higher Secondary microcontroller 2 3 or higher The features described in this manual require the program MCP IDE release 3 0 6 or higher This manual assumes that the user have an adequate knowledge about the EONTATTO bus system Correct disposal of this product Waste Electrical amp 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 disposa
44. Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 1201 1202 1205 1204 1205 zoe 1207 1208 aos 1210 12 1212 1zss vzsa vss faro Bito vreo vres veor verr vesa veis vees ves veor vors vozo vos voor vorr voes vios 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 Bito v1025 v1041 v1057 Vio73 1 89 vit0s v1121 vits7 159 vrteo 186 1201 v1217 v1233 1249 1205 Bit v1026 V1042 V1058 v1074 90 6 v1122 vitae 154 viise 1202 v1218 v1234 v1250 1286 Bit2 v1027 v1043 V1059 vio7s v1091 VIO V1123 1139 vitss v1171 viter V1203 v1219 V1235 v1251 vi267 Bit3 v1028 vioaa V1O6O viore v1092 vitos V1124 v1140 viise v1172 vires V1204 v1220 v1236 v1282 268 Bit4 v1029 vioas V1061 vio77 V1093 v1109 v1125 vinai Vi57 vrir viso VI205 v1221 VI237 V1253 v1269 Bits v1030 V1046 V1062 1078 VtO94 v1110 v1126 v1142 158 v1174 V1190 1206 V1222 v1238 VizTO Vt256 i233 1234 1005 1296 1237 1238 1239 1240 aei 1292 vzas 1244 145 1216 247 visis DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 73 of
45. MCP IDE in order to debug it before the writing into MCP XT FLASH memory gt MCP MAP is an advanced tool allowing to access to the heart of MCP XT the use of this tool is reserved to expert user only gt BootdsPIC is an utility to upgrade the firmware of the main microcontroller inside MCP XT gt BootPIC is an utility to upgrade the firmware of the secondary microcontroller inside MCP XT The ease of use of MCP IDE and its many features and utilities allow quick development and configuration of MCP XT controller according to the requirements of the plant where it will be installed The intuitive operation and the clear menu items allow to start using MCP IDE immediately allowing to save more time in developing applications and requiring less time reading user manuals 10 2 MCP IDE MCP IDE looks like the following figure MCPIDE UNTITLED EQU File Edit View Preferences Compiling Communication Programming Supervisor Help iL c2 id 3a dA 88 RE HR ES 6 7 OD rs Equations Macros Scripts Configuration Resources Decompiling 14 58 INS Line 1 0 262144 Bytes DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 51 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual DUEMMEGI The main window of the program has 6 TABs Workspaces Equations Macros Scripts Configuration Resources and Decompiling Each button on the but
46. O16 A017 247 R12 1245 V100 1 N V1 V16 1 N V17 V32 R12 means that R12 maintains the value before the power down RAM has a battery for back up AO16 A017 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 A017 4 247 2 1 3 Status of fault input modules The status assumed by MCP XT for a failed input module if not specified MCP XT assumes the last available value FAIL 11 1 1 I1 3 2 0 I5 2 1 15 2 15 1 AI15 2 2000 AI12 1 0x1234 Page 6 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 2 1 4 Communication Protocol Set the communication protocol to be used and the related serial port of MCP XT COM1 is the communication port on the front panel RS232 COM2 is the communication port on the terminal block RS485 and COM3 is the special port located under the terminal cover on the bottom left side to be connected by means of a flat cable e g WEBS module COMI FXPXT COM2 FXPXT MODBUS COM3 FXPXT The available options for the three COM ports are the following FXPT proprietary protocol always active even if not specified MODBUS MOD
47. ODBUS driver of the MASTER system Example 4 Write the value 157 into counter C22 remember that for the CONTATTO system the counter are numbered from 0 to 1023 Use the function 16 The address of the Word containing the value of the counter Cn is given by 3072 n see RAM map or the tables at the end of this manual or use WordFinder thus concerning the counter C22 the following parameters have to be passed to the MODBUS driver Start 3094 Number 1 Value 157 In this case the value 157 will be directly written into the Word 3094 Example 5 Set to 36 the minutes of the MCP XT timekeeper from the RAM map of MCP the Word related to the minutes is the 1921 the following parameters have to be passed to the MODBUS driver Start 1921 Number 1 Value 54 In this case the value 54 will be directly written into the Word 1921 The timekeeper will be updated with the new minutes value Note that the passed value is 54 decimal because the register of the minutes as for all registers related to the timekeeper parameters needs the BCD format in facts 36 in BCD format corresponds to 54 in decimal format Page 68 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 11 4 Tables for relationship Words Parameters of MCP XT The following tables allow to quickly find the number of the MODBUS Word containing the
48. Paste Module Into Group paste a module into the current group Exit quit the program Save Group As New Project Open Project Save Project Save Project As Add Module To Group Paste Module Into Group Exit The Tools menu allows the following functions Variables Simulator Windows Load All Module From MCP F5 Load All Modules From MCP create 3 groups Inputs Outputs and Mixed Modules Load Inputs From MCP create a group for all configured Input Modules Load Outputs From MCP create a group for all configured Output Modules Load Mixed Module from MCP create a group for all configured Mixed Modules Load Inputs From MCP Load Outputs From MCP Load Mixed Module From MCP Through these functions the module configured in MCP XT will be shown provided that MCP XT has been connected or the simulator has been activated see in the following As option it is possible to create customized groups including input and output modules and virtual points the procedure to create the groups will be now described The slider J on the button bar allows to change the polling period from PC to MCP XT if connected Moving the slider at left side the period is lower so the updating of the objects in the windows is fast Moving it at right side the period increase so the updating of the objects in the windows is slow 10 3 1 The Groups of MCP VISIO Select New Group from the Visio menu A new window will b
49. Seconds G0 J Dayofthemonth O Loo opos f 7 p 1 y Month fJ If the bit VIRT is 71 then the specified address is referred to a virtual point For virtual point Vn n Module Address 1 x 16 Point 1 SYS F 1 amp Module Address 0 amp STATUS 1 means BUS F SYS F 1 amp Module Address 0 amp STATUS 0 means BUS OK SYS F 1 amp Module Address lt gt 0 amp STATUS 1 means MOD F SYS F 1 amp Module Address lt gt 0 amp STATO 0 means MOD OK The symbol means not used Note 5 The list of analog events values or codes can store up to 1024 events and it is organized in blocks of 8 bytes for each event Each 8 byte block related to an event is coded as follows Bit7 Bite Bits Bit4 Bits Bit2 Bita Bito Module Address 12 Lue Ji e ww os ooo O cuc Channel 0 3 ee J e f a Day of the month d o d l o ee Mo k The symbol means not used Note 6 The area 0xE800 0xEB7F replies the containing of the microcontroller RAM memory at the address 0x0800 0x0B7F see next paragraph Note 7 The configuration map bytes 0xE800 0xE9FF contains the information related to the bus modules included in the polling cycle of MCP XT The information is organized in two bytes for each module with offset 2x Module Address as follows offset 0 Bytes 0xE800 0xE801
50. T and OUT goes OFF when AI gt T H lt OUT goes ON when AI lt T and OUT goes OFF when AI T H OUT goes ON when AI T and OUT goes OFF when AI gt T H or whenAI lt T H OUT goes OFF when AI T and OUT goes ON when AI gt T H or when AI lt T H This behavior is complementary to the previous case gt OUT goes ON when AI gt T and OUT goes OFF when AI lt T H gt OUT goes ON when AI gt T and OUT goes OFF when AI lt T H Threshold and Hysteresis must be in the range 0 to 65535 Other allowable operators AND amp and OR DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 15 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual Examples 01 1 AI1 gt 240 2 V2 AI1 40 AI2 30 V2 AI1 40 5 01 4 AI1 lt 128 amp AI1 gt 30 01 5 AI1 lt 600 amp R50 gt 30 01 1 AI1 gt R51 R52 amp AI1 lt 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 15 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
51. V or 60V resistive load MCP XT features a serial RS232 port a RS485 port and a dedicated port fully independent each one to the other Following figures show the proper connections to be made and the description of the terminals note that terminal 17 must be left unconnected Connections of MCP module 24V 24V0V L1 L2 P MCP XT ALARM CONTACT RS485 l DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 41 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual 5 2 Baud Rate selection Baud Rate factory settings for MCP XT controller both for RS232 and RS485 port is fixed to 115200 Baud if for any reasons this speed has to be changed the software tool MCP IDE is needed this software tool is provided together to MCP XT Connect MCP XT to the PC supply it and launch MCP IDE Select from the menu Communication Enable The following window will appear COMMUNICATION DRIVER FXP XT Ver 1 0 FW 34 23 Serial Port Port COM3 Baud Rate 115200 Interface Automatic Detection Time Out Advanced Options Address IP Connection C Use IP Address 182 168 1 100 1001 Close Select the port e g COM1 or press the button Detect to execute the automatic search of MCP XT Press then Options button the following window will appear MCP SERIAL SETTING 5232 Baud Rate Wait Time msec 115200 10
52. XP XT COMMUNICATION PROTOCOL 9 1 Messages format ad meaning The proprietary protocol implemented into MCP XT is named FXP XT protocol this protocol has been specifically developed to interface MCP XT to external world PC PLC etc and it is NRZ with 1 start bit 8 data bit no parity 1 stop bit The baud rate can be selected as follows 2400 4800 9600 19200 38400 57600 115200 baud MCP acts as a slave unit then it only answers to the requests of a HOST device In the following the numerical data represented with the 0x notation are intended to be in the hexadecimal format The messages between MCP XT and HOST have the following format Where e Address 1 byte node address of MCP XT the address 0x00 is valid for any node address e Code 1 byte it specifies the function of the message Byte 1 byte number of bytes in the following data field e Data 1 N N data bytes ChkSum 2 bytes high low checksum equal to the complemented sum of the message bytes including the address the code and the number of bytes The available messages are HOST to MCP requests Data Bytes Ox7F 4 Add U Add H Add L N Reading from RAM memory of N bytes 12255 starting from address specified by the first 3 data bytes means reading of 256 bytes Ox7E 5 256 Add U Add H Add L N Data1 Writing to RAM memory of N bytes 1 252 DataN starting from address specified by the first 3 data bytes Note 1 Ox7D 4
53. XT will answer with 2 bytes containing the status of the output points of module 25 according to the binary code 1 out ON 0 OFF The less significant bit of the lower byte is related to the output point 1 the most significant bit is related to the output point 8 the higher byte will be in this case always 0x00 zero Page 62 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 11 3 2 Function 2 Reading the digital input status The MODBUS function 2 allows to read the input status the following parameters has to be specified a start point Start this value must be multiple of 16 This value identifies the number of the digital input starting from 16 and arranged by channel as follows Input Number of the input The general formula is said Add the address of the real module of CONTATTO system starting from which the status of the inputs has to be read and CH the channel then the value of Start will be Add x 16 2048 x CH 1 Allowed values from 0 to 8176 how many input points have to be read Number in practice how many modules having consecutive address have to be read To avoid confusion this value is suggested to be multiple of 16 and equal to the number of modules to be read multiplied by 16 Allowed values from 16 to 8176
54. a aoa ara Coo 265 275 205 295 sos ais scs sas sds sss oes S5 Channel 4 ooo oro o20 oso oao oso oso oro oso oso foo 170 326 B on aoe ave ara ae ae ase an ara aoe a se oor aes sos ts 425 435 4s ass aes ers 485 295 sos o2 see so 206 216 426 436 446 456 465 406 406 506 Coos 587 sey 207 wr a27 487 sar sr 267 arr 4er 297 sor one ses 3os 208 sis 428 a38 448 ase 268 478 288 408 508 ons sso 399 40 419 420 a39 49 aso 406 aro a89 aoo 509 Coos sso 200 410 420 430 440 450 460 470 aso 490 soo 510 Coos 392 202 ara 422 432 aaa ase 262 a72 ama e s02 oos sss 40 ara 423 aaa 443 ss 463 473 amo 203 508 Page 70 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 11 4 2 Physical outputs Channel 1 000 oro 020 oso oao oso 060 oro oso 090 100 140 120 oo 522 532 se ss sez 572 Sez so ena 612 622 632 Poor 513 ses sss ses sss 503 rs ses sos 603 613 2s 653 002 514 524 534 saa 554 s64 57a sea soa Go 614 624 694 Loos sts s
55. a60 470 000 2368 2378 2388 2398 2408 2418 2428 2438 2448 2466 2468 2478 2488 2400 Foot 2369 2379 2389 2399 2209 2419 2429 2439 2449 2459 2409 2479 2489 249 Coos 2377 2387 2397 2407 2417 2427 2437 2447 2457 eer 2477 2287 Fone 2532 2542 2552 2562 2572 2582 2592 2602 2612 2622 2632 2642 00s 2533 2543 2555 2563 2573 2583 2593 2603 2613 2623 2638 2645 oos 2534 2544 2554 2560 2574 2584 2504 2604 2614 2624 2634 2644 2646 os 2537 2547 2557 2567 2577 2507 2507 2607 2017 2627 aesr 2647 2657 2667 ezo sso zoo rto 720 aw 750 760 2719 2909 2720 2 2796 2806 281 2757 2817 DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 75 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual R soo er e2 s30 sax sso seo sro s amp o 890 soo 9 0 020 930 940 000 2848 2858 2868 2678 2808 2898 2905 2018 2928 2038 2048 2958 2966 ore 2988 2000 001 2649 2859 2869 2679 2860 2809 2909 2019 2029 2039 2049 oso 2060 2079 004 2652 2862 2872 2862 2892 2002 2912 sez 2932 2942 2952 2962 297 os 2053 2863 2873 2883 2893 2003 2913 2023 2033 2043 2955 2963 297
56. ameter is a numerical constant value R100 CALCULATE R10 R11 function to which 2 parameters are passed and which will m return a value copied in R100 The parameter R11 will be passed as reference therefore the function can change the value of the parameter itself sub CALCULATE REG1 REG2 R10 on the contrary will be passed as value therefore the Pues function cannot change the original value contained in the endsub parameter itself Notes gt a Subroutine or a Function when called by a script other than the script where the function was included must be placed before the calling itself gt ifa subroutine uses local variables these ones must be declared inside the subroutine itself gt a Subroutine can call another Subroutine for a max total of 16 nested calls For the subroutines and the functions without parameters the following points must be taken in account 1 if a subroutine or a function does not require input parameters it must be however declared using the parenthesis without the parameters list for instance sub TEMPERATURE 2 the calls to subroutines or functions without parameters can be written with or without parenthesis for instance the following calls are exactly equivalent RO TEMPERATURE RO TEMPERATURE call TEMPERATURE call TEMPERATURE DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 31 of 78 Tel 02 57300377 Fax 02 55213686 www duemmeg
57. and SUNSET parameters LOCALIZE LONGITUDE 8 8638 5 3036 a a where DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 7 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual LONGITUDE allowed values in the range 180 0000 to 180 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 mea
58. as sas ss sss ses 57s ses sos cos 615 625 655 Foe 516 526 sae sc sse ses 57e sas 506 cos 616 626 636 Coos 517 sar 537 se ssr 567 577 sez ser eov 617 ezr 6s7 oos ste sas sas ses sse ses sre see sos coo 618 28 696 ooz sre 520 sse 549 sse ses 579 seo 599 coo 619 ze 639 ove 520 530 s40 seo seo sro 580 seo eo ero 620 e30 Coos 521 s se 551 ser sri sei sev 601 oi ez oxi Channel 2 000 oro 020 oso oao oso oco oro oso ooo 100 170 120 o0 e0 seo 670 seo 6eo 700 710 720 730 720 750 760 Poor ss esr s61 err ser 601 zor rt 721 731 rat 751 or F002 622 65 sez ez sez 692 oe ri 722 732 742 750 702 ons 623 65 ses 673 ses Ges os rts 723 733 743 759 763 ooa 624 asa se Gra sea 694 voa t4 724 vaa 754 764 oos 625 65s ses ers ses 695 os ris 725 735 745 755 765 ooe 646 ese se ere see 698 os rte 726 rae 746 756 766 oos 628 ess see ere see cos 708 rte 728 738 728 758 Coos 629 659 sce 679 seo 699 709 719 720 739 4s 75 Channel 3 ooo oro 020 oso oao oso oco ozo oso ooo 1
59. b endscript Example The following script shows how the RET instruction allows to exit from the subroutine it is like a GOTO to the instruction ENDSUB This script converts to Celsius degrees the analog value read from a MODNTC and it places the result in the register R1 in addition it switches ON the output 01 1 if the result is in the range 18 to 23 degrees otherwise it switches OFF the output Page 32 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO script 1 trigger 5 define NTC1 AI100 1 R1 CONVERT NTC1 exit sub CONVERT TEMPER CONVERT TEMPER 2730 CONVERT CONVERT 10 if CONVERT gt 23 then 01 1 0 ret endif if CONVERT lt 18 then 01 1 0 ret endif 1 1 endsub endscript 3 2 9 BIT x The parameter passed to a subroutine or function and the optional returned value are for default integer 16 bit numbers If a bit must be passed to a function or if the returned parameter must be a bit then it must be explicitly declared by the BIT x keyword BIT x declares that parameter x of a subroutine or function or the returned value is a bit the declaration BIT x must be used in subroutines or functions only The declaration BIT X must be placed in the subroutine declaration ONLY The following script uses a function having as input parameters a value REG and a bit ENA
60. cause if the answer of the two modules is exactly superimposed each one to the other then MCP XT cannot detect the anomaly During the firmware update of the main microcontroller inside MCP XT the two red LEDs flash alternately while during the firmware update of the secondary microcontroller the two green LEDs flash alternately Two pairs of LEDs red and yellow on the front panel of MCP XT allows to monitor the activity if any on the two serial ports RS232 and RS485 The following table resumes the signaling in the various operating status Flash at the Normal Periodic blinking Occurrence of a Fixed OFF Fixed OFF Energized change on an input module Flash at the Module failure Periodic blinking Occurrence of a Fixed OFF Fixed ON De energized change on an input module Double address Periodic blinking ON for long time Fixed OFF FkedoFF FhedoFF Fixed ON Fixed OFF FLASH not programmed Simultaneous periodic blinking Fixed ON Fixed ON Update of main microc or MN ae FW not valid Simultaneous periodic blinking Alternate blinking De energized Update of secondary microc ces Note The frequency of periodic blinking of POLL may be so high that LED seems to be fixed ON X 7 don t care Page 44 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 7 TECHNICAL CHARACTERISTICS Automatic change of sta
61. ce a change from 0 to 287 will be registered a change from 287 to 584 will be registered a change from 584 to 321 will be registered a change from 321 to 0 will NOT be registered unless not expressly declared o This function is useful for instance to record the codes of the transponders controlling an access to a building In the LOG block can be specified both real input addresses specifying the channel if any and registers Each value change will be stored together to Day Month Hours Minutes Seconds Up to 1024 16 bit values or codes can be stored in the RAM of MCP XT since the section of the RAM where these events are recorded has the battery back up feature the values remain stored even if the main supply voltage fails at least until the battery does not reach the minimum retaining voltage of the memory Keyword LOG Create the value list fixed buffer when the buffer is full it does not accept any other value in this way the list contains the first 1024 value from the last cleaning of the buffer LOGC Create the value list circular buffer when the buffer is full it overwrites the old values in this way the list contains the last 1024 values Option ZERO Declare that for the related input or register also changes from any value to zero has to be recorded No more than 1 LOG block can be declared in the same MCP XT module If the buffer is full case LOG or the old events have been overwritten case
62. conds the cycle will be repeated from the beginning 100 90 80 70 60 The SCRIPT will be executed one time per second First of all the script declares one local variable Step and 2 parameters two times A01 the reason of this double definition will be explained in the following The variable Step represents the amount of seconds elapsed from the beginning of the dynamic light game At the output from the script the value of Step will be increased by 1 if the result of this increment is 2 60 then Step will be re initialized to zero When the Step value equals one of the moments when the light brightness must be changed the two instructions RAMP1 K and PERC1 Z will be executed the effect of this instructions that are identical to A01 K and is to transfer to the output A01 the specified values in the same order they were written The first value to send to output will be the ramp value the second one will be the wanted percentage The use of two different definition for the same output A01 is only to make the script more readable and intuitive For the correspondence between the code and the ramp value see the MOD2DM technical sheet SCRIPT 1 TRIGGER 1 var Step define RAMP1 AO1 define PERC1 AO1 IF Step THEN RAMP1 150 PERC1 100 ENDIF IF Step 15 THEN RAMP1 160 PERC1 50 ENDIF IF Step 30 THEN RAMP1 150 PERC1 0 ENDIF IF Step 40 THEN RAMP1 145 PERC1 80 ENDIF IF Step 50 T
63. contains after de compiling information about how the compiler has interpreted the written program x MCPIDE D Programmi MCPIDEW 305 Example equ File Edit View Preferences Compiling Communication Programming Supervisor Help Lez 3a 34A C Ao UL af GE OD Equations Scripts Configuration Resources Decompiling I1 I2 I3 I50 050 01 02 03 04 05 06 15 08 INS Line 1 595 262144 Bytes Page 54 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it DUEMMEGI MCP XT User s manual CONTATTO 10 2 1 MCP IDE The button 4 open the serial communication with MCP XT while the button closes it The window appearing at the communication opening is that shown here Once the communication has been enabled by the button Detect an information similar to FW 3 4 2 3 will be shown the first number on the left side is the FW version of the main microcontroller of MCP XT 3 4 in this example while the number on the right side is the FW version of the secondary microcontroller 2 3 in COMMUNICATION DRIVER this example The label FXP XT Ver 1 0 in the shown window is the version of the communication driver included in the MCP IDE Serial Port package Port COM3 The Time Out is the maximum time that MCP IDE wait for an Baud Rate 115200 answer
64. dress of the Word into the RAM starting from which the registers have to be read Allowed values from 1 to 30143 in hexadecimal from 0x0001 to Ox75BF how many Words have to be read Number allowed values from 1 to 125 MCP XT will answer with a number of Words equal to the specified Number that means a number of bytes equal to the double of the specified Number The MODBUS function 3 can be used to read the status of the real inputs and outputs the status of virtual points the content of counters etc in practice any information mapped into the MCP XT RAM can be required included the current date and time of the internal timekeeper Example 1 Read the output status of module 25 for instance a MOD8R alternatively to function 1 the function 3 can be used The location of the Word in the RAM containing the status of the output module i channel 1 is i 512 therefore concerning the module 25 the following parameters will be passed to MODBUS driver Start 537 Number 1 MCP XT will answer with a Word whose most significant byte is zero and the less significant byte is contains the status of the output points of module 25 in binary code 1 out ON 0 out OFF The less significant bit is related to the output point 1 the most significant bit is related to output point 8 Example 2 Read the input status of module 43 for instance a MODSI A alternatively to function 2 the function 3 can be used The location of the Word in t
65. e vira vieo vzo vz22 vase vas Bia vis vor var ves vo wes vi vier viss vise virs vior voor vzs vase vas Criss a170 a71 72 aaa 387a vars save 77 ave aaro 1189 3381 1182 5 5586 Cito vas vars vase vaos voa vosr vass vase vess vao varr vass vass vass vaer ver Bita vase vara vaso vane voza vase vase varo woes vaoz vare vasa vaso vase vaez vase mira vase vars vasr vaor voza vase vass var vaer vaos vere vass vast vaer vaes vas sita vaso vare vasz vans veas vaso vase vara voee vaoa vazo vase vasz vase vaea vs00 mita vas varr vass vaoo veas veer vasr vara veso vaos vaar_ vasa vaso vaes vor Bits voz vare varo veas voaz vase vara veso vaoe vazz vase vasa varo vaes vs02 Bite vss vare vass var vezr vass vaso vars vor vaor vaza vaso vass var vaer vs0s Bito vae vaez vase vase voso vaas vane vare voa varo veas vaaz vase vara vao0 vss Fait vzse v24 va00 vars vase vaas vaea vaso woes varz vaze vase vaco vare vaez vs0e Criss 1186 1187 1186 1188 1190 1191 1192 1193 1194 vios 1196 1197 1198 1790 Page 72 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via
66. e 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 XT the time needed for a full cycle will result increased from 80 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 XT controllers when the number of nodes is less than the allowed maximum value 2 2 Event triggered Equations 2 2 1 Logic equations Operators amp AND OR NOT XOR XOR is evaluated by the compiler as follows A B A amp B A amp 010 3 11 1 02 5 11 1 11 2 V6 14 3 18 2 amp V4 01 6 V100 amp 11 7 01 6 I1 3 amp I1 7 01 1 12 1 amp 14 3 12 4 08 1 V7 143 2 2 2 2 SET RESET equations Operators S SET on the edge SP SET priority on the edge SL SET on the level SPL SET priority and on the level R RESET on the edge RP RESET priority on the edge RL RESET on the level RPL RESET priority on the level Page 12 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 01 1 SI1 1 amp RI1 2 Set Reset edge triggered 01 1 SI1 1 amp RI1 2 Set Reset edge triggered 01 1 SI1 1 amp RLI1 2 Reset on the
67. e opened as in the following figure New Group The input and output modules and the virtual points can be included in this window as desired Press the a button to i add a module The following window will appear DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 57 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it E DEHTHTIL MCP XT User s manual DUEMMEGI ADD MODULE Digital Inputs Analog Inputs Dedicated O MOANA CLIMA ARCS C MOD32144 4 CLIMA2 MODHT MODINP2 A MI420 MODCNT MODTPD MODINP2 C O MM20s4 MODGSM I Il MODCL MOD4UI A O MOD4AMI12 DISPBUS MODCA MOD4I S MOD2PT MODIR MODMETEO MODWRX MODNTC MODAIT MODANA MODLUX MODSUN MODGSM MODLC Digital Outputs Analog Outputs Cards Others MOAN U SCODAC VIRTUAL MODPNP m0420 scoo08 MODREL MODDMX 500184 MODDI sc0204 Digital Mixed 1 0 Analog Mixed 1 0 SC1204 MOD445 MOD2DM SC1404 MOD4 4R MOD2DV 502404 MOD2 2R MOD4DV 503404 MOD44 MODDALI 501800 MODSIL SC2800 Input Address Output Address Select one of the listed modules and specify the address in the related text box for mixed and some special modules both input and output address has to be specified To insert a virtual module made by 8 points assigned in any order selec
68. e 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 DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 11 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual 2 1 12 Number of nodes in a MCP XT network In a network made as described in the previous paragraph up to 32 MCP XT 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 XT at a time can access the RS485 communication line 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 XT 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 80 milliseconds in the case of 2 MCP XT to a maximum of 1 second in the case of 32 MCP XT If the number of nodes has not been specified by th
69. ed The script defines a variable in this example its name is ptr that at the beginning is equal to the Word number of register RO The notation ptr inside square brackets returns the content of the pointed register In the following script the R15 value will be increased by 1 every time the content of each register addressed in the loop is other than zero At each iteration the value of the pointer will be increased by 1 in order to point to the next Word and therefore to the next register The notation ptr 1 is equivalent to ptr ptr 1 as R15 R15 1 can be written as R15 1 When the pointer become greater than the address of R10 the loop will be interrupted and the script ends script 1 trigger 2 var ptr ptr WORD R0 R15 2 0 LOOP if ptr lt WORD R10 then if ptr lt gt 0 then R15 R15 1 endif ptr 1 goto LOOP endif endscript Another example the day of the month is located in the Word 1924 see RAM map to copy this value and therefore the containing of the Word 1924 to register R2 the following instruction can be written ptr 1924 R2 ptr On the contrary it is possible to copy the containing of R2 in the Word 1924 as follows ptr 1924 ptr R2 The pointer are useful when the Word to be accessed to both for reading and writing cannot be identified in other ways in other words when it cannot be identified by notations as Cx Ry etc DUEMMEGI s r l Via Longhena 4
70. ed including the comments on the contrary the whole FLASH contents will be downloaded to the PC This last procedure v Source Only requires many time and it is needed for specific reasons only e g diagnostic DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 55 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual DUEMMEGI 10 3 MCP VISIO MCP VISIO looks like the following figure MCPVisio McP xT 22 Each button on the button bar shows the description of its function simply placing the mouse cursor on the button itself The majority of the buttons and menu items are so intuitive that no more explanations are needed The button open the serial communication with MCP XT while the button closes it Note since the communication driver it the same for all the software package if the serial communication has been opened from MCP IDE then the communication results to be opened in MCP VISIO too and vice versa The buttons eae ee to display respectively the window of Clock virtual points registers counters timers and events both digital and analog ones SP The reading setting window opened by the button looks like in the 14 42 30 figure on this right side The clock panel shows Hours Minutes Seconds on p the first line Day Month Year on the second one and the Day of the Week on t
71. ed 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 XT or the modules connected to it can be transferred Each MCP XT 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 VVVV DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 9 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual 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 2125 As said before the data exchange feature among more MCP XT 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 NETWORK Vstart Vstop 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 fo
72. ember 2011 Page 17 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP User s manual SEND4 5 I1 1 B001 I1 2 B002 v354 B003 I14 7 B006 VA50 B129 SENDR123 2 15 8 B001 V100 B002 V101 B003 v470 B004 19480 B005 a a a a Note commas are mandatory symbols 2 2 9 Equations for recording status changes EVENT This function allows to store in chronological order the status change of the real input points and of the virtual points that have been specified in the EVENT block Each status change will be stored together to Day Month Hour Minutes Seconds The EVENT function allows to specify if MCP XT has to store the OFF ON or the ON OFF status change or both The EVENT function will also automatically register the so called system events that are the failure and the restoring of any module and of the bus the doubled address events will be automatically registered too Up to 2048 events can be stored in the RAM The section of the RAM where these events are stored has the battery back up feature therefore the events remain stored even if the main supply voltage fails at least until the battery does not reach the minimum retaining voltage of the memory Keyword EVENT Create the event list fixed buffer when the buffer is full it does not accept any other event in this way the list contains the first 2048 events from the last cleaning of t
73. er of the MASTER system therefore refer to the user s manual of the same system The following notations unless otherwise specified have to be intended in decimal format 11 3 1 Function 1 Reading the digital output status The MODBUS function 1 allows to read the output status the following parameters must be specified e a start point Start this value must be multiple of 16 This value identifies the number of the digital output normally called coil starting from 16 and arranged by channel as follows Number of the output coil Output The general formula is said Add the address of the real module of system starting from which the status of the outputs has to be read and CH the channel then the value of Start will be Add x 16 2048 x CH 1 Allowed values from 0 to 8176 how many output points have to be read Number in practice how many modules having consecutive address have to be read To avoid confusion this value is suggested to be multiple of 16 and equal to the number of modules to be read multiplied by 16 Allowed values from 16 to 8176 MCP XT will answer with a number of bytes equal to Number divided by 8 Example Read the output status of module 25 for instance a MOD8R that as known features 8 output points and a single channel 1 The parameters to be passed to MODBUS driver are Start 400 Number 16 MCP
74. essor 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 XT and other programs allowing specific function 1 2 Main features of MCP XT 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 VVVVVV Special virtual points V2014 activated during times from sunrise to sunset V2013 reserved V2012 activated when a communication loss on COM2 RS485 occurs for a time longer than 5 seconds V2011 activated when a communication loss on COM1 RS232 occurs for a time longer 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 gt 500msec V2003 1sec period clock toggle its status every 0 5 seconds V2002 bus failure V2001 module failure 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 rea
75. eters VVVV WV The syntax allowing to specify these options is the following vx may be any allowed point Vx R gt 30 AR MIN MAX where e Rmeans 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 Page 14 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO If o
76. from MCP XT and Address is the address assigned to the MCP XT to be polled Take in account that specifying address zero the communication will take place regardless of Time Out 1000 the address assigned to MCP XT Address 0 i 3 E MCP IDE can also communicate directly with an Interface IP Connection Ethernet RS232 or Ethernet RS485 converter connected to C Use IP Address MCP XT In this case the communication can be enabled 192 168 1 100 1001 specifying the IP address of the converter and the port and then clicking in the Use IP Address check box In this way MCP IDE will send the messages on the Ethernet port of the PC where it has been installed and on RS232 port Through the LAN network the messages sent by MCP IDE will be received by the converter having the specified IP address converted in serial format and sent to the connected MCP XT The answer of this last one afterward will follow the reverse way 10 2 2 Program transferring MCPIDE WRITE IN MCP Pushing the button ale or selecting the Write to MCP menu item the window on this left side will be shown Push program to begin the transfer of current program to MCP XT Pushing the button or selecting Read from MCP the reversed process will start the window will on this left side appear MCPIDE READ DA MCP Enabling the Source Only option the source program will be transferred 0 as it has been creat
77. ggered 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 vi ENDSCRIPT The following script SCRIPT 3 will be executed at every change ON to OFF of V1 SCRIPT 3 TRIGGER vi ENDSCRIPT The following script SCRIPT 4 will be executed at every change OFF to ON of 12 1 SCRIPT 4 TRIGGER 12 1 ENDSCRIPT DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 25 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual 3 2 2 VAR GLOBAL VAR and EXTERN VAR The scripts allow to use how many variables are required for the execution of the program The variables used in the scripts must be explicitly declared Essentially the variables can be grouped in two classes gt Local these variables will not be shared among the several scripts therefore two variables having the same name but declared in two different scripts will be separately handled a local variable is created at the input of the script and destroyed at the output of the same script gt Global these variables are sha
78. ghena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 2 2 7 Equations for mathematical and logic calculation Allowed MATH and LOGIC operators Function amp AND OR XOR Preset options P Preset on the edge load the specified value at the edge of the control input PL Preset on the level load the specified value and lock the result to that value Notes Preset on the level is always a priority control in respect to any other calculation involved in the equation and in respect to a Preset on the edge If more Preset on the level are specified in the same equation the higher priority is assigned to from left to right side in the equation When a Preset on the level is activated the calculation is locked to the value loaded by the Preset control itself If the Preset is on the edge the result of the equation will be the same loaded by the Preset control itself until a new variation occur in the terms involved in the equation Each terms involved in a calculation equation is 16 bit number the partial results are evaluated as 32 bit number but the final result will be truncated to the less significant 16 bits With the exception of what already said for the Preset control there is no priority in the calculation of a MATH LOGIC equation this will be evaluated in the same sequence as the equation was written from left to right side No parenthesi
79. gned to each module the white band on the lower side or to change the address the white band on the upper side MODPNP Page 58 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it DUEMMEGI MCP XT User s manual CONTATTO The color of the module symbols included in the groups can be GREY that module was not configured in the current program RED the module does not answer to MCP XT YELLOW two or more modules have the same address The 4 buttons amp A EE in the group window allow to change the graphic mode The first two modes will zoom in and zoom out 4 zoom levels are available The other two buttons act on the labels showing or hiding them respectively EA ESEA EE The names of each input and output point were assigned in the i same way described before double click on the label on the right Zone 1 Enable CM side of each LED Zona 3 Enable Zone 4 Enable Open Window The figure on this right side shows Doorlock Window Lock open Dect the option related to the graphical mode without labels and applied zoom level 3 Global Enable M To remove a real or virtual module from a group click on any area of the module itself while holding down the Alt button on the keyboard a confirmation will be required before the deleting It is also possible to Copy and Paste a module in the same group or from a
80. hange the value of the local variable created to receive the parameter but it will not change the parameter passed at the calling Page 30 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO The syntax used to specify what method must be applied to each passed parameter is the following SUB NAMESUB PAR1 PAR2 PAR3 PAR4 Where gt PAR1 and PAR2 are parameters passed as value gt PAR3 and PARA are parameters passed as reference being surrounded by square brackets To specify that a parameter must be interpreted as reference is thus necessary an enough to surround the related parameter by square brackets in the line defining the subroutine and only in that line Note parameters of bit type e g V1 O3 2 14 3 etc cannot be passed as reference these parameters can be passed as value only The following two examples show each one a calling to subroutine with parameters call SETUP RO A01 128 calling to subroutine to which 3 parameters are passed there seas des is not a value returned by the subroutine The parameter A01 will be passed as reference therefore the subroutine can change the value of the parameter itself sub SETUP REG OUT K RO on the contrary will be passed as value therefore the subroutine cannot change the original value contained in the endsub parameter itself Last par
81. he buffer EVENTC Create the event list circular buffer when the buffer is full it overwrites the old events in this way the list contains the last 2048 events No more than 1 EVENT block can be declared in the same MCP XT module If the buffer is full case EVENT or the old events have been overwritten case EVENTC then the virtual point V2008 will be activated to report this occurrence EVENTC Inizio blocco il buffer circolare V1 ON N Evento 1 alla transizione 0 1 di v1 V2 OFF Evento 2 alla transizione 1 0 di v2 13 7 ON OFF Evento 3 ad entrambe le transizioni 0 1 e 1 0 di I3 7 Note commas are mandatory symbols Page 18 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 2 2 10 Equations for recording value changes LOG This function allows to store in chronological order the change of the value returned by input modules or registers that have been specified in the LOG block Change in the value means exclusively a change from any value to another one on condition that the new value is not zero unless this has not been expressly declared in other words any change from zero to any other value or from any value to another one but not zero will be registered while a change from any value to zero will not be registered unless not expressly declared in the LOG block For instan
82. he Equations workspace allows writing the standard equation of MCP XT MCPIDE D Programmi MCPIDEW 305 Example equ File Edit View Preferences Compiling Communication Programming Supervisor Help LOG 28 CAS RR e 3f E OS 08 Zo Equations Scripts Configuration Resources Decompiling TI50 1 vi V2 A02 I1 V3 V4 A03 I1 x V5 V6 A04 I1 v7 V8 A05 I2 V10 A06 I2 V11 V12 15 06 INS Line 1 595 262144 Bytes The Macros workspace allows writing the Macro definitions MCPIDE D Programmi MCPIDEW 305 Example equ File Edit View Preferences Compiling Communication Programming Supervisor Help AIAJ Ae RA c a OS OB re Equations Macros Scripts Configuration Resources Decompiling DIMMER OUT UP DOWH X VP1 VP2 UP DOWN CX R 1 P 129 UP amp P 130 DOWN amp P 128 VP1 15 06 INS Line 1 595 262144 Bytes The Script workspace allows writing the Scripts wa MCPIDE D Programmi MCPIDEW 305 Example equ File Edit View Preferences Compiling Communication Programming Supervisor Help LZ ed amp 303 23 2 C Ao RU a OS 08 7 C001 Equations Macros Scripts Configuration Resources Decompiling script 1 trigger 10 if RO gt 18 050 1 else 050 1 endif endscript 15 06 INS Line 1 595 262144 Bytes DUEMMEGI s r l Via Longhena 4
83. he RAM containing the status of the input module i channel 1 is i therefore concerning the module 43 the following parameters will be passed to MODBUS driver Start 43 Number 1 MCP XT will answer with a Word whose most significant byte is zero and the less significant byte is contains the status of the input points of module 43 in binary code 1 input ON O input OFF The less significant bit is related to the input point 1 the most significant bit is related to input point 8 Example 3 Read the input status of module 57 58 59 and 60 for instance all MOD8I A modules using the function 3 The following parameters will be passed to MODBUS driver Start 57 Number 4 MCP XT will answer with 4 Words 8 bytes each one having the most significant byte equal to zero and the less significant byte containing the status of the input points of modules 57 58 59 and 60 in binary code 1 input ON O input OFF The less significant bit is related to the input point 1 the most significant bit is related to input point 8 Page 64 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it DUEMMEGI MCP XT User s manual CONTATTO Example 4 Read the status of virtual point V328 using the function 3 The Word containing the status of virtual point Vx is given by 1153 INT x 1 16 Since a virtual point takes only one bit of the Word the bit number m
84. he 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 e 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 108 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 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 1 MAIN FEATURES 1 1 Required Hardware and Software tools To use MCP XT the software tools MCP IDE is required running on a PC WXP WVista W7 Minimum hardware required 800MHz proc
85. he logic and mathematical operations is always a 16 bit integer number If the result is a negative number then it will be in the two s complement format Page 26 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO The following script shows some examples about Logic and mathematical operations script 1 trigger 1 RO R1 R2 RO RO 10 AO1 R100 2 R50 R51 amp 0b1111111100000000 endscript An operation of the type VAR VAR op K where VAR is a variable K is a constant number and op is one of the described logic mathematical operators excluded the optional notation VAR 10 can be used For instance RO RO 10 and RO 10 are absolutely equivalent notations 3 2 4 IF THEN ELSE ENDIF The IF THEN ENDIF block allows to execute if the specified condition is true the instructions included between THEN and ENDIF If the condition is not true then the execution will jump to ENDIF or to ELSE if this has been specified ELSE is an optional keyword If ELSE has been specified then the instruction included between ELSE and will be executed Each IF block must be always closed by an ENDIF which is mandatory on the contrary to ELSE which is optional The condition of the block IF THEN ENDIF must be specified using the following comparison operators gt Greater than
86. he third line If the serial communication with MCP XT is opened the related current time 1 9 05 11 and date setting will be shown If on the contrary the serial communication with MCP XT is closed then a sequence of dashes will be shown The END eee E buttons and will increment and decrement the related item At every change in the setting using the buttons and the setting of MCP THU XT will be automatically updated The button PC transfers the date and time setting of the PC to MCP XT Page 56 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it DUEMMEGI MCP XT User s manual CONTATTO The button JD will show on the status bar on the bottom side of MCP VISIO window the firmware version of the connected MCP XT MCPVisio The Visio menu item allows the following operations New Group CTRL N Open Group CTRL 0 New Group open a new group see in the following a aie ave Group Open Group load a saved group from file Save Group save the current group to file Save Group As save the current group with different file name New Project open a new project see in the following Open Project load a saved project from file see in the following Save Project save the current project to file Save Project As save the current project with different file name Add module To Group add a module to the current group
87. i it CONTATTO MCP XT User s manual Example The following script converts to C the 4 analog values read from a MODNTC that are normally expressed as Kelvin degrees multiplied by 10 The result of the conversion is written to register from RO to R3 A function will be used because the mathematical operations to be executed have to be repeated for each channel The main script passes to the function the Address Channel information as value the result will be returned in the variable CONVERT Note that the instruction EXIT closes the script it is like a GOTO to the ENDSCRIPT instruction script 1 trigger 2 define AI1 1 define NTC2 AI1 2 define NTC3 AI1 3 define NTC4 AI1 4 RO CONVERT NTC1 R1 CONVERT NTC2 R2 CONVERT NTC3 R3 CONVERT NTC4 exit sub CONVERT TEMPER CONVERT TEMPER 2730 CONVERT CONVERT 10 endsub endscript The same result can be achieved also using the following script where the destination registers will be passed as reference and therefore the subroutine works directly on them Prefer however the version of the previous example for its efficiency for reasons going beyond the matter of this manual script 1 trigger 2 define AI1 1 define NTC2 AI1 2 define NTC3 AI1 3 define NTC4 AI1 4 call CONVERT NTC1 call CONVERT R1 NTC2 call CONVERT R2 NTC3 call CONVERT R3 NTC4 exit sub CONVERT REG TEMPER TEMPER TEMPER 2730 REG TEMPER 10 endsu
88. ic 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 FIELDtoRAM 020 3 020 4 AO1 AO2 3 021 1 1 021 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 XT controllers If more MCP XT 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 RS485 network using COM2 port and instruct each MCP XT belonging to this network to publish the data well specified by proper directives therefore non more components are needed in addition to the RS485 cable connecting the installed MCP XT controllers Moreover the data exchange mechanism here described also applies between MCP XT controllers and Domino DFCP controller allowing interactions between the two systems The information that can be publish
89. in the related paragraph To localize the input and output points virtual points registers etc refer to the external RAM memory described in a previous chapter or better refer to the tables listed in the following pages 11 2 Supported MODBUS functions MCP XT supports the following MODBUS functions 12 f Readiputtabe 1 11 O 3 Readregiters RAM memory 116 fpPresetsigleregster O 11 3 Example of MODBUS functions This paragraph shows some examples of MODBUS functions request and answer among the most used remember that MCP XT in a MODBUS system is always a SLAVE peripheral device that means it only answers to the requests of a MASTER device The following examples are useful to identify the MODBUS functions to be used when communicating with MCP XT the current MODBUS drivers implemented in many common devices PLC supervision software for PC videoterminals etc normally provide a development platform and a user interface which dramatically simplify the setting up in respect of the description that will be made in the following paragraphs In practice the setting up of the communication between the MASTER system and MCP XT will be reduced to the DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 61 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual configuration of the communication driver provided by the manufactur
90. ing to test and debug the MCP XT program or part of it The simulator is a fully software tool therefore no serial connection to MCP XT is required The simulator shows the behavior of the output parameters of a program e g real and virtual output points registers counters etc as result of some stimulus on input parameters To activate the simulator press the button or select the related menu item The control panel of the simulator will be shown as in the following figure MCP XT Simulator E Select File menu item to load the program to be simulated Ele the file must have extension BIN and it is automatically D NProgrammiNMCPIDENV 305NE xample BIN created by the compiling process of MCP IDE Once loaded the name of the file under simulation together its path will be shown in the control panel Pesat Aes Pressing the Run button the simulation will start When the simulation is running its possible to change values status of input modules virtual points and so on to do this simply click on the object to be changed For digital points input modules virtual points etc the left button of the mouse performs the switching on while the right button performs the switching off The Stop button stops the simulation while the Reset button restores all the parameters at their power up value this is similar to the power up of MCP XT The Reload button reloads the file shown in the control panel when changing anything in
91. iore te trate knee date ken se Paese nnne Eae kia e se PER Ee kae dp duda 45 8 OUTLINE DIMENSIGONS tetti stet te ente pnt nete nne te Eae e kinase e sued de PER Ee uin cu se e UE ununi 45 9 FXP XT COMMUNICATION PROTOQCOL sss eene e enhn hnnrnnr hne nitri 46 9 1 Messages format ad MEANING ccc cee ce cece cette eeeeeeeeeeeeeeeaaaeaeeaeeeeeeeeeeeeeeeeeeeeeeeteeeeeeeesaaaceeeeeeesaaeeeees 46 9 2 RAM memory Mapping ssie isunen a SER e eaa Ea ode a n dee E RAE e eraa 48 9 2 1 Main RAM memory nennen nnn ennn ennnen 48 9 2 2 Microcontroller RAM memory 50 10 MCP IDE INTEGRATED DEVELOPMENT ENVIRONMENT FOR APPLICATIONS USING MCP XT 51 10 1 Description of the software 8 8 6 51 euism 51 JOE edu Em 55 10 2 2 Program ede n cce rss ed 55 10 9 MCP VISIO cetero eon ae Cv ed nee cte Eod eo ede d endete adea Dude E
92. is is not allowed because it is a bit see paragraph SUBROUTINEs and FUNCTIONS This is a typical case requiring the BMASK x function Therefore the calling passes to the subroutine the address of the Word containing the virtual point WORD Vn and the mask allowing to identify in the Word the position of the bit related to that virtual point BMASK n To set the virtual point the subroutine executes the OR between the Word containing the point and the mask which as said contains only one bit set to 1 at the position of the bit related to the desired point To reset the virtual point the subroutine executes the AND between the Word containing the point and the complement of the mask which therefore will contain only one 0 at the position of the bit related to the desired point script 1 trigger 1 call TEST RO 50 WORD V49 BMASK 49 call TEST R1 100 WORD V50 BMASK 50 call TEST R2 150 WORD V51 BMASK 51 call TEST R3 200 WORD V52 BMASK 52 exit sub TEST REGIN KAPPA WVIRT MSK if REGIN gt KAPPA then WVIRT WVIRT MSK set virtual point else WVIRT WVIRT amp MSK reset virtual point endif endsub endscript The BMASK x function can be applied to any other bit parameter the following example is very similar to the previous one but on the contrary the subroutine switch ON and OFF real outputs instead of virtual points script 1 trigger 1 call TEST RO 50 WORD 01 5 BMASK 5
93. it
94. l 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 Safety 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 t
95. l 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 03 1 point 1 of output 3 channel 1 03 1 1 exactly as the previous one 03 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 03 1 1 04 2 16 all output points from O3 1 1 to O4 2 16 DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 5 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP User s manual Numbers 328 decimal number 0b0001010011111011 16 bit binary number 0b11110010 8 bit binary number 0x14FB 16 bit hexadecimal number Note the channel of an input or output module if not specified will be assumed 1 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 011 MOD4 4R I4 012 MOD2DM 113 114 013 O14 MOD2DM 115 I16 015 O16 2 1 2 Power ON status Specify the status or value assigned to outputs or registers at power up or at reset POWERON 03 1 1 03 1 2 1 N AO15 1 1000 N A
96. level out is locked OFF if 11 2 is activated 01 1 SPLI1 1 amp RLI1 2 Set Reset on the level but out is locked ON if 11 1 is activated since it is specified to be a priority command 01 5 12 3 amp RI2 1 amp SI4 6 12 3 is 8 consent 01 1 SI1 1 SI1 2 amp RI1 3 Parenthesis use out goes ON activating 11 1 or 11 2 01 1 SI1 1 amp RI1 2 amp RI1 3 Out goes OFF activating 11 2 or 11 3 O1 1 SLI1 1 amp SLI1 2 amp RI1 3 Out goes ON activating BOTH 11 1 and 11 2 2 2 3 TOGGLE equations Operators T TOGGLE on the edge S SET on the edge SP SET priority on the edge SL SET on the level SPL SET priority and on the level R RESET 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 16 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 DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 13 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual 2 2 4 COUNTER Equations Counter equation controls a digital output as function of the compa
97. m code This is the third and last step after having written and copiled the program The uploading is made by the proper menu item of MCP IDE utility trough the RS232 port of PC connected to the MCP XT serial port The program can be however transferred also through the RS485 port or through the LAN network using for instance the WEBS module in bridge mode The uploading of the program requires that MCP XT controller be supplied and connected to PC normally by means of the proper cable provided with MCP XT Page 40 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO 5 SETTING UP 5 1 Connections MCP XT module is available in DIN modular housing 6 modules size and it provides a 5 poles removable terminal block for the connection to the bus an internal relay allows the signaling of system failure module failure bus failure etc This relay is normally energized and it will be de energized when a failure occurs in this way the system anomaly warning will occur also at the failure of MCP XT module power supply The restoring of the relay is automatic because when the anomaly is removed it return to its normal state energized Due to the just described operating mode the optional fault indicator flasher siren or other has to be connected to the normally closed contact of the relay the contact rating is 1A 60
98. mmegi it the Word containing the status of output module 29 is the 541 therefore regarding the module 29 the following parameters have to be passed to the MODBUS driver Start 541 Number 1 normally in this case this parameter is not required by the driver Bit 2 Value 1 or ON it depends on the used driver Note the point 3 of an output module correspond to bit 2 of the Word because the real output points of the Enirimri system are numbered from 1 to 8 while the MODBUS driver works on the bits from 0 to 7 The execution of this function as described before implies that the MODBUS driver read the Word 541 using the function 3 then it changes the bit 2 to the read value and finally it sends the resulting value to the Word 541 using the function 16 This procedure normally is automatically executed by the MODBUS driver of the MASTER system PLC supervision software video terminal etc Example 2 Switch on all outputs of the output module 29 Use the function 16 The Word into MCP XT RAM related to output module 29 channel 1 is the 541 therefore the following parameters have to be passed to the MODBUS driver Start 541 Number 1 Value 255 In this case the value 255 will be directly written into the Word 541 In addition the MODBUS drivers allow to execute both mathematical and logical operations between the current value of the Word and a fixed value for instance an EXOR between the current value of an outpu
99. mory The function 6 allows to write a value into a single Word of the RAM memory of MCP XT that contains all information about the status of the system The function 16 is more used than the function 6 The following parameters have to be specified e Number this value is the Word address where the new value has to be written Allowed values for Number from 0 to 30143 in hexadecimal from 0x0000 to Ox75BF e Data the value to be written into the specified Word 11 3 7 Function 16 Writing multiple registers RAM memory The function 16 allows to write into the external RAM memory of MCP XT that contains all information about the status of the system This function together to function 3 is the most used The following parameters have to be specified e astarting point Start this value is the address of the RAM Word starting from which the new values have to be written Allowed values for Start from 0 to 30143 in hexadecimal from 0x0000 to Ox75BF The internal memory of the microcontroller MUST NOT BE MODIFIED how many registers have to be written Number in practice how many consecutive Words have to be written Allowed values from 1 to 125 the values to be written Data in the specified Words each data the amount is specified by Number must be made by 2 bytes 1 WORD The MODBUS drivers normally provide the possibility to write one or more whole Words useful for instance to change the content of a counter or
100. ndard daylight saving time Typical input to output reaction time Available serial ports Peripheral devices handling 24V 25 150mA 1A 3 60V 1A 60V resistive load 2 Yes 25msec FLASH type 2 Mbytes 128 Kbytes 2032 1024 16 bit each one 512 with times 0 to 6553 seconds resolution 0 1 sec 1024 16 bit each one Daily Weekly Yearly 127 addresses 4 channel for address 16 bit for channel 127 addresses 4 channel for address 16 bit for channel 1 x RS232 opto coupled 1 x RS485 opto coupled 1 x dedicated port Touch screen video terminals Bus display with alarm handling SCADA Supervision systems on PC Through MODBUS RTU protocol Modular box 6M for DIN rail mounting 5 50 C 20 70 C IP20 Warning MCP XT module contains a NiMH rechargeable battery remove this battery if throwing out the device The battery must be eliminated in a safe way according to current laws 8 OUTLINE DIMENSIONS A DONS B 11 B 1 12 34 5 7 8 9 r 4 m 5 L2 OQ O Reds TE See EONTATIO 1 o MCP Programmable Control Modula C Power supply 24V 25 150mA n 58mm DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it Rel 2 1 September 2011 Page 45 of 78 CONTATTO MCP User s manual 9 F
101. ne 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 1 gt 300 S 2 I1 1 amp S 1 11 2 Up counting step 2 Down counting step 1 V1 goes ON when counter is greater than 300 V1 30 50 S 1 I1 1 amp 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 gt 30 5 50 S 1 I1 1 amp S 1 I1 2 MIN and MAX the up counting is stopped to 50 and the down counting is stopped to 5 V1 3 5 1 S 1 I1 1 amp 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 R gt 100 S 1 11 1 amp S 1 11 2 Copy Counter to Reg the value of C10 is copied amp PL 0 1I1 3 to register R10 V10 z gt RO R1 R2 R3 S RA I1 1 Variable parameters amp P R4 1I1 3 2 2 5 THRESHOLD 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 lt lower than lt lower or equal to equal to not equal to gt greater than gt greater or equal to Options gt Hysteresis gt Variable parameters The Hysteresis has a different meaning depending on the comparison operator lt OUT goes ON when AI lt
102. nghena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO Quite all notations belonging to the equation syntax of MCP XT may be used in the scripts For instance the following notations are allowed IF AI1 2 gt 230 THEN 197 R54 1 1 IF I81 1 1 THEN 034 7 0 V7812 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 symbo 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 REI 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 XT program to have a script tri
103. not used offset 2 Bytes 0xE802 0xE803 input module 1 offset 4 Bytes 0xE804 0xE805 input module 2 offset 254 Bytes OxE8FE 0xE8FF input module 127 offset 256 Bytes 0xE900 0xE901 not used offset 258 Bytes 0xE902 0xE903 output module 1 offset 510 Bytes OxE9FD 0xE9FF output module 127 On the contrary of other cases the first byte that with even address must be interpreted as low byte of the Word and the second one that with odd address as high byte of the Word in other words the bits of each Word in this map must be interpreted as follows Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bitl BitO Bitl15 Bitl4 Bit13 Bitl12 Bitll 4510 Bit9 Bits DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 49 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual The meaning of the bits is the following Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit9 Bits Bit7 Bite Bits Bit4 Bit3 Bit2 Bit Bito Nr of chann Type of module Virtual point for module failure information bit15 14 Number of channels 0 3 means 124 bit 13 11 Type of module 0 No module 1 8 bit module 1st generation 2 16 bit module 1st generation 3 1 channel 16 bit module 2nd generation 4 multiple channels 16 bit module 2nd generation 3 bit 10 0 virtual point if needed for module failure information in the format Point Address Bit
104. ns 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 2 1 8 Publishing on the bus the status of virtual points and value of registers MCP XT 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 XT configuration SHARE SHARE Vx Vy Ray 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 RiandRj 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 XT program each SHARE 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
105. ntroller RAM memory mapping 0800 09FF Information about configured modules 2 bytes for each modules offset 2 x Module_ Address Note 7 of previous paragraph 1 byte for each modules offset Module_ Address Note 8 of previous paragraph MODCNT Note 9 of previous paragraph Page 50 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it DUEMMEGI MCP XT User s manual CONTATTO 10 MCP IDE INTEGRATED DEVELOPMENT ENVIRONMENT FOR APPLICATIONS USING MCP XT 10 1 Description of the software package MCP IDE is an Integrated Development Environment to support the program development for EOnTATTO MCP XT controller The MCP IDE package comes complete with an Editor Compiler Transfer utility Simulator and Supervisor of the operation status of MCP XT and of the plants The package is made by several tool programs as described in the following MCP IDE is the MCP XT program editor integrating the compiler the configuration tools for special modules e g ModTPD transponder reader module ModHT room controller for hotel applications and so on and the write to read from MCP XT utilities gt MCP VISIO is a tool allowing the supervision of input and output modules and all other MCP XT parameters counters registers virtual points etc This tool can work connected to MCP XT through the serial port or it can simulate the program written by
106. orted together in the same way terminals 2 and 5 signal B WARNING as for all RS485 networks radial connections must be avoided in addition RS485 line must be loaded both at the beginning and at the end by a 120 Ohm 1 2W resistor between terminals A and B The maximum number of device that can be connected on RS485 line must be limited to 32 5 4 WEBS communication port MCP XT features a special communication port COM3 under the terminal cover on the bottom left side see following figure for the connection to WEBS module providing both Web Server functions and bridge function to interface MCP XT to a LAN network Ethernet For more details refer to the technical sheet of WEBS module Supply _ o0 G0 16 n o sys SD DUEMMEGI MILANO ITALY POLL Q 24V g MEETS TX RX 2 O wso DUEMMEGI Web Server Module WEBS f MILANO ITALY Power supply 24V 32500 55mA Programmable Control Module DEVICE Power supply 24V 25 150mA DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 43 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual 6 DIAGNOSTICS 6 1 Diagnostics of LDITIFTID system through MCP XT MCP XT module provides the failure warning through two red LEDs on the front panel and a relay contact a
107. outine automatically causes the declaration of a global variable having the same name of the subroutine and that can be used to return a value typically the result of the function To call a subroutine the CALL instruction can be used or the function can called in a direct mode The following rule is always true gt Use CALL if the subroutine after the calling does not return any value gt Call directly the function if after the calling it must return a value At every calling of a Subroutine or Function one or more parameters can be passed as inputs both variables and constants specifying them inside round brackets The variable parameters can be passed as reference or as value The difference among the two cases is the following gt Parameters passed as reference the Word address of the parameter input output register etc will be copied to the related parameter of the subroutine and it will be used as pointer inside the subroutine itself In this way the parameter passed to the subroutine can be both read and modified by the subroutine gt Parameters passed as value the value of the parameter input output register constant etc will be copied to the related parameter of the subroutine and it will be used as variable inside the subroutine itself In this way the parameter passed to the subroutine can be read but cannot be modified by the subroutine An edit operation on that parameter inside the subroutine will c
108. quations for recording status changes 18 2 2 10 Equations for recording value changes LOO ssseeeeee 19 2 2 11 Management of the external counter modules 20 2 3 Time triggered Equations ssas cniris s dove de iesu bua eii ome aee ue HERB ena eene daas Re eaa BER ER Rae paren naa 20 2 3 1 Scheduler ei tae deese de eee vag appe e ERE PRX ES ee a deaur Br dia 20 Z 4 MAGCKO 22 ge SCRIP Ts ce 24 SA EESTI INIT losin ieee and ieee A etn cl Nin a enti chek ted aa 24 3 2 Keywords and Syntax gebe pa d ez NcE 25 3 2 1 Using the TRIGGER Eee Fe aetna 25 3 2 2 VAR GLOBAL VAR and EXTERN VAR sssesseeeeeeee eene nnne nne nnne nennen enne ens 26 3 2 3 Logic and Mathematical operations sssen emm 26 9 2 4 IF THEN ELSE ENDIF aiit rie E Dead danke tuse depre re dd dde dede 27 3 2 07 CARRY and ZERO tbc bad rt ELE e ee 28 22 0 DE FINE 28 DOO EE 30 3 2 8 SUBROUTINES and FUNCTIONSG sssssssssseeeenene rennen nennen nn nnne nnne 30 SA BUG DT 33 3 2 1
109. r to write the program the SCRIPT the configuration MACRO etc a compiler to allow the translation of an ASCII file containing the operating information in a binary file adequate to be transferred in the non volatile memory FLASH type of MCP XT module an section to transfer the program from the PC to MCP XT or vice versa MCP VISIO that is a graphical utility to display the status of the plant input and output modules counters virtual points registers etc a simulator to verify the written program or a part of it before to transfer it into MCP XT memory VV VWV The file containing the program is in ASCII format and must have the EQU or EXT extension for instance filename EQU where filename is the name of the program file and may be any name allowed by the WINDOWS syntax The EQU extension is mandatory because the following steps of MCP XT programming compiling and transferring require that the source file have that extension MCP XT controller programming takes place in a 3 sequential steps through the MCP IDE support building or editing of the filename EQU file containing the operating program in readable format ASCII compiling of filename EQU that is the conversion of the ASCII file in the related filename BIN written in a format ready to be transferred into MCP XT memory e uploading of filename BIN into MCP XT memory If some syntax errors are detected during the step 2 these ones will be repo
110. rce 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 XT belonging to the network will write in its memory the information published by the other MCP XT 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 XT for instance will be stored as R50 by all other MCP XT controllers For this reason of course the Words published by each MCP XT 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 It is also possible to publish non contiguous blocks of virtual points and registers specifying more NETWORK directives up to a maximum of 8 as total of V Words and R Words For instance the following directive may be enclosed in the same MCP XT NETWORK V1 V16 NETWORK V513 V576 NETWORK V1025 V1056 NETWORK RO 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 XT acquires the information published by the other components of the same ne
111. red among the scripts and therefore they can be used by all the scripts A global variable once created will be kept also at the exit of a script therefore each script always will read the last value that has been assigned to the variable itself The VAR instruction in a script defines a local variable and the GLOBAL VAR instruction defines a global variable Since all variables in a script must be declared the instruction EXTERN VAR informs a script that the variable has been declared in another script In the following example the variable TEMP1 is declared as local both for script 1 and for script 2 while the variable is shared by both script script 1 trigger 2 var TEMP1 global var TEMP2 endscript script 2 trigger 2 var TEMP1 extern var TEMP2 endscript The local variables used by a subroutine must be declared inside the subroutine itself not in the script containing it in other words if a local variable has been declared in a script the same variable cannot be accessible by a subroutine contained in the same script 3 2 3 Logic and Mathematical operations The scripts allow to execute the main logic and mathematical operations The allowed logic and mathematical operators are AND OR EXOR NOT Sum Subtract Multiply Divide Equal gt m IN No parenthesis are allowed in logic and mathematical operations and no more than one operation for each line is allowed Keep in mind that the result of t
112. rison 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 X 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 oneor 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 lt lower than lt lower or equal to equal to not equal to gt greater than gt greater or equal to Control operators S k Sum k to counter on the edge k range 32768 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 2 Priority Preset counter to z on the level z range 0 to 65535 H Lock the counter to the current value on the level Halt HP Priority Lock the counter to the current value on the level Halt All counters of MCPXT 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 param
113. rogram has a best and mnemonic readability About the using of the define directive in the SCRIPT refer to the related chapter DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 39 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP User s manual 4 2 Compiling the program The compiling is the second step of MCP XT programming process The file containing the program EQU extension must be compiled through the proper menu item of MCP IDE utility The compiler processes the written equations checks the syntax and the congruence warns the errors if any and links the data in a binary file which name is the same as the EQU file but with BIN extension The binary file is not in a printable format but it is adequate to be transferred in the MCP XT memory To write and compile a program it is not necessary to connect MCP XT controller to PC If during the compiling process one or more errors occur they will be displayed on the screen of the PC in a proper window and the program continues to check all other equations The compiler may also reports some WARNINGs this means that no errors have been detected but there are some points to be verified before to upload the program to MCP XT memory 4 3 Uploading the program to MCP XT memory Last step of MCP XT programming process is the uploading to its flash MEMORY of the binary file containing the system configuration and the progra
114. rted by the compiler together to some information about the error type and the line number where the error occurs 4 1 Rule for program writing The program must be written according to the syntax described in its relevant paragraph logic counter timer etc To write and compile a program it is not necessary to connect MCP XT controller to PC Page 38 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO The following rules have to be observed e 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 e 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 X 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
115. s described in previous paragraph The red LEDs report the alarms related to module failure MOD F and bus failure BUS F and the internal relay will be de energized at the occurrence of at least one of these two failures or when removing MCP XT supply intrinsic safety The MOD F signaling occurs after 5 seconds delay time in respect to the moment of the failure of a module The search of fault modules may be done using the MCP IDE software package primarily displaying the map of the plant on MCP VISIO If both MOD F and BUS F LEDs lights in continuous mode this means that MCP XT memory is not correctly programmed If a BUS FAILURE occurs the bus connections have to be checked This failure appears when MCP XT is not able to transmit on the bus L1 and L2 Two green LEDs on MCP XT panel report the bus activity the POLL led shows the start of the polling cycle and it blinks at a frequency inversely proportional to the number of configured modules with few connected modules this LED may seem to be fixed ON The VAR led shows through a flsh the occurrence of a status change on one or more input modules If the VAR LED remains ON for a long time greater then 2 seconds then two or more modules of the same type IN or OUT have the same address in this case use MCP VISIO utility to find the doubled addresses the doubled modules are displayed on the screen in yellow color The doubled addresses signaling however cannot be assured be
116. s 6 0 show the address bits 10 7 shows the point The virtual point will be Vn where n bit6 bitO 1 x 16 bit1O0 bit7 1 Note 8 The map of diagnostic bytes contains the information related to the fault modules or related to modules with doubled address The information are organized in one byte for each module with offset Module Address as follows offset 0 Byte not used offset 1 Byte input module 1 offset 2 Byte input module 2 offset 127 Byte OxEA7F input module 127 offset 128 Byte OxEA80 not used offset 129 Byte OxEA81 output module 1 offset 255 Byte OXEAFF output module 127 The meaning of the bits is the following bit 7 not used bit 6 not used bit 5 doubled address bit 4 module failure bit 0 3 counter of the consecutive loss answers Note 9 This map bytes OxEB00 0xEB7F can be used to reset the external counter modules MODCNT if installed The information are organized in one byte for each MODCNT module with offset Module Address as follows offset 0 Byte OXEBOO not used offset 1 Byte input module MODCNT 1 offset 2 Byte OXEBO2 input module MODCNT 2 offset 127 Byte OXEB7F input module MODCNT 127 The meaning of the bits of each byte in this map is the following bit 7 4 not used bit 3 reset channel 4 bit 2 reset channel 3 bit 1 reset channel 2 bit 0 reset channel 1 9 2 2 Microco
117. s are allowed AO1 1 AI1 4 128 R12 AI1 4 12 amp R1 amp P 30 123 5 R54 R52 R53 R54 2 A mathematical equation can also be made by one or more Preset terms only this is useful to load a value in a register or to an output at the activation or de activation of a control input RO P 1527 V1 RL P Ox1AB7 I1 8 amp P 0 I1 8 AO23 2 P 12000 V148 amp P 0b11000011 112 1 amp PL 0 I32 7 2 2 8 Equations for binary code generation Keyword SENDn Tr Send the specified code to output n at the activation of the related input or de activation if complemented with refresh time Tr seconds when more inputs are activated SENDRn Tr Send the specified code to register Rn at the activation of the related input or de activation if complemented with refresh time Tr seconds when more inputs are activated The sent code Bx must be in the range 0 to 255 If the refresh time has been omitted then it will be set to 2 seconds The refresh time must be in the range 1 to 254 seconds it is possible to disable the refresh by specifying the value 255 In this case the sent code will be always that related to last change of one among the inputs listed in the SEND block The input points causing the sending of the related binary code may be real and virtual ones they can be also complemented Up to 16 independent SEND block can be defined DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 Sept
118. t VIRTUAL in the Others column in this case of course no address is required The number of each virtual point will be assigned as follow After having selected the VIRTUAL option press OK The group window will look like the following IE New Group Now hold down the Shift button on the keyboard and double click with the mouse on the virtual LED to be assigned to a virtual point be sure to click ON the LED A yellow label will be shown at the place of the clicked LED type in a number in the range 1 to 2032 to assign that LED to the desired virtual point Click on the right side of each LED while holding down the Shift button on the keyboard to assign a label to the related point Finally click on the white band on the lower side of the virtual module always holding down Shift button to assign a name to it Zone 4 Enable VIRTUAL lt To check or to edit the virtual point assigned to a virtual LED ETTA 5 simply click again on the LED itself holding down Shift Key The d same operation allow to edit the other fields The result may be like the figure here on the right side ML For instance add now a MOD8I A and a MODPNP module to the same group as in the following figure The write and edit Eme this operations described before click while holding down the Shift key can be performed on any kind of module in the group Gicbal Enable window So use it to change the name assi
119. t module and the value 255 to complement the status of each output of the same module and then to write the result in the same Word DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 67 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual Example 3 Switch on the virtual point V751 using the function 16 As said before for the function 3 the Word containing the status of virtual point Vx is given by 1153 INT x 1 16 while the bit is x 1 16 As option see the tables at the end of this manual or use the already mentioned program WordFinder The virtual point V751 is the bit 14 of the Word 1199 the following parameters have to be passed to the MODBUS driver Start 1199 Number 1 normally in this case this parameter is not required by the driver Bit 14 Value 1 or ON it depends on the used driver The execution of this function as described before implies that the MODBUS driver read the Word 1199 using the function 3 then it changes the bit 14 to the read value and finally it sends the resulting value to the same Word 1199 using the function 16 This procedure is mandatory because the Word 1199 contains the status of the virtual points from V737 to V752 since the status of the other virtual points does not be changed then the preliminary reading of this Word is needed This procedure however is normally executed automatically by the M
120. to change an analog output or to change a single bit of the Word for instance to control a single real output or to change the status of a virtual point Page 66 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO The MODBUS function 16 can thus be used to change the status of whole output module both digital or analog type the status of a single output point of a module the status of virtual points the content of counters registers etc To change a single bit of a register using the function 16 the status of the other bits of the same register has to be taken in account because the writing takes place on the whole Word in practice the MODBUS driver automatically take in account this because when the writing must be at bit level they execute the following steps 1 reading through the function 3 of the Word containing the bit to be changed 2 writing through the function 16 of the just read Word read but with the wanted byte changed The MODBUS function 16 can be also used to set the date and time of the internal timekeeper of MCP XT as shown in one of the following examples Example 1 Switch on the point 3 of the output module 29 Instead of function 5 the function 16 can be used From the memory map of MCP XT at paragraph 9 2 1 or using WordFinder program available free of charge on the site www due
121. to execute functions that cannot be realized by the standard equations of MCP XT The duration of a script must be lower than 500msec on the contrary MCP XT will interrupt its execution and it will set the related virtual point V2004 Therefore be aware of the loops nested into a script SCRIPT Enclose the instructions belonging to the script SCRIPT declares the start and ENDSCRIPT ENDSCRIPT declares the end TRIGGER Specify the event that starts the SCRIPT or the time execution period in seconds EXIT Force the exit from the script VAR amp VAR Declare a local variable therefore not shared with the other scripts GLOBAL VAR Declare a global variable therefore shared with all other scripts EXTERN VAR The specified variable has been declared as global in another script logical operators no parenthesis are allowed and no more than one operation for each line is allowed each line is allowed IF THEN ELSE Condition IF and ENDIF enclose the block An IF must be always closed by an ENDIF ENDIF gt gt lt lt Comparison operators greater than greater or equal to equal to less than less or equal to CARRY Bit flag whose value is 1 if the result of the previous operation exceeds the value 65535 overflow or if the result of the previous operation is negative underflow or if a division by 0 occurred the value of this bit is 0 in all other cases bit flag whose value is 1 if the result of the previous operation is
122. ton bar shows the description of its function simply placing the mouse cursor on the button itself l D o ca 128 C Aa L 39 ak OS 081 7 E 2 The majority of the buttons and menu items are so intuitive that no more explanations are needed The button a or the menu item View Show Keywords List is the life belt and it allows to switch ON or OFF the opening of a space on the right side containing all the keywords allowed in the related TAB wa MCPIDE UNTITLED EQU DER File Edit View Preferences Compiling Communication Programming Supervisor Help 15 id 53 8 9 E E 58 08 0 v Equations Macros Scripts Configuration Resources Decompiling 15 05 INS 0 262144 Bytes When Configuration TAB is selected then also a list of all available modules will be shown MCPIDE UNTITLED EQU File Edit View Preferences Compiling Communication Programming Supervisor Help LZ 3394 2 C Ae RR co 3 3E 108 08 1 7 E3701 Equations Macros Scripts Configuration Resources Decompiling 15 05 INS 0 262144 Bytes Double clicking on one of the keywords in the life belt the related example will be placed in the opened workspace the inserted example must be completed as required Page 52 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it DUEMMEGI MCP XT User s manual CONTATTO T
123. twork even if it does not contain any NETWORK directive for instance if only one MCP XT 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 XT controller Remember gt ifa NETWORK directive has been inserted in a MCP XT then also an ADDRESS directive must be insrted too and this last one must be placed before any NETWORK directive gt the Words published by a MCP XT must be different from one to the other in order to avoid superimposition gt upto 8 NETWORK directive can be enabled in each MCP XT in the network Each MCP XT acquires the information published by the other components of the same network even if it does not contain any NETWORK directive gt the data exchange mechanism here described also applies between MCP XT controllers and Domino DFCP controller allowing interactions between the two systems Page 10 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it DUEMMEGI MCP XT User s manual CONTATTO Example Suppose to have installed 2 MCP XT also suppose to have connected to each one of them 1 MODSI A 1 MOD8R 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
124. ual to not equal to gt greater than gt greater or equal to It is also possible to specify a real or virtual input which when activated reset to the value 0 the counter specified in the equation this is however an optional input and must be linked by the operator amp The threshold value also can be the content of a register Examples 01 1 AI10 2 gt 100 amp ZI1 1 The output is controlled by channel 2 of ModCNT module addressed 10 the output will be activated if the counting is greater or equal to 100 The input I1 1 when activated will reset the counter to 0 V10 AI10 4 gt RO The virtual point V10 will be activated if the counting of the channel 4 of ModCNT module addressed 10 is greate than the content of register RO 2 3 Time triggered Equations 2 3 1 Scheduler Equations Scheduler equation controls a digital output as function of specified ON OFF time or date MCP XT includes a timekeeper 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 XT therefore no intervention of the user is required The times specified in the scheduler equations can be daily or weekly times the scheduled dates can be yearly or absolute dates Keyword CLOCK controls the output as function of current time DATE controls the output as function of the current date Page 20 of 78 Rel 2 1 September 2
125. ust be also specified this is given by x 1 16 where the notation 16 means module 16 and it is equivalent to the remainder of the division of x by 16 the notation INT means the integer part of the result of the operation inside the parenthesis To calculate y module 16 proceed as follows divide y by 16 subtract the integer part of the result of point 1 to the result itself emultiply by 16 the result of point 2 the resultant value is the module 16 of the starting number this result is always an integer number in the range 0 to 7 The parameters to be passed to the MODBUS driver for virtual point V328 are Start 1173 Number 1 Bit 7 MCP XT will answer with a Word 2 bytes containing the status of the virtual points from V321 less significant bit to V336 most significant bit The virtual points are binary coded 1 point ON 0 point OFF Example for the calculation of 3279616 327 16 20 4375 20 4375 20 0 4375 0 4375 x 16 2 7 Alternatively the paragraph 11 4 reports some tables to easily locate the RAM address and the bits related to a given virtual point As further possibility use the program WordFinder see the following figure that can be free of charge from the site www duemmegi it Word Finder Ver 2 0 0 1 Finder i MCP AT i MCP PLUS DFCP DFTS DFCP DFCK2 DFCP DFCL Real Input Dec Hex Real Output Dec Hex Virtual Points Bit Dec Hex Virtual C 5
126. vious operation is negative underflow or if a division by 0 occurred The ZERO flag value is 1 if the result of the previous operation is zero The following SCRIPT shows the use of these flags script 1 trigger 2 RO R1 R2 somma R1 R2 if CARRY then RO 65535 se risultato gt 65535 allora RO 65535 endif R3 R4 R5 differenza R4 R5 if CARRY then R320 se risultato lt 0 allora R0 0 endif R6 R7 R8 differenza R7 R8 if ZERO then vl 1 se risultato 0 allora V1 1 else vi 0 altrimenti V1 0 endif endscript 3 2 6 DEFINE The following script use the define keyword to assign a mnemonic name to some points enhancing in this way the readability of the program SCRIPT 1 TRIGGER 1 define Enable RO 1 define Input Il 1 define Lamp O1 1 IF Enable 1 THEN Lamp Input ELSE Lamp 0 ENDIF ENDSCRIPT Page 28 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Longhena 4 20139 MILANO Tel 02 57300377 Fax 02 55213686 www duemmegi it MCP XT User s manual CONTATTO The following script shows how is possible to implement quite complex functions The following SCRIPT implements a single channel Dynamic Light system that is a light game obtained by a dimmer output module e g MOD2DM The dynamic light game shown in the following graph has to be implemented the percentage of brightness is on the vertical axis and the time in seconds on the horizontal axis after 60 se
127. will translate the few program lines in the previous example as follows vl I1 1 amp I1 2 2 R 1 P 129 I1 1 amp 130 11 2 amp P 128 V1 AO1 RO v3 11 3 amp I1 4 v4 R 1 P 129 I1 3 amp P 130 I1 4 amp P 128 V3 AO2 R1 v5 11 5 amp I1 6 V6 R 1 P 129 I1 5 amp 130 11 6 amp P 128 V5 AO3 R2 V7 I1 7 amp 11 8 v8 R 1 P 129 I1 7 amp P 130 11 8 amp P 128 V7 AO4 R3 v9 112 1 amp 12 2 10 R 1 129 12 1 amp P 130 12 2 amp P 128 V9 AO5 R4 V11 I2 3 amp 12 4 12 R 1 P 129 12 3 amp P 130 12 4 amp P 128 V11 AO6 R5 This example well clarify how to use the MACRO utility to execute block of repetitive equations where only some parameters change In addition and this is another great advantage in using the MACRO utility a required change to the operation of the system will be reduced to the modification of the MACRO definition DUEMMEGI s r l Via Longhena 4 20139 MILANO Rel 2 1 September 2011 Page 23 of 78 Tel 02 57300377 Fax 02 55213686 www duemmegi it CONTATTO MCP XT User s manual 3 SCRIPT 3 1 Summary Scripts allow to implement sections of program that will be executed in sequential mode by MCP XT Each Script can be started triggered by an event or it can be executed every a well specified time period Each defined script must be numbered up to 127 scripts may be defined The scripts must be used only
128. zero the value of this bit is 0 in all other cases DEFINE assign a name to a variable or to a parameter or to a constant GOTO unconditional jump CALL jump to a subroutine or function which is a section of a script from a script it is possible to call a subroutine contained into another script SUB ENDSUB Enclose a block of instructions as subroutine or as function the subroutines that have been declared in a script can be seen and used by any other script RET Exitfrom a subroutine or function BIT x Declare that parameter x of a subroutine or function or the value returned by a function is a bit the declaration BIT x applies to subroutines or functions only WORD x Return the number of the Word where the point x is mapped ptr Pointer it returns the content of the Word whose address is the value of the variable inside the square brackets ptr in this case in other words ptr points to the Word address and ptr is the content of the pointed Word see examples WORD k It returns the content of the Word k where k is a constant value in the range 0 to 32767 E Constant vale in te ee AE S constant value in the range 0 to 65535 BMASK x Function that returns a 16 bit number having in its binary format only one bit set to 1 at the position of x 1 16 that means x 1 module 16 this function is useful for bit operations Page 24 of 78 Rel 2 1 September 2011 DUEMMEGI s r l Via Lo
Download Pdf Manuals
Related Search
Related Contents
Fujitsu STORAGEBIRD XL 160GB Instructions d`installation - Garantie Installation Instructions • MACCHINA CAFFE' ESPRESSO - MANUALE DI document pdf - Conseil Français de Réanimation Cardio Copyright © All rights reserved.
Failed to retrieve file