Rockwell Automation AB Hammarbacken 6 A 5tr, 191 49 Sollentuna Tel +46 (0)8 477 40 00; Fax +46 (0)8 477 40 40 Drakegatan 6 9tr, 412 50 Göteborg, Tel +46 (0)31 703 56 50; Fax +46 (0)31 703 56 56 Sankt Lars väg 49, 222 70 Lund Tel +46 (0)8 477 40 00; Fax +46 (0) 46 32 01 29 www.rockwellautomation.com User Manual COMLI Protocol for MVI56-ADM Cat. No. 1756-MVICMLI, Ver 2.2 Publication 1756-MVICMLI - 2.2 June 2008.doc Important User Information Important User Information Because of the variety of uses for the products described in this publication, those responsible for the application and use of this control equipment must satisfy themselves that all necessary steps have been taken to assure that each application and use meets all performance and safety requirements, including any applicable laws, regulations, codes and standards. The illustrations, charts, sample programs and layout examples shown in this guide are intended solely for purposes of example. Since there are many variables and requirements associated with any particular installation, Allen Bradley does not assume responsibility or liability (to include intellectual property liability) for actual use based upon the examples shown in this publication. Reproduction of the contents of this copyrighted publication, in whole or part, without written permission of Rockwell Automation, is prohibited. Rockwell Automation Order & Support For technical support and reporting issues (comments on manual, program, etc) contact Rockwell Automation Technical Support Scandinavia: E-mail: esupport2@ra.rockwell.com Tel: +46 771-219 219 For sales and order support contact local Rockwell Automation AB offices in Sweden or Customer Service Center in Scandinavia: Customer Service Center in Scandinavia: E-mail: racscse@ra.rockwell.com Tel: +46 771-219 219 Office in Sollentuna (Stockholm): Tel: +46 8 477 40 00 Fax: +46 8 477 40 40 Office in Göteborg: Tel: +46 31 703 56 50 Fax: +46 31 703 56 56 Office in Lund: Tel: +46 8 477 40 00 Fax: +46 46 32 01 29 Publication 1756-MVICMLI - 2.2 June 2008.doc Page 2 of 124 Table of Contents Table of Contents IMPORTANT USER INFORMATION.............................................................................................................. 2 ROCKWELL AUTOMATION ORDER & SUPPORT .................................................................................... 2 TABLE OF CONTENTS...................................................................................................................................... 3 SUMMARY OF CHANGES AND KNOWN LIMITATIONS ......................................................................... 4 SUMMARY OF CHANGES ....................................................................................................................................... 4 V1.0 (Dec 2001) .............................................................................................................................................. 4 V2.0 (Oct 2002)............................................................................................................................................... 4 V2.1 (Nov 2002) .............................................................................................................................................. 4 V2.2 (Sep 2006)............................................................................................................................................... 4 KNOWN ISSUES AND LIMITATIONS ....................................................................................................................... 4 GENERAL INFORMATION .............................................................................................................................. 6 THE PURPOSE OF THIS MANUAL .......................................................................................................................... 6 TERMS AND ABBREVIATIONS ............................................................................................................................... 6 RELATED PUBLICATIONS ...................................................................................................................................... 6 PACKAGE ORDER INFORMATION .......................................................................................................................... 7 GENERAL FUNCTIONAL COMLI CONCEPT ON THE CONTROLLOGIX PLATFORM .................................................. 8 HARDWARE AND SOFTWARE REQUIREMENTS .................................................................................................... 10 COMLI MODULE 1756-MVICMLI OVERVIEW......................................................................................... 12 INTRODUCTION .................................................................................................................................................. 12 Product Description ...................................................................................................................................... 12 System Specification...................................................................................................................................... 12 INSTALLATION INSTRUCTIONS ............................................................................................................................ 13 Unpack the Module ....................................................................................................................................... 13 Mount the Compact Flash Card.................................................................................................................... 13 Configure the Jumpers .................................................................................................................................. 13 Install the Module into the CLX Chassis...................................................................................................... 14 Connect the Serial Adapter Cables ............................................................................................................... 15 Connect the COMLI Nodes ........................................................................................................................... 15 Create the CLX Program .............................................................................................................................. 15 THE COMLI PROTOCOL .................................................................................................................................... 16 MVICOMLI FUNCTION ..................................................................................................................................... 17 Block Definition ............................................................................................................................................ 17 Communication Interface Between the CLX Controller and the MVICMLI Module .................................... 17 Input Image (format request – MVICMLI module > CLX controller)........................................................................ 18 Output Image (Reply format – CLX controller => MVICMLI module)..................................................................... 19 Communication Flow Chart ........................................................................................................................................ 21 Communication Between the MVICMLI Module and COMLI Network Devices .......................................... 23 BLOCK DESCRIPTIONS ........................................................................................................................................ 24 Configuration Block [42].............................................................................................................................. 24 Overview..................................................................................................................................................................... 24 Block Description ....................................................................................................................................................... 24 Index Configuration Example of the Configuration Block ......................................................................................... 25 Telegram Block [32-39]................................................................................................................................ 26 Overview..................................................................................................................................................................... 26 Block Description ....................................................................................................................................................... 26 Configuration Example of the Telegram Blocks ......................................................................................................... 28 Telegram Notes ........................................................................................................................................................... 28 Execution of the Telegram Blocks .............................................................................................................................. 28 Telegram Control Block [41]........................................................................................................................ 29 Overview..................................................................................................................................................................... 29 Block Description ....................................................................................................................................................... 29 Telegram Control Notes .............................................................................................................................................. 30 Publication 1756-MVICMLI - 2.2 June 2008.doc Page 3 of 124 Table of Contents Master Status Block [40] .............................................................................................................................. 31 Overview..................................................................................................................................................................... 31 Block Description ....................................................................................................................................................... 31 Master Status Notes .................................................................................................................................................... 31 DIAGNOSTICS ..................................................................................................................................................... 32 Slave Status for Port 2 and 3 ........................................................................................................................ 32 Overview..................................................................................................................................................................... 32 Word Mirror Description ............................................................................................................................................ 32 Diagnostics Descriptions............................................................................................................................................. 32 Error Codes................................................................................................................................................... 34 LED’s ............................................................................................................................................................ 35 RESETTING OF THE MVICMLI MODULE ............................................................................................................ 36 CONTROLLOGIX CONTROLLER PROGRAM OVERVIEW................................................................... 37 INTRODUCTION .................................................................................................................................................. 37 OVERVIEW OF THE PROVIDED SAMPLE CODE .................................................................................................... 37 DATA STRUCTURES ............................................................................................................................................ 38 CMLModuleDef ............................................................................................................................................ 38 CMLAreaIOBlock ......................................................................................................................................... 40 CMLAreaRegisterBlock ................................................................................................................................ 40 CMLBlackplane ............................................................................................................................................ 41 CMLSlaveStatus ............................................................................................................................................ 42 CMLTelegramBlock ...................................................................................................................................... 42 FaultRecord .................................................................................................................................................. 43 CONTROLLER TAGS............................................................................................................................................ 44 CML1 ............................................................................................................................................................ 44 Tag elements used for configure the COMLI application/MVICMLI module............................................................ 45 Tag elements used for collecting COMLI diagnostics/status from the MVICMLI module ........................................ 47 Tag elements used for exchanging COMLI data between the CLX controller and the MVICMLI module................ 48 Tag element used for backplane handshaking communication between the CLX controller and the MVICMLI module ........................................................................................................................................................................ 50 Local:2:C ...................................................................................................................................................... 50 Local:2:I and Local:2:O............................................................................................................................... 51 MJFAULTS ................................................................................................................................................... 55 PROGRAM TAGS ................................................................................................................................................. 56 LADDER LOGIC .................................................................................................................................................. 57 Power-Up Handler........................................................................................................................................ 57 MainProgram................................................................................................................................................ 59 MainRoutine ............................................................................................................................................................... 60 ReadData..................................................................................................................................................................... 63 WriteData.................................................................................................................................................................... 65 RequestAccomplished................................................................................................................................................. 68 PROGRAM SET UP GUIDE ................................................................................................................................... 69 Step by Step Procedure ................................................................................................................................. 70 Led & Port Information................................................................................................................................. 77 Good Practice ............................................................................................................................................... 77 APPENDIX A – CLX COMLI VARIABLES/TAGS AND LOCAL INPUT/OUTPUT IMAGES .............. 78 APPENDIX B – MVICMLI BLOCK ID AND IO/REGISTER ADDRESS AREAS .................................... 81 APPENDIX C – CONFIGURATION EXAMPLES......................................................................................... 82 Publication 1756-MVICMLI - 2.2 June 2008.doc Page 4 of 124 Summary of Changes and Known Limitations Summary of Changes and Known Limitations Summary of changes V1.0 (Dec 2001) None. V2.0 (Oct 2002) -Implemented slave functionality (ver 1.0 - only master). Now the MVICMLI module supports both master and slave functionality. -V1.0 was reported having an offset error when saving data to the destination address. This error is fixed in ver 2.0. -User Manual updated according to the slave implementation. Several configuration examples are provided in the appendix. -Added known issues and limitations in the user manual. V2.1 (Nov 2002) -V2.0 was reported not supporting scheduled telegrams in the way it should. At least one continuous ‘dummy’ telegram had to be configured together with the scheduled telegrams to make it work. This error is fixed in ver 2.1 – it is now possible to use scheduled telegrams only (without mentioned work around). -Correction made for reported issue in user manual ver 2.0 section ‘Known Issues and Limitations’. In ver 2.0 it is said: ‘Defining more than one telegram of the same message type (that is, multiples of 1=Read IO Bits or 2=Read Register or 11=Write IO or 12=Write register) to the same slave node, and using different source/destination address (different block id) may result in communication problems even if the leds indicate ‘OK’.’ This reported issue is NOT true. It has been tested and it works. This type of telegram definition is possible to use (without work around). V2.2 (Sep 2006) -V2.1 was reported not supporting more then 16 telegrams. This error is fixed in ver 2.2 – it is now possible to use 128 telegrams as it should. However, for best performance use as few telegrams as possible. Known Issues and Limitations Keep the following safety concerns/limitations in mind when using ver 2.2 release: -The MVI56-ADM firmware and image must be correct as well as the files on the compact flash card. Please review section ‘Hardware and Software Requirements’ for detail information. -The MVI56-ADM must be configured correctly in terms of RPI times and the provided sample code must be used correctly. Please review section ’Program Set Up Guide’ and follow the instructions. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 5 of 124 General Information The Purpose of This Manual General Information The Purpose of This Manual This manual is intended for control engineers and technicians who are installing, programming, and maintaining a control system that includes a 1756-MVICMLI module. It is assumed that this personnel is familiar with the ControlLogix programmable controllers/platform as well as the programming software RSLogix5000 - Industrial Software for Windows NT/2000 and the Allen Bradley Logix5000 Family of Controllers. This manual describes the function, installation and programming set up of the 1756-MVICMLI module. A set up guide is included (see section ‘Program Set Up Guide’ in chapter ‘ControlLogix Controller Program Overview’) as well as programming examples (see ‘Appendix C – Configuration Examples’). For more information and use of the MVI56-ADM module (hardware), please refer to the user manual for the module. Terms and Abbreviations In this manual the following terms will be used: Term Definition CLX MVI module MVICMLI module ControlLogix System/Platform. Multi-Vendor Interface Module MVI56-ADM. Multi-Vendor Interface Module MVI56-ADM with the COMLI compact flash card installed. The CPU of the CLX system. 16 bits integer (used by the controller or the MVICMLI module). 16 bits integer (used by the controller or the MVICMLI module). Controller Register Word Related Publications Publication Publication Number Data sheet MVI56-ADM MVI56_ADM_Datasheet.pdf MVI-ADM, ‘C’ Programmable Application adm_dev_guide1.pdf Development Module. Developer’s Guide September 19, 2007. Publications could be found on the Internet - Literature Library: http://literature.rockwellautomation.com/idc/groups/public/documents/webass ets/browse_category.hcst http://www.prosoft-technology.com/ Publication 1756-MVICMLI - 2.2 June 2008.doc Page 6 of 124 General Information Package Order Information Package Order Information The 1756-MVICMLI package for the MVI56-ADM module consists of: • Compact Flash Card (developed C-program for the COMLI protocol included), 1756-MVICMLICF, 2.2. • User Manual, Pub. 1756-MVICMLI - 2.2 June 2008 • ControlLogix controller sample project source code on CD-ROM, 1756MVICMLISETUPCDROM, REV 2.2, June 2008. The user manual is delivered MVICMLISETUPCDROM. as a pdf file located on the The 1756-MVICMLI package for the MVI module must be ordered through Customer Service Center in Scandinavia: E-mail: racscse@ra.rockwell.com Tel: +46 771-219 219 Office in Sollentuna (Stockholm): Tel: +46 8 477 40 00 Fax: +46 8 477 40 40 Office in Göteborg: Tel: +46 31 703 56 50 Fax: +46 31 703 56 56 Office in Lund: Tel: +46 8 477 40 00 Fax: +46 46 32 01 29 Observe: - that the MVI56-ADM must be ordered together with the 1756-MVICMLI package. So when ordering one item of 1756-MVICMLI the customer also has to order one item of MVI56-ADM. - and that CSM Scandinavia will do a quality compability test of these two ordered products before both will be sent to the customer. This to guarantee product functionality. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 7 of 124 General Information General Functional COMLI Concept on the ControlLogix Platform General Functional COMLI Concept on the ControlLogix Platform To add COMLI protocol capability with master functionality to a ControlLogix platform two main things have to be done: 1) Mount a MVICMLI module into one of the CLX slots (connect COMLI devices to its ports). The module can be located locally (in the same chassis as the CLX controller) or remote (in a remote chassi). The MVICMLI module supports COMLI protocol and is able to communicate with other network COMLI devices. By sending telegrams to these units it can send or receive I/O and register data to and from these devices. 2) Create or add program application data structures and ladder logic for the CLX controller (by using the provided RSLogix5000 sample application source code in the 1756-MVICMLI package). Adjust the application to the overall system requirements - add or remove unused data structures and ladder logics and define configuration and telegram blocks. By doing this the communication interface between the controller and the MVICMLI module (and other network COMLI devices) is hereby defined. Booting up the CLX and setting the controller in run the MVICMLI module will begin its internal configuration set up (reading defined configuration and telegram blocks from the controller) and thereafter it will starts communicating with the controller and connected network COMLI devices. The MVICMLI module (MVI module) is unique in the way the CLX backplane is utilized. Data is paged bidirectionally between the controller and the MVICMLI module across the backplane using the MVICMLI module’s input and output images. The update frequency of the two images is determined by the scheduled scan rate defined by the user of the MVICMLI module (defined in RSLogix5000) and the communication load on the MVICMLI module. A typical update time range from 2 to 10 milliseconds. Hence, the communication interface between the controller and the MVICMLI module is this mentioned bidirectional transference of data – the input and out images. It is automatically defined in RSLogix5000´s controller tags whenever the MVICMLI module is added to the RSLogix5000 application. The size of the input and output images (in words) has to be defined by the user. Due to the COMLI protocol on the compact flash the sizes has to be defined as 250 words for input and 248 words for output (to equal related images programmed in COMLI protocol). This large amount of data areas permits fast throughput of data between the MVICMLI module and the controller. The MVICMLI module uses the input image to send requests to the controller. Three types of request could be seen: 1) read data from the controller; 2) write data to the controller; 3) both read and write. In all cases the input image will contain I/O / register data together with related block numbers and finally a communication flag for the request. Hence, the MVICMLI module uses the input image to send request information to the controller and the controller uses it to read request information from the MVICMLI module. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 8 of 124 General Information General Functional COMLI Concept on the ControlLogix Platform Whenever the communication flag changes due to a request from the MVICMLI module the controller logics examines the input image data. If the MVICMLI module wants to write data to the controller data is extracted from the input image and saved in a proper controller location memory (defined variable). If the MVICMLI module wants to read data from the controller this data will first be located in the controller’s memory (defined variable) and then placed in the output image for the MVICMLI module to read. The controller will ignore the I/O and register data in the input image if it is only a read request from the MVICMLI module. The MVICMLI module uses the output image to read replied data given by the controller due to a MVICMLI module request. Three types readings could be seen: 1) read replied data from the controller (data is extracted and placed in the internal memory of the MVICMLI module); 2) read that a write request has been sorted out by the controller; 3) both. In all cases the input image will contain I/O or register data together with related block numbers and communication flag. For the MVICMLI module to know that the output image data is a reply from the controller the communication flag (set by the controller) will equal the same communication flag (set by the MVICMLI module) as the one used in the MVICMLI module request. Hence, the MVICMLI module uses the output image to read reply information from the controller and the controller uses it to send reply information to the MVICMLI module. Information flow between the CLX Controller and the MVICMLI module: Read Request Info Input Image of MVICMLI CLX Controller Send Reply Info Send Request Info MVICMLI module Output Image of MVICMLI Read Reply Info Mentioned concept will be described more in detail in the following chapters. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 9 of 124 General Information Hardware and Software Requireme Hardware and Software Requirements In order to be able to use the MVICMLI package successfully the following hardware and software requirements must be take into consideration: Hardware • MVI56-ADM o BIOS 1.1, firmware 1.2. o Image file named ‘MVIboot.IMA’. • 1756-MVICMLICF (ver 2.2) • Allen Bradley ControlLogix Family of Controllers. Note: It is possible to use 1756-MVI (BIOS 1.1, firmware 1.2) instead of MVI56-ADM. The same image file (‘MVIboot.IMA’) should be used with the 1756-MVI. Software • RSLogix5000 V10.00.00 (or higher) Industrial Software for Windows NT/2000. Please review http://support.rockwellautomation.com/ControlFlash/ for RSLogix5000 firmware updates. Files • The compact flash card 1756-MVICMLICF ver 2.2 contains the following files: ‘MVIEXEC.BAT’ contains: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 10 of 124 General Information Hardware and Software Requireme • The MVI56-ADM (or 1756-MVI) must be prepared with the following image file: ‘MVIboot.IMA’ contains: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 11 of 124 COMLI Module 1756-MVICMLI Overview Introduction COMLI Module 1756-MVICMLI Overview Introduction Product Description The MVI module together with the MVICMLI package is the fastest and easiest way to add COMLI protocol capability to the CLX platform. The module is a single slot, backplane compatible solution for the Allen Bradley CLX platform. This module and mentioned COMLI package provides highly configurable support of COMLI master implementations, allowing the many field devices supporting COMLI to be integrated into the powerful CLX platform. The COMLI-driver for the Compact Flash Card (mounted onto the MVI module) is developed in programming language ‘C’ for Embedded DOS6XL, 16 bits OS together with Borland C-compiler v5.02. The communication principle is of master/slave type. The devices on the network can be connected point-to-point or in multidrop, in half duplex mode. The COMLI protocol has two format of data, ASCII or binary format. The COMLI Interface Module uses the BINARY format only. The function of the MVICMLI module is specified in words tables (Configuration Block, Telegram Block, etc), which are configured in the CLX controller program. This data is sent to the MVICMLI module due to a MVICMLI request in the start up phase of the same. Blocks with user data or configuration are exchanged via the CLX backplane by use of the MVI modules input and output images. System Specification • The two COMLI ports are configured independently, allowing the module to operate in any of the following modes: Port 2 Port 3 Port 2 Port 3 Master Master Master Slave Master Slave Not used Master Slave Slave Not used Not used Slave Not used Master Slave • The module images the whole COMLI’s Register and I/O area out to external COMLI devices (Register: 0-3071; I/O: 0-37777 octal). Data area with up to 3000 words and up to 16384 IO bits (=1024 words). The sum of words and IO bits is a maximum of 4000 words. • Configuration tables define memory mapping and functions. • COMLI binary protocol (Not ASCII). • Supported COMLI requests: Read Write IO Bits (8 bits NOT single bit) IO Bits (8 bits or single bit) Registers Registers Publication 1756-MVICMLI - 2.2 June 2008.doc Page 12 of 124 COMLI Module 1756-MVICMLI Overview Installation Instructions Installation Instructions Unpack the Module The 1756-MVICMLI package for the MVI56-ADM module consists of: • • • Compact Flash Card (developed C-program for the COMLI protocol included), 1756-MVICMLICF, 2.2. User Manual, Pub. 1756-MVICMLI - 2.2 June 2008 ControlLogix controller sample project source code on CD-ROM, 1756MVICMLISETUPCDROM, REV 2.2, June 2008. Remember, MVI56-ADM has to be ordered together with 1756-MVICMLI. The MVI56-ADM package is shipped with the following components: • MVI56-ADM module. • Null modem cable. • Serial Adapter Cables (DB9 to RJ45 Adaptor). • ProSoft Technology Solutions CD-ROM (Includes all documentation, sample code and sample ladder logic). Observe that these sample codes are not meant to be used together with 1756-MVICMLI. The provided CD-ROM in the 1756-MVICMLI package contains program code for the controller to enable communication between itself and the MVICMLI module by use of the ControlLogix Backplane. The easiest method to implement the MVICMLI module is to start with this example code. Simply copy data types and ladder logic and paste it into your application and adjust it to fit your needs. Mount the Compact Flash Card Normally the compact flash card is not pre-installed on the delivered MVI56ADM module. Thus, if that is the case the user has to mount the compact flash card into the MVI56-ADM himself/herself. Having installed the compact flash card its program will start execute during the boot up process of the MVICMLI module (hence, when the ControlLogix system is powered up). The execution starts up with a start up sequence in which the MVICMLI module requests configuration and telegrams blocks from the controller. After that it will making requests of COMLI I/O and register blocks for both reading and writing. Configure the Jumpers Before installing the MVICMLI module in the chassis, the module’s configuration jumpers on the module’s printed circuit board have to be set to enable accurate communication for the application. Consult the document MVI-ADM, ‘C’ Programmable Application Development Module Developer’s Guide September 19, 2007 (page 11) on how to set the module’s configuration jumpers SETUP, PART 1 & PART 2. PART 1 (port 1) and PART 2 (port 2) can be configured for RS232, RS422 or RS485. Please note that the opposite COMLI node/nodes to port 1/port 2 has/have to be set in the same configuration (same baud rate). The setup jumper located at the bottom of the module should have the two pins umpired when programming the module and removed (from one of the two pins) to enable COMLI communication on port 1 and 2. Note: Check that the SETUP jumper on the shipped MVI56-ADM module is removed (from one of the two pins) so that proper COMLI communication can be established. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 13 of 124 COMLI Module 1756-MVICMLI Overview Installation Instructions Install the Module into the CLX Chassis After the configuration jumpers are set the MVICMLI module is ready to be installed into the CLX chassis. It is possible to install the module in any slot in the ControlLogix Chassis. Slot 0 is the first slot and is always the leftmost slot in the rack (the first slot to the right of the power supply). The following picture shows how to install the module. In this case in slot 0. The module can be used locally (installed in the same chassis as the CLX controller) or remotely (installed an additional chassis via Ethernet). In Reline the MVI56-ADM module should be displayed as: If not, make sure that the module’s EDS file is registered on the PC using Rockwell Software EDS Hardware Installation Tool (Start=>Programs=>Rockwell Software=> RSLinx Tools=> EDS Hardware Installation Tool). The EDS file (and belonging icon) can be found on the supplied CD-ROM. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 14 of 124 COMLI Module 1756-MVICMLI Overview Installation Instructions Connect the Serial Adapter Cables . Having installed the module into the CLX chassis then connect the serial adapter cables (DB9 to RJ45 Adaptor - supplied with the purchased MVI) on port 2 or/and 3. Refer to the document MVI-ADM, ‘C’ Programmable Application Development Module. Developer’s Guide September 19, 2007 (page 11) on how to install the serial adapter cables on PRT 1 & 2. Connect the COMLI Nodes To finish up the installation and cable connection phase, connect the COMLInetwork cable to the serial adapter cable DB-9 male connector for PRT 1 or/and 2. For point-to-multipoint communication on RS-485/RS-422 use terminating resistors of 120Ω, placed at the physical beginning and physical end of the network link. Create the CLX Program Having installed the module and made the accurate cable connections the next step will be to create the program for the CLX controller. By using the provided RSLogix5000 sample application code the programmer will automatically (with some adjustments to fit the overall system requirements that is) establish the program interface to the MVICMLI module’s program. The programmer also has to add program code to handle incoming and outgoing COMLI data and also other code for the application. The programming set up procedure is described more in detail in chapter ‘ControlLogix Controller Program Overview’, section ‘Program Set Up Guide’. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 15 of 124 COMLI Module 1756-MVICMLI Overview The COMLI Protocol The COMLI Protocol The COMLI protocol1 is defined by ABB (Alfa Laval Automation) AB in Malmö, Sweden. The COMLI protocol is an ’open’ communication protocol, in which the communication occur serial and asynchronous according to the Master/Slave principal in half duplex (a slave does not respond when an error is detected in a received message). The COMLI protocol supports several message types, for which the MVICMLI module supports the following: COMLI Message Type 0 0 2 2 3 1 MVICMLI Message Type 11 12 1 2 11 - Description I/O bits Transfer2 Register Transfer Read I/O bits3 Read Registers Unique I/O bit transfer4 Acknowledge, are sent as an answer from the slave to the master when data is transferred in a message. In a COMLI network only one master node can exist together with a maximum of 247 slave nodes. Electrical restrictions may exist, which can restrict the amount of slave nodes that can be used. 1 Source for the COMLI protocol: COMLI System Description, Doc nr 4930192-11, Doc ver 3-1, Release March 1997. 2 The amount of bits has to be equal divided by 8. 3 See 1. 4 The amount of bits can NOT be equal divided by 8 (single bit transfer). Publication 1756-MVICMLI - 2.2 June 2008.doc Page 16 of 124 COMLI Module 1756-MVICMLI Overview MVICOMLI Function MVICOMLI Function The MVICMLI module controls the communication by requesting blocks from the CLX controller. A request can either be a write request (write block data to the CLX controller) or a read request (read block data from the CLX controller). Along with the mentioned requests the MVCMLI module also process and exchanges data with connected COMLI network devices. Block Definition All communication between the MVICMLI module and CLX controller is done by using so called blocks. One block consists of 128 words (16 bits in one word). All blocks have a unique block number. The data area is addressed by the block number. Five types of blocks can be seen: 1) Data blocks (0-31) 2) Telegram blocks (32-39) 3) Status block (40) 4) Control block (41) 5) Configuration block (42) The data blocks are used to exchange registers and I/O data between the MVICMLI module and the CLX controller. The telegram block is used when to read defined telegrams from the CLX controller program to the MVICMLI module (hence, setting up the module for what telegrams to be used). The status block is used to get status from each telegram to the CLX controller. The control block is used when to read defined telegram control information from the CLX controller program to the MVICMLI module (hence, setting up the telegrams in terms of controllability). The configuration blocks are used to read configuration data from the CLX controller program to the MVICMLI module (hence, setting up the module for the entire network communication). Block Number 0 – 7 (8) 8 – 31 (24) 32 – 39 (8) 40 41 42 Description COMLI I/O area COMLI Register Area Telegram Block Master Status Block Telegram Control Block Configuration Block Write to CLX X X X - Read from CLX X X X X X Communication Interface Between the CLX Controller and the MVICMLI Module Data is paged bidirectional between the CLX controller and the MVICMLI module across the backplane using the MVICMLI module’s input (Local:X:I.Data) and output (Local:X:O.Data) images. These two images servers as the interface between the CLX controller and the MVICMLI module. The CLX controller utilizes the input image as a read data area and the output image as a write data area. Vice versa for the MVICMLI module. Please note that the MVICMLI module controls the communication between itself and the CLX controller across mentioned backplane. The connection update rate between the MVICMLI module and the CLX controller (that is Requested Packet Interval, RPI, requested rate of packet arrival) is adjustable for the user in RSLogix5000. The RPI parameter is set under the 1756Module properties (mark the ‘1756-Module’ under ‘IO Configuration’ in the ‘Controller Organizer’, right click and chose ‘properties’). Publication 1756-MVICMLI - 2.2 June 2008.doc Page 17 of 124 COMLI Module 1756-MVICMLI Overview MVICOMLI Function Input Image (format request – MVICMLI module > CLX controller) The MVICMLI module uses the input image to send requests and transfer data to the CLX controller. The input image (Local:X:I.Data ) contains 248 words and is defined as (seen from the MVICMLI module’s point of view): Word Description 0 1 2 3-130 131-132 133-142 143-152 153-248 249 Reserved Request Write Block ID (-1, 0-31, 40) Request Read Block ID (-1, 0-39, 41 & 42) Write Data Area MVICMLI / Read Data Area CLX controller Product Version (C-program Version on MVICMLI) Slave Status Port 2 Slave Status Port 3 Reserved Communication Flag (MVICMLI module: inc 0-65535, CLX: 0=>32767, -32768=>-1) Amount 1 1 1 128 2 10 10 96 1 Reserved: Do not use. Write Block ID: Requested write block number by the MVICMLI module (COMLI data placed in word 3-130, for the CLX controller to save in another proper location). Excepted write block ID: -1, 0-31, and 40. ‘-1’ means ignore - the MVICMLI module request does not include any write requests (CLX controller should not write any data back in the output image). Read Block ID: Requested read block number by the MVICMLI module (COMLI data placed in word 3-130, for the CLX controller to save in another proper location). Excepted write block ID: -1, 0-31, and 40. ‘-1’ means ignore - the MVICMLI module request does not include any write requests (CLX controller should not write any data back in the output image). Write Data Area MVICMLI / Read Data Area CLX controller: The COMLI data (I/O, Register or Master Status data from the MVICMLI module to the controller. This received COMLI data (one block of data, 128 words) has to be moved/copied to a proper location to protect it from being overwritten during the next reception from MVICMLI module. This moving/coping handling is already implemented in the provided RSLogix5000 sample application source code. Product Version (C-program Version on MVICMLI): Information on the C-program version on the compact flash. This data is always present for every MVICMLI request. Slave Status Port 2: Status from slaves on port 2. To access this information the telegram block (32-39) must be set up properly. Slave Status Port 3: Status from slaves on port 3. To access this information the telegram block (32-39) must be set up properly. Reserved: Do not use Communication Flag: Contains a value between 0-65535. Earlier in this text it was said that the MVICMLI module controls the communication between itself and the CLX controller. Hence, the MVICMLI module has to signal to the CLX controller to posses this controllability. The signalling is done by use of a communication flag, which is incremented by the MVICMLI module for every new MVICMLI request. When 65535 (-1 in CLX) is reached the flag rolls over to 0 again and so on. The CLX controller reacts to a new MVICMLI request when the read communication flag does not equals the former value. Please be aware of that both write and read requests can occur in the same MVICMLI request (both Write Block ID and Read Block ID contain legal block ID:s). In such case the CLX controller handles the write request first and then after having read and saved the data it deals with the read request. Which blocks the MVICMLI module sends to or requests from the CLX controller depends on the data traffic on the COMLI network. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 18 of 124 COMLI Module 1756-MVICMLI Overview MVICOMLI Function Output Image (Reply format – CLX controller => MVICMLI module) The MVICMLI module uses the output image to read replied data given by the CLX controller due to a MVICMLI module read request (even write request to indicate that transferred COMLI data is read and stored on the CLX controller). The output image (Local:X:O.Data ) contains 248 words and is defined as (seen from the MVICMLI module’s point of view): Word 0 1-128 129-245 246 247 Description Read Block ID (-1, 0-39, 41 & 42) Write Data Area CLX controller / Read Data Area MVICMLI Reserved Reset Communication Flag (MVICMLI module: inc 0-65535, CLX: 0=>32767, -32768=>-1) Amount 1 128 117 1 1 Read Block ID: Requested read block number sent back from the CLX controller to the MVICMLI module to indicate what related data is stored on word 1-128. Excepted read block ID: -1, 0-31, 40, 41 and 42. The value of the Read Block ID depends on the type of MVICMLI module request. The following cases could be seen: a) Read MVICMLI request only Input image: 1 Request Write Block ID (-1, 0-31, 40) = -1 (No write request) 2 Request Read Block ID (-1, 0-39, 41 & 42) >-1 The CLX controller will respond with the requested Read Block ID. Thus, Read Block ID will equal the value of the requested Read Block ID. Output image: 0 Read Block ID = Requested Read Block ID (-1, 0-39, 41 & 42) b) Write MVICMLI request only Input image: 1 Request Write Block ID (-1, 0-31, 40) >-1 2 Request Read Block ID (-1, 0-39, 41 & 42) =-1 (No read request) The CLX Controller will NOT respond with the requested Write Block ID. Instead it will respond with the requested Read Block ID, which in this case always is ‘-1’. Output image: 0 Read Block ID = Requested Read Block ID = -1 c) Read and Write MVICMLI requests in one of the same request. Input image: 1 Request Write Block ID (-1, 0-31, 40) >-1 2 Request Read Block ID (-1, 0-39, 41 & 42) >-1 The CLX Controller will respond with the requested Read Block ID even if the CLX controller also handles the write request. Thus, Read Block ID will equal the value of the requested Read Block ID. Output image: 0 Read Block ID = Requested Read Block ID (-1, 0-39, 41 & 42) Publication 1756-MVICMLI - 2.2 June 2008.doc Page 19 of 124 COMLI Module 1756-MVICMLI Overview MVICOMLI Function Please note that the CLX controller never replies with the requested Write Block ID – only with the requested Read Block ID (Even for a write request only). For the MVICMLI module to always receive the Read Block ID means indirectly that the CLX controller fulfils the write request (as well as the read request). Write Data Area CLX controller / Read Data Area MVICMLI: The requested COMLI data (I/O, Register, Telegram Block, Telegram Control Block or Configuration Block data) from the CLX controller to the MVICMLI module. This received COMLI data (one block of data, 128 words) has to be moved/copied to another location by the MVICMLI module to protect it from being overwritten during the next reception from CLX controller. This moving/coping handling is already implemented in the Cprogram on the compact flash card. Reserved: Do not use. Reset: Word to reset the MVICMLI module to force it to boot up from scratch (start reading in the configuration block etc again). The word has to be set in the CLX ladder logics (not implemented in the provided RSLogix5000 sample application source code). Not Reset=0. Reset<>0. To avoid continuous resetting of the MVICMLI module the word has to be change to <>0 after the configuration block has been read by the MVICMLI module during its start up sequence. This handling is already implemented in the provided RSLogix5000 sample application source code. Communication Flag: Contain a value between 0-65535 (MVICMLI)/ 0=>32767, -32768=>-1 (CLX), which is set by the CLX controller to signalling that it has finished the requested MVICMLI module job and that the requested block ID (in word 0) data is placed in word 1-128 for the MVICMLI to read. For the MVICMLI module to know that the output image data is a reply from the controller to a given request the communication flag in the output image (set by the controller) will equals the value of the communication flag in the input image that was set by the MVICMLI module during its request. Hence, the MVICMLI module is comparing the communication flags in the input and output image after having doing its request. Whenever they equals the MVICMLI module will know that the CLX controller has fulfilled its job so the received data can be processed further. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 20 of 124 COMLI Module 1756-MVICMLI Overview MVICOMLI Function Communication Flow Chart The communication between the CLX controller and the MVICMLI module can be divided in two phases, which is illustrated in the flow chart on the next page. The two phases are: 1) Start up phase (configuration sequence) 2) Interactive communication phase Start up phase (assuming that the CLX controller is in RUN mode): The start up phase could be explained as a configuration part where the MVICMLI module will be configured to match the application needs according to the programmer (get hold of the defined blocks in the CLX program and initialised I/O and registers values). Whenever the CLX is powered up the MVICMLI module will begin to boot up and then automatically start the COMLI C-program on the compact flash. The first thing that will happen is that the MVICMLI will request the configuration block (42). The CLX controller will take notice (the communication flag changes in the input image) and puts the configuration data out to the output image for the MVICMLI module to read. If the configuration data says that the MVICMLI module should act as a master on one of the channels the MVICMLI module will then request telegram blocks (32-39) (the communication flag changes in the input image changes for every request). The CLX controller will again take notice and puts the telegram data out to the output image for the MVICMLI module to read. In case the MVICMLI module only will act as a slave no requests will be done for the mentioned telegram blocks. In the last start up step the MVICMLI will request for defined COMLI I/O and register area blocks (block 0-7; 8-31). This to read and prepare the initialisation of I/O and registers for other COMLI nodes on the network. The CLX program replies and the MVICMLI module will store this data to the next coming phase. Interactive communication phase: After having fulfilled the start up phase the MVCMLI module continues by transferring the initialised I/O and registers values to COMLI nodes and then the bidirectional communication will enter a continuous interactive phase where the MVICMLI module requests for the COMLI I/O and register area blocks (block 0-7; 8-31) according to the set up and the CLX controller makes replies to it. This procedure will continue as long as the system is up and running or until an user reset is activated (to force a new boot up of the MVCMLI module). Along with the mentioned requests the MVCMLI module will process, communicate and exchange data with connected COMLI network devices. If the user has enabled the telegram control in the set up the MVCMLI module will transmit master status block data to the CLX controller and read the telegram control block data from the CLX controller after every scan execution of the telegram blocks. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 21 of 124 COMLI Module 1756-MVICMLI Overview MVICOMLI Function MVICMLI module communication flow chart: Start Boot up and executes COMLI C-program Request Configuration Block nr 42 from CLX Receive Configuration Block nr 42 from CLX Master ? NO Start Up Phase YES Request Telegram Block nr 32-39 from CLX Receive Telegram Block nr 32-39 from CLX All Blocks ? NO YES Request defined COMLI I/O and Register Area Blocks (0-7; 8-31) from CLX Receive defined COMLI I/O and Register Area Blocks (0-7; 8-31) from CLX All Blocks ? NO YES Interactive Communication Phase Transmit/Receive COMLI I/O and Register Area Block data (0-7; 8-31) to/from COMLI network nodes (external com) Write or/and Read MVICMLI request of COMLI I/O and Register Area Block data (0-7; 8-31) to CLX Receive accomplished request of COMLI I/O and Register Area Block data (0-7; 8-31) from CLX TG Control ? NO YES Write MVICMLI request of Master Status Block data (40) to CLX and Read MVICMLI request of Telegram Control Block data (41) from CLX. Receive accomplished request of Master Status Block data (40) and Telegram Control Block data (41) from CLX. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 22 of 124 COMLI Module 1756-MVICMLI Overview MVICOMLI Function Communication Between the MVICMLI Module and COMLI Network Devices Along with the mentioned interactive communication phase the MVICMLI module will process, communicate and exchange data with connected network COMLI devices. If the MVICMLI module is configured as a master, then the module will execute the telegrams one by one. The module starts with Telegram 1. When Telegram 1 is completed or has timed out, then the module starts to execute Telegram 2. When all the telegrams have been executed once, then the module starts a new scan of the telegram blocks. With the telegram control block it is possible to decide in what way the telegrams should be executed – after every scan or at certain times. Observe that number of retransmits (due to time outs) of a message is 2 (3 with original message) and that no other messages are executed during the retransmit period of the current message. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 23 of 124 COMLI Module 1756-MVICMLI Overview Block Descriptions Block Descriptions Configuration Block [42] Block number 42 consists of configuration data for the MVICMLI module. The configuration data is set up by the programmer to meet the COMLI application requirements. Overview After system start (or reset) the module starts booting up. The set up phase begins and during that phase the module will be configured. Block 42 must be set up in the CLX program before the set up phase for the MVICMLI module begins. The MVICMLI module requests for block 42 (This is done by, in the input image, setting the Read Block ID to 42 and changing the communication flag from 0 to 1). The request will continue until the CLX controller replies a correct block. Led U1 and U2 are both lit during the set up phase. When correct data is received the module will be initiated with the parameters from block 42. The MVICMLI module will then allocate internal memory to be synchronized with the CLX controller and COMLI nodes. Block Description Block number 42 for the configuration of the MVICMLI module consists of 86 (0-85) words divided into: • Configuration data for port 2 (word 0-9). • Configuration data for port 3 (word 10-19). • Configuration data for the COMLI protocol handling (word 20-85). The following table show what words (parameters) that have to be configured for block 42. Word Parameter Description 0 Address 1 Format (in HEX format) 2 Baud Rate Nod address COMLI (0-247), Master=0, Slave=1-127. Nibble 3 2 1 0 Description 0 x x x Port disabled 1 x x x Master 2 x x x Slave x 7 x x Data 7 bits x 8 x x Data 8 bits x x 0 x NO parity x x 1 x ODD parity x x 2 x EVEN parity x x x 1 Stop 1 bit x x x 2 Stop 2 bits 300, 600, 1200, 2400, 4800, 9600 and 19200 3 Time out 4-9 - Publication 1756-MVICMLI - 2.2 June 2008.doc The time [ms] that the master waits for an answer from the slave before retransmitting the message (new request). Range 0-32767 ms. (0=Default=1000 ms) Number of retransmits is 2 (3 with original message). No other messages are executed during the retransmit period of the current message. Reserved – Do Not Use. Page 24 of 124 COMLI Module 1756-MVICMLI Overview Block Descriptions 10-19 Port 2 Configuration 20 Amount of Telegrams 21 Telegram Control 22-53 Write Block Index 54-85 Read Block Index Configuration for Port 2. See Port 1 (0-9). Amount of Telegrams. Maximum of 127 (1127). Value Description (Only for Master) 0 The control block is NOT used – deactivated. The telegrams are executed continuously – in every scan of the Telegram Blocks. 1 The control block is in use – activated. The Master Status Block (block 40) is transferred to the CLX and Telegram Control Block (41) is read from CLX after every completed scan of the telegram blocks. Block ID 0-31 for writing of COMLI block to the CLX controller5. Block ID 0-31 for reading of COMLI block from the CLX controller6 The sum of write and read blocks cannot exceed the maximum amount of 32. This means, for example, that if 30 blocks are configured for writing only 2 can be configured for reading. Index Configuration Example of the Configuration Block The following table shows an example of a write and read block index configuration of block 42. Word 22 23 24 25-53 54 55 56 57-85 Value 0 (write block) 8 (write block) -1 0 1 (read block) 9 (read block) -1 0 Description Block ID 0, first COMLI I/O block. Block ID 8, first COMLI Register block. Indicator for last used write block. Not in use. Block ID 1, second COMLI I/O block. Block ID 9, second COMLI Register block. Indicator for last used read block. Not in use. I/O bits have octal addressing and registers have decimal addressing in the COMLI network - see appendix B for more information. The corresponding addresses for the above configured write and read block indexes will therefore be: Word 22 23 54 55 Data Area Write I/O Write Register Read I/O Read Register Amount 2048 128 2048 128 COMLI address I/O 0-3777 (octal) Reg 0-127 I/O 4000-7777 Reg 128-255 5 Totally 32 blocks for writing and reading COMLI data between the MVICMLI module and the CLX controller. Use ’-1’ in the last used word to indicate end of used read and write blocks. 6 See note 5. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 25 of 124 COMLI Module 1756-MVICMLI Overview Block Descriptions Telegram Block [32-39] Block number 32-39 consists of telegram configuration data for the MVICMLI module. The telegram configuration data is set up by the programmer to meet the COMLI application requirements. Overview As mentioned before, after system start (or reset) the module starts booting up and the set up phase begins by a requesting Configuration Block [42]. After a successful CLX controller reply the MVICMLI module continues by requesting the Telegram Blocks if at least one of the ports are configured as a master (This is done by, in the input image, setting the Read Block ID to 32 and changing the communication flag from 0 to 1 for a reply and thereafter setting the Read Block ID to 33 and so forth until all telegram blocks are read.) The requests will continue until the CLX controller replies correct blocks. Led U1 and U2 are both lit during the set up phase. When correct data is received the module will be initiated with the parameters from block 32-39. The MVICMLI module will then allocate internal memory to be synchronized with the CLX controller and COMLI nodes. The number of Telegram Blocks that the module will read is defined by word 20 of the Configuration Block [42]. A maximum of 128 (1-128) telegrams can be used. One telegram uses 8 words, which means a maximum of 16 telegrams in each telegram block. Block Description Block number 32 –39 for the telegram configuration of the MVICMLI module consists of each 128 (0-127) words divided into (n=1, 17, 33, 49, 65, 81, 97, 113, depending of what telegram block one is referring to): • Telegram Configuration data for Telegram number n (word 0-7). • Telegram Configuration data for Telegram number n+1 (word 8-15). • Telegram Configuration data for Telegram number n+2 (word 16-23). • Telegram Configuration data for Telegram number n+3 (word 24-31). • Telegram Configuration data for Telegram number n+4 (word 32-39). • Telegram Configuration data for Telegram number n+5 (word 40-47). -------------------------------------------------------------------------------------------• Telegram Configuration data for Telegram number n+15 (word 119127). Hence, each telegram block (32-39) handles the following telegram numbers (1-128): • Block number 32 - telegram number 1-16. • Block number 33 - telegram number 17-32. • Block number 34 - telegram number 33-48. • Block number 35 - telegram number 49-64. • Block number 36 - telegram number 65-80. • Block number 37 - telegram number 81-96. • Block number 38 - telegram number 97-112. • Block number 39 - telegram number 113-128. Each telegram configured into each telegram block occupies 8 words, which include data information for port, slave address, request, source address, length, destination address, and two words that are reserved. The following table show what words (parameters) that have to be configured for block 32 (telegram blocks 33-39 are configured equivalent). Publication 1756-MVICMLI - 2.2 June 2008.doc Page 26 of 124 COMLI Module 1756-MVICMLI Overview Block Descriptions Word Parameter Description 0 Port 1 2 Slave Request 3 Source address 4 Length 5 Destination address 6-7 8-15 16-23 24-31 32-39 40-47 ------119127 Telegram 2 Telegram 3 Telegram 4 Telegram 5 Telegram 6 -------------Telegram 16 Select port 2 or 3. If a value <> 2 or 3 is entered the telegram is inactive. The COMLI slave address (1-247). 1=Read IO Bits (mult. of 8) 2=Read Register 11=Write IO Bit (single)/Bits (mult. of 8) 12=Write Register Address of the first element in the I/O7 or Register data area to read. Read request: The first address in the slave. Write request: The first address in the Master module (MVICMLI module). Number of elements to read or write. Use a multiple of 8 for a write or read IO bits request when to write or read up to 512 bits in one telegram. To write a single I/O bit the length must be equal to 1. Not possible to read a single I/O. Address of the first element in the I/O8 or Register data area to write. Read request: The first address in the Master module (MVICMLI module). Write request: The first address in the slave. Reserved-Do not use. See word 0-7 for Telegram 1. See word 0-7 for Telegram 1. See word 0-7 for Telegram 1. See word 0-7 for Telegram 1. See word 0-7 for Telegram 1. -----------------------------------See word 0-7 for Telegram 1. Explanation to write and read request: Write Request. Module Source address Slave Destination address Read Request Module Destination address Slave Source address 7 For several I/O bits (NOT single bit): enter the octal value (for example: 10 octal = 8 decimal). The value must be a multiple of 8. 8 See note 7. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 27 of 124 COMLI Module 1756-MVICMLI Overview Block Descriptions Configuration Example of the Telegram Blocks Below table illustrates some examples of telegrams and how these should be configured in the telegram blocks to work properly. Telegram Type MVICMLI Port Slave Type 1: Read I/O Bits (mult. of 8) Type 2: Read Register Type 11: Write I/O Bit (single)/Bits (mult. of 8) Type 12: Write Register Type 2: Read Slave Status 2 or 3 2 or 3 2 or 3 2 or 3 2 or 3 X X X X X Source Length Y Y Z Z 3000 8-512 1-32 1, 8-512 1-32 max. 73 Dest. V V W W V X: Enter the slave address. Y: Enter the first address in the slave’s data area where data should be read (to be sent to the master module MVICMLI). V: Enter the first address in the master module’s (MVICMLI) data area where data should be written. Z: Enter the first address in the master module’s (MVICMLI) data area where data should be read (to be sent to the slave). W: Enter the first address in the slave’s data area where data should be written. Telegram Notes Please note that ‘Read Master Status’ is not a pure COMLI telegram (therefore not defined in above table). It is a telegram in the way that it is used to transfer the Master Status Block [40] (status on defined telegrams) to the CLX controller. The COMLI protocol can handle (read/write) a maximum of 32 data registers or 512 I/O bits in one request (in one telegram). If the length (number of elements) not equals a multiple of 8 for read/write I/O bits or 1 for write single I/O bit, then the telegram is configured incorrectly and will not function. For the best performance on the network, you should try to reduce the number of different telegrams. Collect all the data into one table before it is transmitted to other units. Execution of the Telegram Blocks The execution of the Telegram Block is set by word 21 in the Configuration Block [42]. • If the word is set to ‘0’ the telegrams are executed one by one every time the Telegram Blocks are scanned. • If the word is set to ‘1’ the execution of the Telegram Blocks is controlled by the Telegram Control Block [41]. The Control Block [41] is read from the controller after every complete scan of the Telegram Blocks. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 28 of 124 COMLI Module 1756-MVICMLI Overview Block Descriptions Telegram Control Block [41] Block number 41 consists of telegram configuration data for the MVICMLI module. The telegram configuration data is set up by the programmer to meet the COMLI application requirements. Telegram control is additional – setting word 21 to ‘1’ in the configuration block [42] activates the telegram control (<>’1’ means deactivation of telegram control). Overview The internal memory for the telegram control on the MVICMLI module is initiated to ‘0’ during the set up phase (coursed by system start or reset) of the module (before the configuration block [42] is requested). After the configuration block [42] is read by the MVICMLI module word 21 is checked. If it is set to ‘1’ the telegram Control is activated, which means that and the MVICMLI module will request for the Telegram Control Block [41] from the CLX controller after every scan of the Telegram Blocks. Block Description Block number 41 for the telegram control configuration of the MVICMLI module consists of 127 (0-126) words, which the table below illustrates. Word Parameter Description 0 Telegram 1 Control function for telegram 1. 1 Telegram 2 Control function for telegram 2. --- --------------- ---------------------------------------- 126 Telegram 127 Control function for telegram 127. Each word represents the control function for each telegram (1-127). The following proper control functions values is selectable for the programmer: Control Function Description 0 Inactive telegram. 1 Continuous execution of the telegram. Telegram executed once only. (Scheduled execution - see notes). 2 Inactive telegram: No control activated for that specific telegram. Continuous execution of the telegram: The telegram is executed every scan of the Telegram Blocks. Telegram executed once only: The telegram is executed only during the first scan of the Telegram Block, when the value is set to ‘2’. After the execution the MVICMLI will internally set the control function to ‘0’. Observe, after having transferred the Telegram Control Block to the MVICMLI module the control function has to be set to ‘0’ in the CLX controller as well, otherwise the telegram will be executed continuously (since the MVICMLI requests for the Telegram Control Block after every completed telegram scan). This resetting (from ‘2’ to ‘0’) is already implemented in the provided RSLogix5000 sample application source code (it is done after the transfer of the Telegram Control Block to the output image - rung 10 in sub routine write data). Publication 1756-MVICMLI - 2.2 June 2008.doc Page 29 of 124 COMLI Module 1756-MVICMLI Overview Block Descriptions Telegram Control Notes Scheduled execution of telegrams (execution of telegrams periodically with a certain rate) is possible to define by using telegram control of type ‘2’ (executed only once) and to add some CLX program logics. The telegram control has also to be activated, of course. An example of scheduled telegrams for telegram 1-3 is already implemented in the provided RSLogix5000 sample application source code (see rung 1 and 2 in main routine, plus rung 10 in sub routine write data). The main idea is to use a timer and when its preset value (10sec for example) is reached the telegram control function in the Telegram Control Block is assigned ‘2’, which will be recognised by the MVICMLI module for execution and so on. While the timer is accumulating towards it preset value the telegram control will be set to ‘0’ – inactive, since the telegram control function in both the MVICMLI module and the CLX controller is reset to ‘0’ after the Telegram Control Block is transmitted to the output image. Having activated the telegram control it is recommendable to also use the Master Status Block [40] to get status from the MVICMLI module for each telegram (see next section and Telegram Notes in section ‘Telegram Block [32-39]’). Publication 1756-MVICMLI - 2.2 June 2008.doc Page 30 of 124 COMLI Module 1756-MVICMLI Overview Block Descriptions Master Status Block [40] Block number 40 consists of status information for each telegram that is configured. The block is used as a telegram by the programmer to collect telegram status from the MVICMLI module to the CLX controller. Overview The internal memory for the master status on the MVICMLI module is initiated to ‘0’ during the set up phase (coursed by system start or reset). To get the telegram status from the MVICMLI module (read the content of block 40 from it) the programmer must do the following: • Set up a unique telegram as shown in section ‘Telegram Block [32-39]’ under ‘Configuration Example of the Telegram Blocks’. • Activate the Telegram Control Block [41] by setting bit 21 in the Configuration Block [42] • Select ‘1’ in the word for the ‘master status telegram’ in the Telegram Control Block [41]. This courses the MVICMLI module to make a write request to the CLX controller of block 40 (in the input image: write block ID, word 1, equals 40 and write data area, word 3-130, contains the telegram status data) after every scan of the telegram blocks. In that way the CLX controller can read and collect the telegram diagnostics from the MVICMLI module and process it further. Block Description Block number 40 for the master status from MVICMLI module consists of 128 (0-127) words (located in the write data area, word 3-130 of the input image), which the table below illustrates. Word Description 0 Telegram block scan status. A bit toggles for each port configured as a master after a complete scan of the telegram block. Bit 0: Master Port 2 Bit 1: Master Port 3 Error code for Telegram 1 from the MVICMLI module or from the slave. Error code for Telegram 2 from the MVICMLI module or from the slave. -------------------------------------------------------------------------- 1 2 --127 Error code for Telegram 127 from the MVICMLI module or from the slave. Word ‘0’ indicates what port the status is accurate for. Word ‘1-127’ consists of the actual telegram status data in form of error codes. These error codes are presented in section ‘Error codes’ (in section ‘Diagnostics’). Master Status Notes Having activated the telegram control it is recommendable to also use the Master Status Block [40] to get status from the MVICMLI module for each telegram Publication 1756-MVICMLI - 2.2 June 2008.doc Page 31 of 124 COMLI Module 1756-MVICMLI Overview Diagnostics Diagnostics A part from the Master Status Block [41], which consists of diagnostic data for the telegrams, there are other diagnostics, which can be useful. Slave status can be requested together with error codes and LEDs on the MVICMLI display shows the overall status of the module. These diagnostics will be explained further in this section, starting with slave status. Slave Status for Port 2 and 3 It is possible to access diagnostics for the network COMLI slaves by defining a specific telegram for each port. This enables the MVICMLI module to send slave diagnostics to the CLX controller. Overview The internal memory for the slave diagnostics on the MVICMLI module is initiated to ‘0’ during the set up phase (coursed by system start or reset). To get the slave diagnostics from the MVICMLI module (force the MVICMLI module to write slave diagnostics out on word 133-142 and 143-152 in the input image) the programmer must do the following: • Set up an unique telegram as shown in section ‘Telegram Block [32-39]’ under ‘Configuration Example of the Telegram Blocks’. Having defined mentioned telegrams; the slave diagnostics will be located in word 133-142 (slaves on port 2) and 143-152 (slaves on port 3) of the input image. These words are updated for every MVICMLI module read/write request (whenever the communication flag in word 249 changes there will be updated slave diagnostics in word 133-142 and 143-152). In that way the CLX controller can read and collect the slave diagnostics from the MVICMLI module and process it further. Word Mirror Description The slave diagnostics on the MVICMLI module is located in internal memory addresses (initiated to ‘0’ during the set up phase). The MVICMLI module mirrors these to mentioned words in the input image: Word in MVICMLI Description Word in Input Image 3000-3009 Slave diagnostics on port 2. 133-142 3010-3019 Slave diagnostics on port 3. 143-152 Diagnostics Descriptions Each word represents the following diagnostics: Word in MVICMLI Diagnostics Description Word in Input Image 3000 Current status on port 2. 133 3001 Last error on port 2. 134 3002 Total number of messages received on port 2. Total number of messages sent by the slave on port 2 (received without error). 135 3003 Publication 1756-MVICMLI - 2.2 June 2008.doc 136 Page 32 of 124 COMLI Module 1756-MVICMLI Overview Diagnostics 3004 3005-3009 3010-3019 Total number of all messages on the network seen by the slave on port 2 (not only the messages addressed to the slave). Reserved-Not in use. Port 3 Slave status, identical to port 2 (word 3000-3009). 137 138-142 143-152 If no error messages are registered on the slave port then word 3002 is equal to word 3003. All message counters are set to 0 after 32767. The possible error codes in word 3001/134 and 3011/144 are presented in the next section ‘Error codes’. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 33 of 124 COMLI Module 1756-MVICMLI Overview Diagnostics Error Codes When using Master Status Block [40] word 4-130 of the input image will contain telegram status in form of error codes. Error codes are also seen for word 134 and 144 in the input image when requesting slave diagnostics. The table below shows the possible error codes for these words. Error Code Description 0 OK, normal function. 1 Protocol error on Port 2. 2 Protocol error on Port 3. 4 Reserved –Not in use. 8 Reserved –Not in use. 16 Time out. 32 Reserved –Not in use. 64 Error on Port 2. 128 Error on Port 3. 256 Error in Port Configuration. 512 Error in Module Configuration. 1024 Error in Telegram Control Block. 2048 CLX controller is not in RUN mode. 4096 8192 Error in communication between the MVICMLI module and the CLX controller. The MVICMLI module has failed to communicate with the CLX controller after 3 attempts. Checksum error on Port 2. 16384 Checksum error on Port 3. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 34 of 124 COMLI Module 1756-MVICMLI Overview Diagnostics LED’s The LED’s function of U1 and U2 on the MVI module is reprogrammed to fit the MVICMLI modules requirements - COMLI. The following alternatives functions can be seen for U1 and U2 when the MVICMLI is used: 1756-MVI: U1 (LED1) U2 (LED2) Description Normal function. Error in Module Configuration. Error in Port Configuration. General error during start up. During the configuration sequence. Error on Port 2. Verify Status Block. Error on Port 3. Verify Status Block. Communication error with the controller or controller NOT in RUN mode. Off Blink On The functions for the other LED:s on the status indicator display (P1, P2, P3, BATT and OK) are not reprogrammed. They functions as they originally do on a MVI module (Consult the document ControlLogix Multi-Vendor Interface Module, Installations Instruction, page 15). MVI56-ADM: APP BP SATTUS ACT Description Normal function. Error in Module Configuration. Error in Port Configuration. General error during start up. During the configuration sequence. Error on Port 1. Verify Status Block. Error on Port 2. Verify Status Block. Communication error with the controller or controller NOT in RUN mode. Off Blink On The functions for the other LED:s on the status indicator display (CFG, P1, P2, BATT and OK) are not reprogrammed. They functions as they originally do on a MVI module. CFG, P1, P2 Port Activity BATT Battery OK Module Status Publication 1756-MVICMLI - 2.2 June 2008.doc OFF GREEN OFF RED GREEN OFF RED No serial activity detected on corresponding port. Serial activity detected on corresponding port. Battery voltage normal. Battery voltage low. Service required. Power is ON. Normal Operation. Power is OFF or module is not installed. Module has failed. Service required. Page 35 of 124 COMLI Module 1756-MVICMLI Overview Resetting of the MVICMLI Module Resetting of the MVICMLI Module There may be times where the programmer wants to restart and reboot the MVICMLI module to, for instance, trigger a new configuration set up to the module. Word 246 in the output image works as the reset flag to trigger a reboot of the MVICMLI module. The word has to be set to ‘1’ (<>’0’) in the CLX program (not implemented in the provided RSLogix5000 sample application source code). The MVICMLI module will notice it whenever it reads the output image (when the communication flag in word 247 changes value). To avoid continuous resetting of the module the word has to be change to <>0 after the Configuration Block [42] is read by the MVICMLI module during its start up sequence. This handling is already implemented in the provided RSLogix5000 sample application source code. Remember, triggering the reset means that all internal memory of the MVICMLI module (including I/O and register area data) will be initiated to ‘0’. The equivalent data in the CLX controller however is not initiated to ‘0’ – it remains untouched. It is up to the programmer to decide whether or not his data should be initiated to ‘0’ or not. Observe, not resetting controller COMLI I/O and register data after having reset the MVICMLI module may result in having incorrect data, which for example could affect systems that reads this data. Word in Output Image Parameter Description 246 Reset If <> 0 the MVICMLI module will reboot and regenerate a new configuration request according to the start up phase/flow chart in section ‘MVICMLI Function’. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 36 of 124 ControlLogix Controller Program Overview Introduction ControlLogix Controller Program Overview Introduction This chapter describes the CLX program part of the COMLI protocol handling on a CLX platform. The provided RSLogix5000 sample application code is overviewed followed by a description of the data structures used in the sample code. Finally a set up procedure is presented for a successful implementation of the sample code into the COMLI application project. By reviewing coming information a programmer will be able to set up a CLX program that will serve as a proper configuration tool and communication interface between itself and the MVICMLI module. Throughout this chapter there are screen dumps from RSLogix5000, which hopefully makes it easier for the reader to understand the content. Please be aware of that attached screen dumps may differ slightly (comments, allocated data structures etc) from the ones found in the provided sample code. Overview of the Provided Sample Code The provided sample code, ‘MVICMLI_Sample_Proj_verX.ACD’, (where ‘X’ is version of RSLogix5000) is developed in programming software RSLogix5000 V10-V16 Industrial Software for Windows NT/2000 and the Allen Bradley Logix5000 Family of Controllers. The following hard copy shows the RSLogix5000 developing environment for the provided sample code. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 37 of 124 ControlLogix Controller Program Overview Data Structures Data Structures Own user defined data types are defined in the way to meat the MVICMLI/COMLI protocol requirements. The following data types can be seen: Each of them is explained in the following sections. Please note that one of the controller tags (explained later on) is an instance of the CMLModuleDef data structure. This controller tag is a internal variable, which is just for internal COMLI data storage and when defining MVICMLI module configuration data. A part from own defined configuration data, data written to this variable is collected (read) from the MVICMLI input image. Data that is transferred (written) to the MVICMLI output image is collected (read) from the same variable. CMLModuleDef The data structure CMLModuleDef is the main data structure. All other defined structures are included in this main structure as instances. The CMLModuleDef contains the following: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 38 of 124 ControlLogix Controller Program Overview Data Structures The first member, BPStatus, is an instance of CMLBackplane, which contain parameters for the communication flag and block ID. Remember, the communication flag value is increased for every MVICMLI request and can equal a value of 0-65535 (MVICMLI module), which will be shown in the controller program as 0=>32767, -32768=>-1. The second member, SlaveStatus, is an instance of CMLSlaveStatus, which contain parameters for slave diagnostics. The third member, SoftwareVersionMVIComli, is a two-word integer, which contain information on the C-program version of the MVICMLI compact flash. Members 4-9 are defined to create a mirror of the data, telegram, status, control and configuration blocks earlier described in the previous chapter: Block Number 0 – 7. (8) 8 – 31. (24) 32 – 39. (8) 40 41 42 Description COMLI I/O area COMLI Register Area Telegram Block Master Status Block Telegram Control Block Configuration Block Write to CLX X X X - Read from CLX X X X X X Hence, read block data from the MVICMLI module (COMLI I/O area for example) is stored in these data structures. Furthermore, data to be transferred from the CLX controller to the MVICMLI module has to be defined in these data structures (initiated data for the Configuration Block [42] for instance). The seventh member, ComliModuleMasterStatusBlock40, is a 128-word integer, which contain status information for each telegram. The eighth member, ComliModuleTelegramControlBlock41, is a 127-word integer, which contain the control function for each telegram, defined by the programmer. The ninth member, ComliModuleConfigBlock42, is an 86-word integer, which contain the configuration data for the MVICMLI module, defined by the programmer. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 39 of 124 ControlLogix Controller Program Overview Data Structures CMLAreaIOBlock The CMLAreaIOBlock (which should be compared with block nr 0-7, COMLI I/O area) contains the following: CMLAreaRegisterBlock The CMLAreaRegisterBlock (which should be compared with block nr 8-31, COMLI Register area) contains the following: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 40 of 124 ControlLogix Controller Program Overview Data Structures CMLBlackplane The CMLBackplane contains the following: LastBlockID: Last transferred block ID from the MVICMLI module input image (-1, 0-39, 40, 41 & 42). Observe, this could be either the block ID of a MVICMLI module read request or the block ID of a MVICMLI module write request. The content of the last block ID is assigned to the MVICMLI module´s output image after the CLX controller has accomplished its job (answered on a read/write MVICOMLI request). Remember, the CLX controller never replies with the requested Write Block ID – only the Read Block ID. LastComFlag: Last transferred communication flag from the MVICMLI module input image (inc 0-65535, which equals 0=>32767, -32768=>-1 in CLX). The content of the last communication flag is assigned to the MVICMLI module´s output image after the CLX controller has accomplished its job (answered on a read/write MVICOMLI request). The content of the last block ID is first written to the output image before the last communication flag is written to it. For further information, see section ‘Communication Interface Between the CLX Controller and the MVICMLI Module’ in the previous chapter. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 41 of 124 ControlLogix Controller Program Overview Data Structures CMLSlaveStatus The CMLSlaveStatus contains the following: ComliSlaveStatusPort2: Slave status for port nr 2 of the MVICMLI module. ComliSlaveStatusPort3: Slave status for port nr 3 of the MVICMLI module. For further information, see section ‘Slave Status for Port 2 and 3’ in the previous chapter. CMLTelegramBlock The CMLTelegramBlock (which should be compared with block nr 32-39, Telegram Block) contains the following: For further information, see section ‘Telegram Block [32-39]’ in the previous chapter. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 42 of 124 ControlLogix Controller Program Overview Data Structures FaultRecord This data structure is used for a variable that handles the major fault record for the CLX controller (used in power-up handling program). So, it has nothing to do with the COMLI data structures etc, unless the COMLI program code etc generates a major fault. The major fault record is defined like this: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 43 of 124 ControlLogix Controller Program Overview Controller Tags Controller Tags Several controller tags have been defined for the purpose to be used in the CLX program. Tag CML1 uses data types earlier described above. See appendix A for more information on how the CMLI tag corresponds to the input (Local:2:I) and output (Local:2:O) tags. The following controller tags is used: Each of them will be described hereafter. Observe that the screen dumps sometimes show preconfigured tags for the set up of the MVICMLI module. In the user application this data has to be adjusted to fit for the actual requirements. Observe, if the MVI56-ADM is used in a remote chassis and not locally in the same chassis as the CLX processor then the ‘Local’ tags will be replaced by tags with the name of the remote Ethernet/ControlNet bridge. For example, if the MVI56-ADM is located in a remote chassis in slot 5 together with a 1756ENBT bridge module named ‘Remote_ENBT’ then the corresponding MVI56-ADM tags will be ‘Remote_ENBT:5:I.Data’, ‘Remote_ENBT:5:O.Data’ and ‘Remote_ENBT:5:C.Data’. CML1 It was told earlier that one of the controller tags is an instance of the CMLModuleDef data structure. This tag is CML1 and it is defined like this: As can be seen it is structured like the CMLModuleDef data structure. This tag has a great impact of the handling of COMLI data from and to the MVICMLI module. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 44 of 124 ControlLogix Controller Program Overview Controller Tags Some of the tag elements are ment to be assigned by the user during the configuring process (to be read by the MVICMLI module during its start up phase) others are meant to be collected (slave status or COMLI I/O data for example) or assigned (COMLI IO and Register Data) by additional program code. There is also a tag which is used for backplane handshaking communication between the CLX controller and the MVICMLI module. Tag elements used for configure the COMLI application/MVICMLI module The following tag elements are used for user COMLI configuration (which is read by the MVICMLI module during its start up phase). Telegram Blocks CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock32 … CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock39 Configure each telegram block for the specific COMLI application, for example like: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 45 of 124 ControlLogix Controller Program Overview Controller Tags Telegram Control Block CML1.ComliModuleTelegramControlBlock41 Configure the telegram control block for the specific COMLI application, for example like: Configuration Block CML1.ComliModuleConfigBlock42 Configure the configuration block for the specific COMLI application, for example like: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 46 of 124 ControlLogix Controller Program Overview Controller Tags Tag elements used for collecting COMLI diagnostics/status from the MVICMLI module The following tag elements are used for collecting COMLI diagnostics from COMLI nodes including the MVICMLI module. Slave Status CML1.SlaveStatus Slave status for port 2 and 3 is read from the MVICMLI module and is then presented in the following tags (eqvivalent for port 3): Software Version MVICMLI module CML1.SoftwareVersionMVIComli The software version of the C-program on the MVICMLI module is read from the MVICMLI module and is then presented in the following tags: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 47 of 124 ControlLogix Controller Program Overview Controller Tags Master Status Block CML1.ComliModuleMasterStatusBlock40 The master status block contains telegram status, which is read from the MVICMLI module and is presented in the following tag: For possible error code see section ‘Error Codes’ in the previous chapter. Tag elements used for exchanging COMLI data between the CLX controller and the MVICMLI module The following tag elements are used for exchanging COMLI data in form of COMLI I/O and registers between the CLX controller and the MVICMLI module. Remember, both tags is both readable (data from other COMLI nodes transferred from the MVICMLI module) and writable (data to other COMLI nodes transferred to the MVICMLI module). The user define which should be readable/writeable by its configuration of the telegram block. COMLI IO Block CML1.ComliModuleAreaIOBlock0to7 Readable/Writeable COMLI I/O data is presented/assigned in the following tag: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 48 of 124 ControlLogix Controller Program Overview Controller Tags COMLI Register Block CML1.ComliModuleAreaRegisterBlock8to31 Readable/Writeable COMLI Register data is presented/assigned in the following tag: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 49 of 124 ControlLogix Controller Program Overview Controller Tags Tag element used for backplane handshaking communication between the CLX controller and the MVICMLI module The following tag element is used for synchronize communication between the CLX controller program and the MVICMLI module - handshaking tag element. Backplane Status CML1.BPStatus Local:2:C Not in use. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 50 of 124 ControlLogix Controller Program Overview Controller Tags Local:2:I and Local:2:O The CLX controller and the MVICMLI module communicates with each other by help of the CLX backplane and a set of input and output moduledefined variables. When selecting the ‘1756-MODULE’ for the I/O configuration in RSLogix5000 these variables are automatically defined for the MVICMLI module to be able to communicate with the CLX controller. Some features for its data types are expected to be configured by the user (this will be explained later on in this chapter). Mentioned variables are: Input variable for the MVICMLI module Local:2:I This variable (input image of the MVICMLI module) is used by the CLX controller to READ data from the MVICMLI module. It is defined like this: Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 51 of 124 ControlLogix Controller Program Overview Controller Tags Continued… The MVICMLI module uses an image of the input variable ‘Local:2:I’ to send requests and transfer data to the CLX controller. If the MVICMLI module writes to its input image the CLX controller gets the same result in its input variable. In section ‘Communication Interface Between the CLX Controller and the MVICMLI Module’ in previous chapter the MVICMLI module’s input image was described: Word 0 1 2 3-130 131-132 133-142 143-152 153-248 249 Description Reserved Request Write Block ID (-1, 0-31, 40) Request Read Block ID (-1, 0-39, 41 & 42) Write Data Area MVICMLI / Read Data Area CLX controller Product Version (C-program Version on MVICMLI) Slave Status Port 2 Slave Status Port 3 Reserved Communication Flag (MVICMLI module: inc 0-65535, CLX: 0=>32767, -32768=>-1) Amount 1 1 1 128 2 10 10 96 1 Compare its structure with the structure in ‘Local:2:I’ and it will be obvious that they are a like. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 52 of 124 ControlLogix Controller Program Overview Controller Tags Output variable for the MVICMLI module Local:2:O This variable (output image of the MVICMLI module) is used by the CLX controller to WRITE data to the MVICMLI module. It is defined like this: Continued… Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 53 of 124 ControlLogix Controller Program Overview Controller Tags The MVICMLI module uses an image of the output variable ‘Local:2:O’ to read CLX controller responses on requests. If the CLX controller writes to its output variable the MVICMLI module gets the same result in its output image. In section ‘Communication Interface Between the CLX Controller and the MVICMLI Module’ in previous chapter the MVICMLI module’s output image was described: Word 0 1-128 129-245 246 247 Description Read Block ID (-1, 0-39, 41 & 42) Write Data Area CLX controller / Read Data Area MVICMLI Reserved Reset MVICMLI module Communication Flag (MVICMLI module: inc 0-65535, CLX: 0=>32767, -32768=>-1) Amount 1 128 117 1 1 Compare its structure with the structure in ‘Local:2:I’ and it will be obvious that they are a like. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 54 of 124 ControlLogix Controller Program Overview Controller Tags MJFAULTS The power-up handling routine is responsible for clearing major faults during CLX power-up to ensure normal operation of the CLX controller. The variable ‘MJFAULTS’ is used in this routine to get and clear the system major fault record. It is defined like this: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 55 of 124 ControlLogix Controller Program Overview Program Tags Program Tags There is only one program tag and it used for the purpose of enabling scheduled execution of telegram 1-3 (rung 1 & 2 in the main routine). The tag is a timer and it defined like this: Again, observe that the screen dumps sometimes show preconfigured tags. The preset value above should be adjusted for the actual application requirements. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 56 of 124 ControlLogix Controller Program Overview Ladder Logic Ladder Logic The ladder logics can be divided in two types of programs, power-up handler and main program. The power-up handler is implemented to ensure normal operation of the CLX controller and to initialise COMLI dependent data to ensure proper synchronisation with the MVICMLI module. The main program, which includes four routines, handles the COMLI communication only. Comments for each program routine are included in the ladder logics. Power-Up Handler A ‘PU_Handling_Routine’ is implemented to ensure normal operation of the CLX controller and to initialise COMLI dependent data to ensure proper synchronisation with the MVICMLI module. The following comments and ladder logics can be seen: ‘POWER-UP HANDLING ROUTINE THIS ROUTINE IS RESPONSIBLE FOR CLEARING MAJOR FAULTS FOR THE CONTROLLER TO OPERATE NORMALLY. IT IS ALSO RESPONSIBLE FOR INITIALISE COMLI DEPENDENT DATA. 1. Clearing major faults. Get the major fault information: TimeLow (lower 32 bits of fault timestamp value) TimeHigh (upper 32 bits of fault timestamp value) Type (fault type (program, I/O, etc.) Code (unique code for the fault (depends on fault type) Info (fault specific information (depends on fault type and code) Prepare to clear the major fault: Clearing type and code values. Clear the major fault: Set system value’ Publication 1756-MVICMLI - 2.2 June 2008.doc Page 57 of 124 ControlLogix Controller Program Overview Ladder Logic Continued… ‘2. Clearing COMLI dependent data a) Clearing last block id and communication flag b) Clearing the local output variable for COMLI (MVICOMLI module’s output image. This will affect both the local variable ' Local:2:O.Data[0] - [246]'and the MVICMLI module’s output image. Note that Word 246 in the output image (Local:2:O.Data[246]) will be set to 0 (NO resetting) => If a reset of the MVICMLI module has been ordered (Local:2:O.Data[246]<>0) it will now be prepared to avoid continuously resetting the MVICMLI module.’ Publication 1756-MVICMLI - 2.2 June 2008.doc Page 58 of 124 ControlLogix Controller Program Overview Ladder Logic MainProgram The MAIN Program is built up by four routines which together handles the MVICMLI requests: One of these is the main routine. The others are sub routines, which are called from the main routine. The sub routines are responsible for handling specific tasks. Each of the routines will now be presented. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 59 of 124 ControlLogix Controller Program Overview Ladder Logic MainRoutine The main routine is mainly responsible for recognize MVICMLI module requests and to handle these by calling its sub routines, which fulfils the request. There are also ladder that enables scheduled execution of telegram 1-3 (which makes it possible to execute telegram 1-3 periodically with rate of 10 seconds approximately). This rungs can be erased if no scheduled telegrams will be used in the application or it can be edited for further adjustments. The following comments and ladder logics can be seen: ‘MAIN ROUTINE THE MAIN PURPOSE OF THE COMLI MAIN ROUTINE IS TO RECOGNISE THE PRESENCE OF NEW MVICMLI MODULE REQUESTS AND TO HANDLE THESE BY CALLING SUB ROUTINES FOR BOTH READING AND WRITING DATA FROM AND TO THE MVICMLI MODULE AND TO SIGNAL THAT THE REQUEST IS ACCOMPLISHED. RUNG 0 When new data is recognized (MVICMLI´s communication flag in input image <> last controller’s read communication flag) the requested read and write Comli Block ID are read and then the sub routine ReadData and WriteData are called to execute. The new MVICMLI´s communication flag in the input image range from 065535 (0=>32767, -32768=>-1 in CLX) and is incremented for every new MVICMLI request. When the communication flag has reached 65535 (-1 in CLX) it rolls over and starts from 0 again. Before the sub routines are called the following is checked and done: -The new read communication flag is stored locally in ' CML1.BPStatus.LastComFlag' . This variable will be used later on when the controller makes its response to the MVICMLI module due to the new request - to signal to the MVICMLI module that requested data is placed in the output image and is available to be read (due to a MVICMLI module read request) or just to signal that data is stored in controller (due to a MVICMLI module write request). - Thereafter the input image is checked for a READ REQUEST from the MVICMLI module. If the word doesn' t equals "-1" (no read request) the MVICMLI module has generated a read request (Block ID 0-31 or 40). Before the sub routine for read is called and executed the requested read Block ID is stored in ' CML1.BPStatus.LastBlockID' . This variable will be used in the read sub routine to evaluate proper controller data storage location for the requested write Block ID' s data from the MVICMLI module. - Thereafter the input image is checked for a WRITE REQUEST from the MVICMLI module. If the word doesn' t equals "-1" (no write request) the MVICMLI module has generated a write request (Block ID 0-39, 41 or 42). Before the sub routine for write is called and executed the requested write Block ID is stored in ' CML1.BPStatus.LastBlockID' . This variable will be used in the write sub routine to evaluate proper controller data that is associated with the requested write Block ID. The controller will then respond to the MVICMLI module with this data. -Having handled the read and write requests the CLX controller will signal to the MVICMLI module that these requests are accomplished. This is done by calling sub routine ' RequestAccomplished' . After that the MVICMLI module is free to request new data again and so force. Further comments: So the read and write Block ID from the MVICMLI module are read and stored to be used in the sub routines later on. If the read Block ID equals ' -1'it means that there is no read request (the MVICMLI doesn' t want to read data from the controller). If the write Block ID equals ' -1'it means that there is no write request (the MVICMLI doesn' t want to write data to the controller). If the write Block ID or/and read Block ID do equals proper defined Block ID:s (0-31 or 40 for write, 0-39 or 41 or 42 for read) the sub routines are called upon these requests. In the beginning of the start up phase for the MVICMLI module there will only be read request from the MVICMLI module due to its configuration sequence (Block ID 42 will always be read first, then 32-39 if the port is defined as a master). After the start up phase the interactive communication phase begins and will do so as long as the system is up and running or until a user reset is activated (<>0). During this phase there will usually be both read and write requests depending on the application set up. Hence, both read and write Block ID is present in one and the same block transfer, which means that both the read and write sub routine are called to execute in the same controller scan when the communication flag changes state. Please be aware of that if the Publication 1756-MVICMLI - 2.2 June 2008.doc Page 60 of 124 ControlLogix Controller Program Overview Ladder Logic request both contains a read and write request the variable ' CML1.BPStatus.LastBlockID'will be over written (from first containing the Block ID for read and then the Block ID for write) before the write sub routine is called. Again, for every new MVICMLI request the communication flag is changed (accumulated upwards).’ Please note when and in what order the sub routines are called to execute (first read data, then write data and finally request accomplished). ‘RUNG 1 & 2 These rungs enables scheduled execution of telegram 1-3 - makes it possible to execute telegram 1-3 periodically with rate of 10 seconds approximately. Having defined that telegram control is used (CML1.ComliModuleConfigBlock42[21]=1) the MVICMLI module will request for Block ID 41 - Telegram Control Block to verify how each defined telegram should be executed (0=Telegram inactive, 1=Telegram continuous executed, 2=Telegram executed once). Assume that telegram 1-3 is assigned ' 2'- executed only ones. These telegrams will then be executed only during the first scan of the telegram block. After execution the MVICMLI module will set the control function to ' 0'(inactive) internally, which mean that it will no longer be executed. Observe, since the MVICMLI module sets the control function to ' 0'this will also needs to be set in the CLX controller program otherwise the telegram will be executed continuously because the telegram control block is read by the MVICMLI module after every scan of the telegram blocks (if any assignments of ' 2'it will be executed again etc). This is already solved - see ' Writing Telegram Control Block 41 To MVICMLI Module 'in sub routine ' WriteData'(the assignment of ' 2'is exchange by ' 0'for each telegram in ' CML1.ComliModuleTelegramControlBlock41' ). Assume that the application needs telegrams that executes periodically per a certain rate - scheduled telegrams (telegrams that is not critical in time). For example, by assigning telegram 1-3 ' 2'for every 10sec it will be notified by the MVICMLI module when it reads block ID 41. Telegram 1-3 will then be executed once and thereafter assigned to ' 0'automatically. However when the accumulated timer below has reached 10sec the assignment will again be ' 2'(' 2'is copied to CML1.ComliModuleTelegramControlBlock41[0]-[2]) and the MVICMLI module will notice it for execution and so force. Hence, rung 1 & 2 will make sure that the telegram 1-3 will be assigned ' 2'for every 10seconds and will therefore be executed by that time approximately. In the time between the telegrams will be assigned ' 0'- inactive. RUNG 1 & 2 COULD BE ERASED IF NO SCHEDULED TELEGRAMS WILL BE USED IN THE APPLICATION. OR THEY COULD BE EDITED FOR FURTHER ADJUSTMENTS.’ Publication 1756-MVICMLI - 2.2 June 2008.doc Page 61 of 124 ControlLogix Controller Program Overview Ladder Logic Publication 1756-MVICMLI - 2.2 June 2008.doc Page 62 of 124 ControlLogix Controller Program Overview Ladder Logic ReadData The read data sub routine is responsible for taking care of write requests from the MVICMLI module. For each requested block id data is read from the MVICMLI module’s input image and stored internally in predefined COMLI CLX controller variables earlier described in this chapter. The software version of the C-program on the MVICMLI module and slave status is always read when this sub routine is executed. The following comments and ladder logics can be seen: ‘Sub Routine ReadData THIS ROUTINE IS RESPONSIBLE FOR TRANSFERRING MVICMLI MODULE DATA FROM THE INPUT IMAGE TO THE CLX CONTROLLER, DUE TO A WRITE REQUEST BY THE MVICMLI MODULE. Data is read from the MVICMLI module’s input image (Local:2:I.Data[x]) and stored in declared COMLI CLX controller variables. Code that reads and stores the software version of the C-program on the MVICMLI module and slave status is implemented as well.’ ’ Continued… Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 63 of 124 ControlLogix Controller Program Overview Ladder Logic Publication 1756-MVICMLI - 2.2 June 2008.doc Page 64 of 124 ControlLogix Controller Program Overview Ladder Logic WriteData The write data sub routine is responsible for taking care of read requests from the MVICMLI module. For each requested block id internal predefined COMLI CLX controller variable values are assigned to the MVICMLI module’s output image. There is also ladder code for preventing continuous execution of telegrams that should be executed only once and continuous resetting of the MVICMLI module after it has been reset. The following comments and ladder logics can be seen: ‘Sub Routine WriteData THIS ROUTINE IS RESPONSIBLE FOR TRANSFERRING CLX CONTROLLER DATA TO THE MVICMLI MODULE OUTPUT IMAGE, DUE TO A READ REQUEST FROM THE MVICMLI MODULE. Data is written from internal COMLI CLX controller variables to the MVICMLI module’s output image (Local:2:O.Data[x]). Code to prevent continuous execution of telegrams that should be executed only once and continuous resetting of the MVICMLI module after it has been reset is implemented as well.’ Continued… Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 65 of 124 ControlLogix Controller Program Overview Ladder Logic Continued… Continued… Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 66 of 124 ControlLogix Controller Program Overview Ladder Logic Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 67 of 124 ControlLogix Controller Program Overview Ladder Logic RequestAccomplished The request accomplished sub routine is responsible for taking care of the CLX controller signalling of having accomplished MVICMLI read and write requests. Hence, making the final handshaking to the MVICMLI module saying that the request is fulfilled. Whenever the MVICMLI module has read the output image it is free to make the next request to the CLX controller. The following comments and ladder logics can be seen: ‘Sub Routine Request Accomplished THIS ROUTINE IS RESPONSIBLE FOR TRANSFERRING THE CONTROLLER SIGNALS FOR ACCOMPLISHED MVICMLI REQUEST. THIS IS DONE BY WRITING THE REQUESTED BLOCK ID AND FINALLY THE LAST READ COMMUNICATION FLAG TO THE MVICMLI OUTPUT IMAGE. HOW THIS IS DONE DEPENDS ON THE TYPE OF MVICMLI REQUEST - IF THE REQUEST CONTAINS ONLY A READ REQUEST OR A READ AND A WRITE REQUEST.’ Continued… Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 68 of 124 ControlLogix Controller Program Overview Program Set Up Guide Program Set Up Guide This section will present a procedure example on how to apply the provided RSLogix5000 COMLI project into the user application. The ControlLogix controller sample project source code on CD-ROM, 1756MVICMLISETUPCDROM, REV 2.2, June 2008, actually contains two types of projects (where ‘X’ is version of RSLogix5000): • ‘MVICMLI_Sample_Proj_verX.ACD’ Users that like to take advantage of the user defined data type ‘CMLModuleDef’ should use this project. Controller tag: • ‘MVICMLI_Sample_Proj_split_verX.ACD’ Users that DO NOT like to take advantage of the user defined data type ‘CMLModuleDef’ should use this project. Controller tags: The program code is equivalent for both projects. The addressing is done to fit the controller tags. So, it up to the user to decide on which project to use. Observe, having opened the provided sample code one could see that the 1756-MVICMLI module is configured to be positioned in slot number 2. Hence, all program code is based on the same (addressing ‘Local:2:C’and ‘Local:2:O’). If the module is placed in another slot the program code has to be adjusted to fit the actual position. Furthermore, if the MVI56-ADM is used in a remote chassis and not locally in the same chassis as the CLX processor then the ‘Local’ tags should be renamed to the name of the remote bridge module. For example, if the MVI56-ADM is located in a remote chassis in slot 5 together with a 1756-ENBT bridge module named ‘Remote_ENBT’ then the tags ‘Local:2:I.Data’, ‘Local:2:O.Data’and ‘Local:2:C.Data’ must be renamed to ‘Remote_ENBT:5:I.Data’, ‘Remote_ENBT:5:O.Data’ and ‘Remote_ENBT:5:C.Data’. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 69 of 124 ControlLogix Controller Program Overview Program Set Up Guide Step by Step Procedure 1. Start by opening the user application project and the provided sample project in separate RSLogix5000 sessions (use the same version of RSLogix5000). If for example the user application is of version 16 then open ‘MVICMLI_Sample_Proj_ver16.ACD’ / ‘MVICMLI_Sample_Proj_split_ver16.ACD’. 2. In the user application project: Add a generic 1756-module in the I/O Configuration and make the following configurations: a. Publication 1756-MVICMLI - 2.2 June 2008.doc Local use of 1756-MVICMLI Page 70 of 124 ControlLogix Controller Program Overview Program Set Up Guide OBSERVE!!! Comm Format MUST equal ‘Data – INT’. Input Assembly Instance MUST equal: 1 Output Assembly Instance MUST equal: 2 Configuration Assembly Instance MUST equal: 3 Input Size MUST equal ‘250’. Output Size MUST equal ‘248’. Configuration Size MUST equal ‘0’ (Why? Due to what it is covered in section ‘Communication Interface Between the CLX Controller and the MVICMLI Module’ in chapter ‘COMLI Module 1756-MVICMLI Overview‘.) The RPI value could be changed to fit the application. Typical updates are in the range of 2-10ms. b. Publication 1756-MVICMLI - 2.2 June 2008.doc Remote use of 1756-MVICMLI via Ethernet Page 71 of 124 ControlLogix Controller Program Overview Program Set Up Guide (or 1756-EN2T) (or 1756-EN2T) Publication 1756-MVICMLI - 2.2 June 2008.doc Page 72 of 124 ControlLogix Controller Program Overview Program Set Up Guide OBSERVE!!! Name: Enter a name that is easy to relate to the 1756-MVICMLI module (‘Remote_ENBT’ for example). Remember, the corresponding 1756-MVICMLI tag will be named like this. Comm Format MUST equal ‘Rack Optimization’. Slot: X Chassis size: X Revision: X, X IP-address: X.X.X.X Electronic Keying: ‘Compatible Keying’. OBSERVE!!! RPI: 20ms (use default) Publication 1756-MVICMLI - 2.2 June 2008.doc Page 73 of 124 ControlLogix Controller Program Overview Program Set Up Guide OBSERVE!!! Comm Format MUST equal ‘Data – INT’. Input Assembly Instance MUST equal: 1 Output Assembly Instance MUST equal: 2 Configuration Assembly Instance MUST equal: 3 Input Size MUST equal ‘250’. Output Size MUST equal ‘248’. Configuration Size MUST equal ‘0’ Publication 1756-MVICMLI - 2.2 June 2008.doc Page 74 of 124 ControlLogix Controller Program Overview Program Set Up Guide OBSERVE!!! RPI: 2-10ms 3. In the provided project: Make adjustments on the user defined data types to fit the needs for the application project and to minimize the allocation of memory. Delete for example members of a data type that will not be used in the application project (especially members in ‘CMLAreaIOBlock’ and ‘CMLAreaRegisterBlock’). 4. In the provided project: Make adjustments on the program files to fit the needs of the application project and to minimize the allocation of memory. Delete for example rung 1 and 2 in ‘MainRoutine’ if no scheduled telegrams will be used. Add rungs if needed. 5. Copy the user defined data types from the provided project and paste them into the application project (drag and drop can be used). Publication 1756-MVICMLI - 2.2 June 2008.doc Page 75 of 124 ControlLogix Controller Program Overview Program Set Up Guide 6. In the provided project: Export all project tags and save it on a file (‘Tools=>Export Tags…’): 7. In the user application project: Import all project tags from the previously saved file (‘Tools=>Import Tags…’): 8. Copy the Power Up handler routine ‘PU_Handling_Routine’ from the provided project and past it into the application project (drag and drop can be used). If a Power Up handler routine already exists in the application project, copy and past only the rungs. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 76 of 124 ControlLogix Controller Program Overview Program Set Up Guide 9. Copy the Main program routines (‘MainRoutine’, ‘ReadData’, ‘RequestAccomplished’ and ‘WriteData’) and past them into the application project (drag and drop can be used). Make appropriate adjustments to fit for the user application. Make sure that the sub routines are called by the rungs in ‘MainRoutine’. 10. After having installed the module, made the accurate cable connections, and applied the provided project sample code, all that remains is to set up the configuration COMLI tags and adjust the program to fit overall system application requirements - add program code for control of incoming and outgoing COMLI data and add additional program code. Several COMLI examples of hardware configurations and corresponding RSLogix5000 configurations are presented in appendix C. Please review these – they could be at great help. Led & Port Information Leds on the MVI56-ADM differ a bit from what can be seen on the 1756-MVI. Both modules have three RJ45 ports. Serial ports are marked as follows: MVI56-ADM 1756-MVI 1 CFG P1 2 P1 P2 3 P2 P3 Observe, when referring to MVI56-ADM´s physical port P1 in terms of configuration (defining telegrams etc) then port #2 should be entered. This is due to that the COMLI program on the compact flash was originally written for the 1756-MVI module. Of the same reason ADM´s physical port P2 is reached by enter port #3. Good Practice Users must take the following into consideration when using the 1756MVICMLI package: • Use compact flash card together with MVI56-ADM. • Use proper COMLI files on compact flash card - ver 2.2. • Use proper MVI56-ADM firmware - 1.2. • Use proper MVI56-ADM image file - ‘MVIboot.IMA’. • Place the provided sample code in the continuous task or in a periodic task. o Avoid placing the code in the continuous task if the scan time of the continuous task exceeds 50ms. o Instead, use a periodic task of 2-50ms (not slower). • Use a typical MVI56-ADM RPI time of 2 -10ms. Fast RPI means faster handle of telegrams. • For remote use: Use default RPI of 20ms and rack opt. for remote ENBT/2T com card. Actually it does not matter what the RPI setting is, since a direct connection is used to the MVI56-ADM, so it is the RPI of the MVI56-ADM that counts. It should be set to 2-10ms. • Keep the amount of telegrams as few as possible. • Good system performance has been seen when using the following configuration settings: o Periodic task of <=10ms o MVI56-ADM RPI=2-10ms (2ms best update) o Remote 1756-ENBT/2T RPI of 20ms (default; rack opt.) Publication 1756-MVICMLI - 2.2 June 2008.doc Page 77 of 124 Appendix A – CLX COMLI Variables/Tags and Local Input Appendix A – CLX COMLI Variables/Tags and Local Input/Output images Publication 1756-MVICMLI - 2.2 June 2008.doc Page 78 of 124 Appendix A – CLX COMLI Variables/Tags and Local Input CLX Controller COMLI variables/tags CLX Controller Local:2:I Local:2:I.Data[0] Local:2:I.Data[1] Local:2:I.Data[2] Reserved Request Write Block ID (-1, 0-31, 40) Request Read Block ID (-1, 0-39, 41 & 42) Local:2:I.Data[3]-[130] Write Data Area MVICMLI/Read Data Area CLX controller CML1.SoftwareVersionMVIComli[0]-[1] Local:2:I.Data[131]-[132] Product Version (C-program Version on MVICMLI) CML1.SlaveStatus.ComliSlaveStatusPort2[0]-[9] CML1.SlaveStatus.ComliSlaveStatusPort3[0]-[9] Local:2:I.Data[133]-[142] Local:2:I.Data[143]-[152] Local:2:I.Data[153]-[248] Local:2:I.Data[249] Slave Status Port 2 Slave Status Port 3 Reserved Com Flag (inc 0-65535; 0=>32767, -32768=>-1 in CLX) CML1.BPStatus.LastBlockID COMLI I/O Area CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock0[0]-[127] CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock1[0]-[127] CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock2[0]-[127] CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock3[0]-[127] CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock4[0]-[127] CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock5[0]-[127] CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock6[0]-[127] CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock7[0]-[127] COMLI Register Area CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock8[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock9[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock10[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock11[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock12[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock13[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock14[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock15[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock16[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock17[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock18[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock19[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock20[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock21[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock22[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock23[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock24[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock25[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock26[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock27[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock28[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock29[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock30[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock31[0]-[127] Master Status Block CML1.ComliModuleMasterStatusBlock40 CML1.BPStatus.LastComFlag Publication 1756-MVICMLI - 2.2 June 2008.doc Page 79 of 124 Appendix A – CLX COMLI Variables/Tags and Local Input CLX Controller COMLI variables/tags CLX Controller Local:2:O CML1.BPStatus.LastBlockID Local:2:O.Data[0] Read Block ID (-1, 0-39, 41 & 42) Local:2:O.Data[1]-[128] Write Data Area CLX controller / Read Data Area MVICMLI N/A Local:2:O.Data[246] Reset CML1.BPStatus.LastComFlag Local:2:O.Data[247] Com Flag (inc 0-65535; 0=>32767, -32768=>-1 in CLX) COMLI I/O Area CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock0[0]-[127] CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock1[0]-[127] CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock2[0]-[127] CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock3[0]-[127] CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock4[0]-[127] CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock5[0]-[127] CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock6[0]-[127] CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock7[0]-[127] COMLI Register Area CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock8[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock9[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock10[0]-[127] ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock29[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock30[0]-[127] CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock31[0]-[127] Telegram Block CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock32 CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock33 CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock34 CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock35 CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock36 CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock37 CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock38 CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock39 Telegram Control Block CML1.ComliModuleTelegramControlBlock41 Configuration Block CML1.ComliModuleConfigBlock42 Publication 1756-MVICMLI - 2.2 June 2008.doc Page 80 of 124 Appendix B – MVICMLI Block ID and IO/Register address areas Appendix B – MVICMLI Block ID and IO/Register address areas Please note, I/O bits have octal addressing and registers have decimal addressing in the COMLI network. Therefore, use the shaded octal address areas for corresponding Block ID when configuring the MVICMLI module in RSLogix5000. Furthermore, the below IO/Register address areas yells for both port 2 and 3. MVICMLI address areas: Block ID CMLI module 0 1 2 3 4 5 6 7 IO address CMLI module (dec) 0-2047 2048-4095 4096-6143 6144-8191 8192-10239 10240-12287 12288-14335 14336-16383 Block ID CMLI module 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Reg address CMLI module (dec) 0-127 128-255 256-383 384-511 512-639 640-767 768-895 896-1023 1024-1151 1152-1279 1280-1407 1408-1535 1536-1663 1664-1791 1792-1919 1920-2047 2048-2175 2176-2303 2304-2431 2432-2559 2560-2687 2688-2815 2816-2943 2944-3071 IO address CMLI module (octal) 0-3777 4000-7777 10000-13777 14000-17777 20000-23777 24000-27777 30000-33777 34000-37777 Note that some MVICMLI register addresses for block 31 are reserved for slave diagnostics: Block ID CMLI module Description Word in Input Image 3000-3009 Slave diagnostics on port 2 133-142 3010-3019 Slave diagnostics on port 3 143-152 Publication 1756-MVICMLI - 2.2 June 2008.doc Page 81 of 124 Appendix C – Configuration Examples Appendix C – Configuration Examples Several examples of hardware configurations and corresponding RSLogix5000 configurations are presented in this appendix. The objective of presenting this is to make the configuration set up more understandable for the user so he/she successfully can make similar configuration in his/her own application. The table below show seven different examples of configurations that could be used with the MVICMLI. For each of them an example is presented. Each example will be presented more in detail on the following pages. Ex nr 1 2 3 4 Master MVI port 2 MVI port 2 SattCon 15 OP45 Node Master 0 0 0 0 Interface RS232 (point-to-point) RS232 (point-to-point) RS232 (point-to-point) RS485 (multidrop) 5 MVI port 3 0 RS485 (multidrop) 6 SattCon 15 MVI port 3 0 0 RS232 (point-to-point) RS485 (multidrop) 7 MVI port 2 OP45 0 0 RS232 (point-to-point) RS485 (multidrop) Slave SattCon 15 SattCon 15 MVI port 2 MVI port 3 OP45 OP45 OP45 MVI port 2 OP45 OP45 SattCon 15 MVI port 3 OP45 Node Slave 5 5 6 14 12 11 12 6 11 12 5 14 12 Telegram Control No Yes No No No No No No No No No No No Refer to appendix A for help with RSLogix5000 Tags and Local Input/Output images. Refer to appendix B for help with MVICMLI Block ID and IO/Register address areas. Please remember the following when setting up the configuration and telegram blocks: Port numbers on MVI56-ADM versus 1756-MVI When referring to MVI56-ADM´s physical port P1 in terms of configuration (defining telegrams etc) then port #2 should be entered. This is due to that the COMLI program on the compact flash was originally written for the 1756MVI module. Of the same reason ADM´s physical port P2 is reached by enter port #3. Please be aware that all examples in this appendix was originally written for the 1756-MVI. That includes the table above. Length • • When entering the length (number of elements to read/write) for registers it must be defined as a decimal value – amount of words. When entering the length (number of elements to read/write) for IO it must be defined as a decimal value – amount of bits. Use a multiple of 8 for a write or read IO bits request when to write or read up to 512 bits in one telegram. To write a single I/O bit the length must be equal to 1. Not possible to read a single I/O. If the length not equals a multiple of 8 for read/write I/O bits or 1 for write single I/O bit, then the telegram is configured incorrectly and will not function. Source & Destination Address • When entering the source/destination address (first address in master/slave) for registers it must be defined as a decimal value. • When entering the source/destination address (first address in master/slave) for IO it must be defined as an octal value. Maximum amount of blocks, telegrams and data registers/IO • The sum of write and read blocks cannot exceed the maximum amount of 32. This means, for example, that if 28 blocks are configured for writing only 4 can be configured for reading. For the best performance on the network, you should try to reduce the number of different telegrams. Collect all the data into one table before it is transmitted to other units. (Use ’-1’ to indicate end of used read/write blocks.) • A maximum of 128 (1-128) telegrams can be used. • The COMLI protocol can read/write a maximum of 32 data registers or 512 I/O bits in one request (telegram). Publication 1756-MVICMLI - 2.2 June 2008.doc Page 82 of 124 Appendix C – Configuration Examples Example nr 1 Ex nr Master 1 MVI port 2 Node Master Interface Slave 0 RS232 (point-to-point) SattCon 15 Node Slave Telegram Control 5 No Function: Write master register and IO values to the slave. Read slave register and IO values to the master. The values that are written to the slave are read back to the CLX. Telegram Tg 1 Tg 2 Tg 3 Tg 4 Telegrams and corresponding CLX tags and master/slave data areas Master data area CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock9[0]-[127] 128-129 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock1[0]-[127] 4000-4177 CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock8[0]-[127] 0-1 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock0[0]-[127] 0-177 CLX Tag Slave data area 0-1 (2 words) 0-177 (128 bits; 8 words) 0-1 (2 words) 0-177 (128 bits; 8 words) Configuration Set Up data: Nod Address: 0 Port 2: Master Data bits: 8 Parity: ODD (1) Stop bits: 1 Baud rate: 9600 Time out: 1000ms Number of Telegrams: 4 Telegram Control: No Block ID nr 9 – Write Register Block ID nr 1 – Write IO Block ID nr 8 – Read Register Block ID nr 0 – Read IO (’-1’ - Indicator for last used write/read block.) Configuration Block 42 (CML1.ComliModuleConfigBlock42[0]-[85]): Word Parameter Description 0 1 Address Format (in HEX format) Nod address Master=0 Nibble 3 2 1 0 1 x x x Description Master x 8 x x Data 8 bits x x x x 1 x x 1 ODD parity Stop 1 bit 2 3 4-9 10-19 20 21 22 23 24 25-53 54 55 56 57-85 Baud Rate Time out Port 2 Configuration Amount of Telegrams Telegram Control Write Block Index Write Block Index Write Block Index Write Block Index Read Block Index Read Block Index Read Block Index Read Block Index 9600 1000 ms Reserved – Do Not Use. NOT IN USE. 4 0 0 8 -1 NOT IN USE. 1 9 -1 NOT IN USE. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 83 of 124 Appendix C – Configuration Examples Continued… Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 84 of 124 Appendix C – Configuration Examples Telegram Block (CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock32[0]-[127]): Continued… Telegram Control Block (CML1.ComliModuleTelegramControlBlock41[0]-[3]): The telegram control is not enabled. Therefore the MVICMLI module will not request the telegram control block 41 from the CLX. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 85 of 124 Appendix C – Configuration Examples Ladder Logic: Use the provided RSLogix5000 sample application source code. Data values in corresponding CLX tags during communication: Register data that is written to the slave SattCon 15 system: IO data that is written to the slave SattCon 15 system: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 86 of 124 Appendix C – Configuration Examples Register data that is read from the slave SattCon 15 system: IO data that is read from the slave SattCon 15 system: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 87 of 124 Appendix C – Configuration Examples Example nr 2 Ex nr Master 2 MVI port 2 Node Master Interface Slave 0 RS232 (point-to-point) SattCon 15 Node Slave Telegram Control 5 YES Function: Same as in example nr1 but telegram control is added for two of the telegrams. Telegram nr 1 and 2 (write Register and IO to slave) will be scheduled to execute with a periodic rate of 10 seconds approximately. Telegram nr 3 and 4 will still be executed continuously. Configuration Set Up data: Same as in example nr 1 but telegram control is enabled. Telegram Control: YES Configuration Block 42 (CML1.ComliModuleConfigBlock42[0]-[85]): Word Parameter Description 0 1 Address Format (in HEX format) Nod address Master=0 Nibble 3 2 1 0 1 x x x Description Master x 8 x x Data 8 bits x x x x 1 x x 1 ODD parity Stop 1 bit 2 3 4-9 10-19 20 21 22 23 24 25-53 54 55 56 57-85 Baud Rate Time out Port 2 Configuration Amount of Telegrams Telegram Control Write Block Index Write Block Index Write Block Index Write Block Index Read Block Index Read Block Index Read Block Index Read Block Index 9600 1000 ms Reserved – Do Not Use. NOT IN USE. 4 1 0 8 -1 NOT IN USE. 1 9 -1 NOT IN USE. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 88 of 124 Appendix C – Configuration Examples Having defined CML1.ComliModuleConfigBlock42[21]=1 the MVICMLI module will request for Block ID 41 - Telegram Control Block to verify how each defined telegram should be executed (0=Telegram inactive, 1=Telegram continuous executed, 2=Telegram executed once). Telegram Block (CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock32[0]-[127]): Same as in example nr 1. Telegram Control Block (CML1.ComliModuleTelegramControlBlock41[0]-[3]): Telegram 1-2 is assigned ' 2'- executed only ones. The MVICMLI module will request for this Block ID 41 since telegram control is defined in the Configuration Block 42. By assigning ‘2’ for every 10 sec the MVICMLI will execute these telegrams as if they were (from scratch) configured to be executed periodically with a rate of 10 seconds app. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 89 of 124 Appendix C – Configuration Examples Ladder Logic: Use the provided RSLogix5000 sample application source code but make two adjustments. First, in rung 10 of the sub routine ‘WriteData’, change length to equal 2 (instead of 3): Telegram 1 and 2 will be executed only during the first scan of the telegram block. After execution the MVICMLI module will set its internal control function to ' 0'(inactive), which mean that it will no longer execute the telegram. However, after every scan of the telegram blocks the MVICMLI module is requesting and receiving the content of the Telegram Control Block 41. If the content is still ‘2’ the MVICMLI module will act up upon it and execute that telegram. It will result in continuous execution of telegram even if the MVICMLI module internally reset its control function to ‘0’ after every execution. So, to prevent the continuous execution to happen the CLX controller variable for telegram control (' CML1.ComliModuleTelegramControlBlock41[0]-[1]' ) must be reset to ‘0’ whenever the MVICMLI module sets its internal control function to ‘0’. The program code above make this reset for telegram nr 1 and 2. Second, in rung 2 of the routine ‘MainRoutine’, change length to equal 2 (instead of 3): Remember, the MVICMLI module request for the telegram control block after every completed telegram scan. By assigning telegram 1-2 ' 2'for every 10sec the MVICMLI module will be notified when it reads block ID 41. Telegram 1-2 will then be executed once and thereafter assigned to ' 0'(by the program code in rung 10 of the sub routine ‘WriteData’). As long as the telegram control for telegram 1-2 is assigned ‘0’ they will not be executed. However when the accumulated timer ‘TelegramControlTimer’ has reached 10sec (10000ms) the assignment will again be ' 2' (' 2'is copied to CML1.ComliModuleTelegramControlBlock41[0]-[2]) and the telegrams will be executed again and so force. Hence, rung 1 & 2 will make sure that the telegram 1-2 will be assigned ' 2'for every 10seconds and will therefore be executed by that time approximately. In the time between (when the timer is timing) the telegrams will be assigned ' 0'– inactive (no execution). Publication 1756-MVICMLI - 2.2 June 2008.doc Page 90 of 124 Appendix C – Configuration Examples Example nr 3 Ex nr Master 3 SattCon 15 Node Master Interface Slave 0 RS232 (point-to-point) MVI port 2 Node Slave Telegram Control 6 No Function: Write master register and IO values to the slave. Read slave register and IO values to the master. Telegram - Telegrams and corresponding CLX tags and master/slave data areas Master data area CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock8[0]-[127] 0-3 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock3[0]-[127] 0-77 CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock10[0]-[127] 4-7 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock2[0]-[127] 100-177 CLX Tag Slave data area 0-3 (4 words) 14000-14077 (64 bits; 4 words) 256-259 (4 words) 10000-10077 (64 bits; 4 words) Observe, the configuration of the telegrams is done on the master node and NOT on the slave node. Hence, the telegram configuration in this example is done on the SattCon 15 (not presented here) and NOT on the MVI (CLX). Hence, the CLX tag ‘CML1.ComliModuleTelegramBlock32to39’ will be empty (all zero´s). However, on the slave node it is still required to define corresponding write/read block ID nr that will be used by the telegrams. Configuration Set Up data: Nod Address: 6 Port 2: Slave Data bits: 8 Parity: ODD (1) Stop bits: 1 Baud rate: 19200 Time out: 1000ms Number of Telegrams: 0 (defined on the master side instead – SattCon 15) Telegram Control: No Block ID nr 8 – Read Register Block ID nr 3 – Read IO Block ID nr 10 – Write Register Block ID nr 2 – Write IO (’-1’ - Indicator for last used write/read block.) Configuration Block 42 (CML1.ComliModuleConfigBlock42[0]-[85]): Word Parameter Description 0 1 Address Format (in HEX format) Nod address Slave=6 Nibble 3 2 1 2 x x 2 3 4-9 10-19 20 21 22 23 24 25-53 54 55 56 57-85 Baud Rate Time out Port 2 Configuration Amount of Telegrams Telegram Control Write Block Index Write Block Index Write Block Index Write Block Index Read Block Index Read Block Index Read Block Index Read Block Index 0 x Description Slave x 8 x x Data 8 bits x x x x 1 x x 1 ODD parity Stop 1 bit 19200 1000 ms Reserved – Do Not Use. NOT IN USE. 0 0 3 8 -1 NOT IN USE. 2 10 -1 NOT IN USE. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 91 of 124 Appendix C – Configuration Examples Continued… Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 92 of 124 Appendix C – Configuration Examples Telegram Block (CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock32[0]-[127]): All zeros! This configuration is done on the master node – the SattCon 15 system (MVICMLI will not request this block from the CLX). Telegram Control Block (CML1.ComliModuleTelegramControlBlock41[0]-[3]): The telegram control is controlled by the master, so no configuration is done in this block (MVICMLI will not request this block from the CLX). Ladder Logic: Use the provided RSLogix5000 sample application source code, but make three adjustments. First, in the sub routine ‘ReadData’, add a rung that will read IO data for block id nr 3 from the input image: (Corresponding rung should already exist for block id nr 8.) Publication 1756-MVICMLI - 2.2 June 2008.doc Page 93 of 124 Appendix C – Configuration Examples Second, in the sub routine ‘WriteData’, add a rung that will write IO data for block id nr 2 to the output image: Third, in the sub routine ‘WriteData’, add a rung that will write register data for block id nr 10 to the output image: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 94 of 124 Appendix C – Configuration Examples Data values in corresponding CLX tags during communication: Register data that is read from the master SattCon15 system: IO data that is read from the master SattCon15 system: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 95 of 124 Appendix C – Configuration Examples Register data that is written to the master SattCon15 system: IO data that is written to the master SattCon15 system: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 96 of 124 Appendix C – Configuration Examples Example nr 4 Ex nr Master 4 OP45 Node Master Interface 0 RS485 (multidrop) Slave MVI port 3 OP45 Node Slave Telegram Control 14 No 12 No Function: Write master register and IO values to the slaves. Read slave register and IO values to the master. In this example only the configuration for the MVI is presented (not for the master and the other slave). Telegram - Telegrams and corresponding CLX tags and master/slave data areas Master data area CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock14[0]-[127] 0-5 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock6[0]-[127] 0-117 CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock13[0]-[127] 6-7 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock7[0]-[127] 120-217 CLX Tag Slave MVI 14 data area 768-773 (6 words) 30000-30117 (80 bits, 5 words) 640-641 (2 words) 34000-34077 (64 bits; 4 words) Observe, the configuration of the telegrams is done on the master node and NOT on the slave node. Hence, the telegram configuration in this example is done on the SattCon 15 (not presented here) and NOT on the MVI (CLX) or the other slave. Hence, the CLX tag ‘CML1.ComliModuleTelegramBlock32to39’ will be empty (all zeros). However, on the slave node it is still required to define corresponding write/read block ID nr that will be used by the telegrams. That yells for both slaves. Configuration Set Up data: Nod Address: 14 Port 2: Slave Data bits: 8 Parity: ODD (1) Stop bits: 1 Baud rate: 19200 Time out: 1000ms Number of Telegrams: 0 (defined on the master side instead – SattCon 15) Telegram Control: No Block ID nr 14 – Read Register Block ID nr 6 – Read IO Block ID nr 13 – Write Register Block ID nr 7 – Write IO (’-1’ - Indicator for last used write/read block.) Configuration Block 42 (CML1.ComliModuleConfigBlock42[0]-[85]): Word Parameter Description 0 1 Address Format (in HEX format) Nod address Slave=0 Nibble 3 2 1 2 x x 2 3 4-9 10-19 20 21 22 23 24 25-53 54 55 56 57-85 Baud Rate Time out Port 2 Configuration Amount of Telegrams Telegram Control Write Block Index Write Block Index Write Block Index Write Block Index Read Block Index Read Block Index Read Block Index Read Block Index 0 x Description Slave x 8 x x Data 8 bits x x x x 1 x x 1 ODD parity Stop 1 bit 19200 1000 ms Reserved – Do Not Use. NOT IN USE. 0 0 6 14 -1 NOT IN USE. 7 13 -1 NOT IN USE. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 97 of 124 Appendix C – Configuration Examples Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 98 of 124 Appendix C – Configuration Examples Telegram Block (CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock32[0]-[127]): All zeros! This configuration is done on the master node – the SattCon 15 system (MVICMLI will not request this block from the CLX). Telegram Control Block (CML1.ComliModuleTelegramControlBlock41[0]-[3]): The telegram control is controlled by the master, so no configuration is done in this block (MVICMLI will not request this block from the CLX). Ladder Logic: Use the provided RSLogix5000 sample application source code, but make four adjustments. First, in the sub routine ‘ReadData’, add a rung that will read register data for block id nr 14 from the input image: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 99 of 124 Appendix C – Configuration Examples Second, in the sub routine ‘ReadData’, add a rung that will read IO data for block id nr 6 from the input image: Third, in the sub routine ‘WriteData’, add a rung that will write register data for block id nr 13 to the output image: Fourth, in the sub routine ‘WriteData’, add a rung that will write IO data for block id nr 7 to the output image: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 100 of 124 Appendix C – Configuration Examples Data values in corresponding CLX tags during communication: Register data that is read from the master SattCon 15 system: IO data that is read from the master SattCon 15 system: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 101 of 124 Appendix C – Configuration Examples Register data that is written to the master SattCon 15 system: IO data that is written to the master SattCon 15 system: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 102 of 124 Appendix C – Configuration Examples Example nr 5 Ex nr Master 5 MVI port 3 Node Master Interface 0 RS485 (multidrop) Slave OP45 OP45 Node Slave Telegram Control 11 No 12 No Function: Write master register and IO values to the slaves. Read slave register and IO values to the master. In this example the configuration for the MVI is presented only (not for the both slaves). Telegram Tg 1 Tg 2 Tg 3 Tg 4 Tg 5 Tg 6 Telegram Tg 7 Tg 8 Tg 9 Tg 10 Telegrams and corresponding CLX tags and master/slave data areas Master data area CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock30[0]-[127] 2816-2847 CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock30[0]-[127] 2848-2879 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock5[0]-[127] 24000-24777 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock5[0]-[127] 25000-25777 CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock23[0]-[127] 1920-1921 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock4[0]-[127] 20000-20017 CLX Tag Master data area CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock29[0]-[127] 2688-2689 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock2[0]-[127 10000-10040 CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock22[0]-[127] 1792-1799 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock3[0]-[127] 14000-14177 CLX Tag Configuration Set Up data: Nod Address: 0 Port 3: Master Data bits: 8 Parity: EVEN (2) Stop bits: 1 Baud rate: 19200 Time out: 1000ms Number of telegrams: 10 Telegram Control: No Block ID nr 30 – Write Register Block ID nr 5 – Write IO Block ID nr 23 – Read Register Block ID nr 4 – Read IO Block ID nr 29 – Write Register Slave OP45 11 data area 0-31 (32 words) 32-63 (32 words) 0-777 (512 bits, 32 words) 1000-1777 (512 bits,32 words) 64-65 (2 words) 1000-1017 (16 bits, 1 word) Slave OP45 12 data area 255-256 (2 words) 0-40 (32 bits, 2 words) 260-267 (8 words) 100-177 (64 bits, 4 words) Block ID nr 2 – Write IO Block ID nr 22 – Read Register Block ID nr 3 – Read IO (’-1’ - Indicator for last used write/read block.) Configuration Block 42 (CML1.ComliModuleConfigBlock42[0]-[85]): Word Parameter Description 0 1 Address Format (in HEX format) Nod address Slave=0 Nibble 3 2 1 1 x x 2 3 4-9 10-19 20 21 22 23 24 25 26 27-53 54 55 56 57 58 59-85 Baud Rate Time out Port 2 Configuration Amount of Telegrams Telegram Control Write Block Index Write Block Index Write Block Index Write Block Index Write Block Index Write Block Index Read Block Index Read Block Index Read Block Index Read Block Index Read Block Index Read Block Index 0 x Description Master x 8 x x Data 8 bits x x x x 2 x x 1 EVEN parity Stop 1 bit 19200 1000 ms Reserved – Do Not Use. NOT IN USE. 10 0 3 4 22 23 -1 NOT IN USE. 2 5 29 30 -1 NOT IN USE. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 103 of 124 Appendix C – Configuration Examples Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 104 of 124 Appendix C – Configuration Examples Telegram Block (CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock32[0]-[127]): Continued… Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 105 of 124 Appendix C – Configuration Examples Continued… Telegram Control Block (CML1.ComliModuleTelegramControlBlock41[0]-[3]): The telegram control is not enabled. Therefore the MVICMLI module will not request the telegram control block 41 from the CLX. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 106 of 124 Appendix C – Configuration Examples Ladder Logic: Use the provided RSLogix5000 sample application source code, but make four adjustments. First, in the sub routine ‘ReadData’, add a rung that will read register data for block id nr 23 from the input image: Second, in the sub routine ‘ReadData’, add a rung that will read IO data for block id nr 4 from the input image: Third, in the sub routine ‘ReadData’, add a rung that will read register data for block id nr 22 from the input image: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 107 of 124 Appendix C – Configuration Examples Fourth, in the sub routine ‘ReadData’, add a rung that will read IO data for block id nr 3 from the input image: Fifth, in the sub routine ‘WriteData’, add a rung that will write register data for block id nr 30 to the output image: Sixth, in the sub routine ‘WriteData’, add a rung that will write IO data for block id nr 5 to the output image: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 108 of 124 Appendix C – Configuration Examples Seventh, in the sub routine ‘WriteData’, add a rung that will write register data for block id nr 29 to the output image: Eighth, in the sub routine ‘WriteData’, add a rung that will write IO data for block id nr 2 to the output image: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 109 of 124 Appendix C – Configuration Examples Data values in corresponding CLX tags during communication: Register data that is written to the OP45, slave 11: Continued… Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 110 of 124 Appendix C – Configuration Examples IO data that is written to the OP45, slave 11: Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 111 of 124 Appendix C – Configuration Examples Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 112 of 124 Appendix C – Configuration Examples Register data that is read from the OP45, slave 11: IO data that is read from the OP45, slave 11: Register data that is written to the OP45, slave 12: IO data that is written to the OP45, slave 12: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 113 of 124 Appendix C – Configuration Examples Register data that is read from the OP45, slave 12: IO data that is read from the OP45, slave 12: Publication 1756-MVICMLI - 2.2 June 2008.doc Page 114 of 124 Appendix C – Configuration Examples Example nr 6 Ex nr Master 6 SattCon 15 MVI port 3 Node Master Interface Slave 0 RS232 (point-to-point) MVI port 2 0 RS485 (multidrop) OP45 OP45 Node Slave 6 11 12 Telegram Control No No No Function: For both MVI ports: Write master register and IO values to the slaves. Read slave register and IO values to the master. In this example only the configuration for the MVI is presented (not for the other nodes). Tg Telegrams and corresponding CLX tags and master/slave data areas Master SattCon 15 data area CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock8[0]-[127] 0-3 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock6[0]-[127] 0-77 CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock10[0]-[127] 4-7 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock7[0]-[127] 100-177 CLX Tag - Slave MVI port 2 nod 6 data area 0-3 (4 words) 30000-30077 (64 bits; 4 words) 256-259 (4 words) 34000-34077 (64 bits; 4 words) Observe, the configuration of the telegrams is done on the master node and NOT on the slave node. Hence, the telegram configuration in this example (Comli network on port 2) is done on the master SattCon 15 (not presented here) and NOT on the slave MVI (CLX). Hence, the CLX tag ‘CML1.ComliModuleTelegramBlock32to39’ would be empty (all zero´s) if port 3 was not used for master functionality, which is the case in this overall example. On the slave node, however, it is still required to define corresponding write/read block ID nr that will be used by the telegrams. Tg Tg 1 Tg 2 Tg 3 Tg 4 Tg 5 Tg 6 Tg Tg 7 Tg 8 Tg 9 Tg 10 Telegrams and corresponding CLX tags and master/slave data areas Master MVI port 3 data area CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock30[0]-[127] 2816-2847 CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock30[0]-[127] 2848-2879 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock5[0]-[127] 24000-24777 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock5[0]-[127] 25000-25777 CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock23[0]-[127] 1920-1921 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock4[0]-[127] 20000-20017 CLX Tag Master data area CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock29[0]-[127] 2688-2689 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock2[0]-[127 10000-10040 CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock22[0]-[127] 1792-1799 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock3[0]-[127] 14000-14177 CLX Tag Configuration Set Up data: Nod Address: 6 Port 2: Slave Data bits: 8 Parity: ODD (1) Stop bits: 1 Baud rate: 19200 Time out: 1000ms Slave OP45 11 data area 0-31 (32 words) 32-63 (32 words) 0-777 (512 bits, 32 words) 1000-1777 (512 bits, 32 words) 64-65 (2 words) 1000-1017 (16 bits, 1 word) Slave OP45 12 data area 255-256 (2 words) 0-40 (32bits, 2 words) 260-267 (8 words) 100-177 (64 bits, 4 words) Nod Address: 0 Port 3: Master Data bits: 8 Parity: EVEN (2) Stop bits: 1 Baud rate: 19200 Time out: 1000ms Number of Telegrams: 10 Telegram Control: No Block ID nr 8 – Read Register Block ID nr 6 – Read IO Block ID nr 10 – Write Register Block ID nr 7 – Write IO Block ID nr 30 – Write Register Block ID nr 5 – Write IO Block ID nr 23 – Read Register Block ID nr 4 – Read IO Block ID nr 29 – Write Register Block ID nr 2 – Write IO Block ID nr 22 – Read Register Block ID nr 3 – Read IO (’-1’ - Indicator for last used write/read block.) Publication 1756-MVICMLI - 2.2 June 2008.doc Page 115 of 124 Appendix C – Configuration Examples Configuration Block 42 (CML1.ComliModuleConfigBlock42[0]-[85]): Word Parameter Description 0 1 Address Format (in HEX format) Nod address Slave=6 Nibble 3 2 1 2 x x 2 3 4-9 10 11 12 13 14-19 20 21 22 23 24 25 26 27 28 29-53 54 55 56 57 58 59 60 61-85 Baud Rate Time out Address Format (in HEX format) Baud Rate Time out Amount of Telegrams Telegram Control Write Block Index Write Block Index Write Block Index Write Block Index Write Block Index Write Block Index Write Block Index Write Block Index Read Block Index Read Block Index Read Block Index Read Block Index Read Block Index Read Block Index Read Block Index Read Block Index 0 x Description Slave x 8 x x Data 8 bits x x x x 1 x x 1 ODD parity Stop 1 bit 19200 1000 ms Reserved – Do Not Use. Nod address Master=0 Nibble 3 2 1 0 1 x x x Description Master x 8 x x Data 8 bits x x x x 2 x x 1 EVEN parity Stop 1 bit 19200 1000 ms Reserved – Do Not Use. 10 0 3 4 6 8 22 23 -1 NOT IN USE. 2 5 7 10 29 30 -1 NOT IN USE. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 116 of 124 Appendix C – Configuration Examples Continued… Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 117 of 124 Appendix C – Configuration Examples Publication 1756-MVICMLI - 2.2 June 2008.doc Page 118 of 124 Appendix C – Configuration Examples Telegram Block (CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock32[0]-[127]): Continued… Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 119 of 124 Appendix C – Configuration Examples Continued… Telegram Control Block (CML1.ComliModuleTelegramControlBlock41[0]-[3]): The telegram control is not enabled. Therefore the MVICMLI module will not request the telegram control block 41 from the CLX. Ladder Logic and Data values in corresponding CLX tags during communication: Use the provided RSLogix5000 sample application source code, but make adjustments as in example nr 3 and nr 5. Data values can also be seen in mentioned examples. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 120 of 124 Appendix C – Configuration Examples Example nr 7 Ex nr Master 7 MVI port 2 OP45 Node Master Interface Slave 0 RS232 (point-to-point) SattCon 15 0 RS485 (multidrop) MVI port 3 OP45 Node Slave 5 14 12 Telegram Control No No No Function: For both MVI ports: Write master register and IO values to the slaves. Read slave register and IO values to the master. In this example only the configuration for the MVI is presented (not for the other nodes). Telegrams and corresponding CLX tags and master/slave data areas Master MVI port 2 data area CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock9[0]-[127] 128-129 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock1[0]-[127] 4000-4177 CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock31[0]-[127] 2944-2945 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock0[0]-[127] 0-177 Slave Sattcon15 5 data area 8-9 (2 words) 0-177 (128 bits; 8 words) 10-11 (2 words) 200-377 (128 bits; 8 words) Telegrams and corresponding CLX tags and master/slave data areas Master OP45 data area CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock14[0]-[127] 0-5 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock6[0]-[127] 0-117 CML1.ComliModuleAreaRegisterBlock8to31.CMLAreaRegisterBlock13[0]-[127] 6-7 CML1.ComliModuleAreaIOBlock0to7.CMLAreaIOBlock7[0]-[127] 120-217 Slave MVI port 3 14 data area 768-773 (6 words) 30000-30117 (80 bits, 5 words) 640-641 (2 words) 34000-34077 (64 bits; 4 words) Tg Tg 1 Tg 2 Tg 3 Tg 4 CLX Tag Tg - CLX Tag Observe, the configuration of the telegrams is done on the master node and NOT on the slave node. Hence, the telegram configuration in this example (Comli network on port 3) is done on the master OP45 (not presented here) and NOT on the slave MVI (CLX). Hence, the CLX tag ‘CML1.ComliModuleTelegramBlock32to39’ would be empty (all zeros) if port 2 was not used for master functionality, which is the case in this overall example. On the slave node, however, it is still required to define corresponding write/read block ID nr that will be used by the telegrams. Configuration Set Up data: Nod Address: 0 Port 2: Master Data bits: 8 Parity: ODD (1) Stop bits: 1 Baud rate: 9600 Time out: 1000ms Nod Address: 14 Port 3: Slave Data bits: 8 Parity: ODD (1) Stop bits: 1 Baud rate: 19200 Time out: 1000ms Number of Telegrams: 4 Telegram Control: No Block ID nr 31 – Read Register Block ID nr 0 – Read IO Block ID nr 9 – Write Register Block ID nr 1 – Write IO Block ID nr 13 – Write Register Block ID nr 7 – Write IO Block ID nr 14 – Read Register Block ID nr 6 – Read IO (’-1’ - Indicator for last used write/read block.) Publication 1756-MVICMLI - 2.2 June 2008.doc Page 121 of 124 Appendix C – Configuration Examples Configuration Block 42 (CML1.ComliModuleConfigBlock42[0]-[85]): Word Parameter Description 0 1 Address Format (in HEX format) Nod address Master=0 Nibble 3 2 1 0 1 x x x Description Master x 8 x x Data 8 bits x x x x 1 x x 1 ODD parity Stop 1 bit 9600 1000 ms Reserved – Do Not Use. Nod address Slave=14 Nibble 3 2 1 0 2 x x x Description Master x 8 x x Data 8 bits x x x x 1 x x 1 ODD parity Stop 1 bit 2 3 4-9 10 11 12 13 14-19 20 21 22 23 24 25 26 27-53 54 55 56 57 58 59-85 Baud Rate Time out Address Format (in HEX format) Baud Rate Time out Amount of Telegrams Telegram Control Write Block Index Write Block Index Write Block Index Write Block Index Write Block Index Write Block Index Read Block Index Read Block Index Read Block Index Read Block Index Read Block Index Read Block Index 19200 1000 ms Reserved – Do Not Use. 4 0 0 6 10 31 -1 NOT IN USE. 1 7 9 13 -1 NOT IN USE. Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 122 of 124 Appendix C – Configuration Examples Continued… Publication 1756-MVICMLI - 2.2 June 2008.doc Page 123 of 124 Appendix C – Configuration Examples Telegram Block (CML1.ComliModuleTelegramBlock32to39.CMLTelegramBlock32[0]-[127]): Continued… Telegram Control Block (CML1.ComliModuleTelegramControlBlock41[0]-[3]): The telegram control is not enabled. Therefore the MVICMLI module will not request the telegram control block 41 from the CLX. Ladder Logic and Data values in corresponding CLX tags during communication: Use the provided RSLogix5000 sample application source code, but make adjustments as in example nr 1 and nr 4. Data values can also be seen in mentioned examples. Publication 1756-MVICMLI - 2.2 June 2008.doc Page 124 of 124