ED 2002 202Processor221xUserManual

March 24, 2018 | Author: brahman_ymail | Category: Computer Program, Input/Output, Computer Data Storage, Booting, Data Type


Comments



Description

Messung SystemsNEXGEN - 2000 Processor CP 221x User Manual Document No.: ED-2002-202 Version: 1. 0 MESSUNG SYSTEMS EL-2, J- Block MIDC Bhosari, Pune – 411026. (INDIA) Tel: (+91)-020-27102000 Fax: (+91)-020-27102100 Email: [email protected] WEB: http://www.messungautomation.com/ Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 1 of 82 Messung Systems NEXGEN - 2000 Revision: Version 1.00 Date April 2005 Description Processor CP 221x User Manual Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 2 of 82 Messung Systems NEXGEN - 2000 INDEX 1 Processor Module............................................................................................................ 7 1.1 Module Specifications.............................................................................................. 7 1.2 Components .......................................................................................................... 11 1.3 LED Indications...................................................................................................... 12 1.4 Memory.................................................................................................................. 13 1.4.1 RAM................................................................................................................... 13 1.4.1.1 Input Process Image................................................................................. 13 1.4.1.2 Output Process Image .............................................................................. 13 1.4.1.3 Markers..................................................................................................... 13 1.4.1.4 Data .......................................................................................................... 13 1.4.1.5 File Markers .............................................................................................. 14 1.4.1.6 System Variables...................................................................................... 15 1.4.1.7 Application Program Memory ................................................................... 15 1.4.2 Flash PROM ...................................................................................................... 15 1.4.2.1 Operating System ..................................................................................... 15 1.4.2.2 Application Program Code (Boot Project) ................................................ 15 1.4.2.3 Application Program Source Code ........................................................... 16 1.5 RUN Time Execution ............................................................................................. 16 1.6 Online Application Program Change ..................................................................... 17 1.7 Battery Back Up..................................................................................................... 17 1.8 Serial Communication Ports .................................................................................. 18 1.9 Memory Cassette................................................................................................... 21 2 PLC Variables................................................................................................................. 22 2.1 2.2 2.2.1 2.2.2 2.3 2.4 2.4.1 2.5 2.5.1 2.5.2 2.6 2.7 2.8 3 4 Name ..................................................................................................................... 22 Type ....................................................................................................................... 22 Standard Data Types ........................................................................................ 22 Defined Data Types........................................................................................... 23 Initial Value ............................................................................................................ 24 Addressing............................................................................................................. 24 Memory Mapping............................................................................................... 25 Class ...................................................................................................................... 26 Local Variables.................................................................................................. 26 Global Variables ................................................................................................ 27 Constant ................................................................................................................ 27 Retain..................................................................................................................... 28 Addressing Range ................................................................................................. 29 System Variables ........................................................................................................... 30 PLC Configuration and I/O Addressing ....................................................................... 35 4.1.1 I/O Slot Numbering............................................................................................ 35 4.1.2 PLC Configuration Procedure ........................................................................... 36 4.1.3 PLC Configuration Example .............................................................................. 45 4.2 I/O Module Error detection – ................................................................................. 46 4.3 I/O Status Monitoring – .......................................................................................... 49 5 Operating Modes............................................................................................................ 58 5.1 5.2 5.3 RUN ....................................................................................................................... 58 STOP ..................................................................................................................... 59 Single Cycle........................................................................................................... 59 Published Apr 2005 Page 3 of 82 Processor CP 221x User Manual Document No.: ED-2002-202 Messung Systems NEXGEN - 2000 5.4 6 Bootstrap Load ...................................................................................................... 59 Troubleshooting............................................................................................................. 60 6.1 LED Indications...................................................................................................... 60 7 8 9 Appendix 1 – Downloading Operating System........................................................... 61 Appendix 2 – Remote Programming and On Line Monitoring via Modem .............. 66 Appendix 3 – Remote Programming and On Line Monitoring via LAN.................... 69 9.1 9.2 Settings on PC 2.................................................................................................... 69 Settings on PC 1.................................................................................................... 70 Appendix 4 – Memory Cassette ................................................................................ 72 Configuration of Memory Cassette ........................................................................ 73 Sending Application Program from CoDeSys to Cassette .................................... 76 Sending Application Program from Cassette to Processor Module ...................... 79 Appendix 5 – File Marker Memory ............................................................................ 80 10 10.1 10.2 10.3 11 Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 4 of 82 ............................................................................................ 20 Figure 5: Memory Cassette..............................................................................................................................................................................................................Messung Systems NEXGEN .....................................................: ED-2002-202 Published Apr 2005 Page 5 of 82 ........................................... 21 Figure 6: Addressing method for PLC variables ................ 69 Figure 13: Memory Cassette........................................................... 19 Figure 4: Connection Diagram of Communication Port 2 ....................................................................................................................................................................................................................................................................................... 18 Figure 3: Connection Diagram of Communication Port 1 ....................... 11 Figure 2: Serial Communication Ports ......................................................................................... 66 Figure 12: Set Up with LAN ........ 58 Figure 9: Jumpers on the Processor Module for Bootstrap Mode .. 25 Figure 8: PLC Scan..........................2000 INDEX OF FIGURES Figure 1: Front View of the Processor Module ................................................ 24 Figure 7: Memory Map of the Markers.......... 72 Figure 14: Set Up to Configure and Program the Memory Cassette........................... 73 Processor CP 221x User Manual Document No................. 66 Figure 11: Set Up with Internal Modem .......................................................... 61 Figure 10: Set Up with External Modem ..................... The manual has been written to be used by trained and competent personnel. Note on the Symbol used in this Manual At various times through out this manual certain symbols will be used to highlight points of Information. which are intended to ensure the users personal safety and protect the integrity of equipment.Messung Systems NEXGEN . Indicates a special point.: ED-2002-202 Published Apr 2005 Page 6 of 82 . trained and qualified to the local and national standards required to fulfill that job. Warning ! This product can only function correctly and safely if it is setup and installed correctly. design and construction of automatic equipment using the product associated with this manual should be of a competent nature. Warning ! The specifications of product and contents of the manual are subject to change without notice. Note: The term ‘completed equipment’ refers to a third party constructed device.2000 Guidelines for the Safety of the User and Protection of the Processor CP 221x This manual provides information for the use of the Processor CP 221x products. Indicates a point to remember. Any commissioning or service engineer must be of a competent nature. and operated and maintained as recommended. These engineers should also be trained in the use and maintenance of the completed product. Whenever any of the following symbols are encountered it’s associated note must be read and understood. Processor CP 221x User Manual Document No. The definition of such a person or persons is as follows: Any engineer who is responsible for the planning. which is connected with the actual operation of the completed equipment. All maintenance should be carried out in accordance with established safety practices. The operators should also be familiar with documentation. These engineers should be fully aware of all the aspects of safety about automated equipment. All operators of the completed equipment should be trained to use that product in a safe and coordinated manner in compliance to established safety practices. which contains or uses the product associated with this manual. trained and qualified to the local and national standards required to fulfill that role. This includes being completely familiar with all associated documentation for the said product. Each of the symbols used is listed below with a brief description of its meaning. which the user of the associate software element should be aware of. a) b) c) Warning ! Indicates special care must be taken when using this element of software. Indicates a point of interest of further explanation. The following table explains the difference in the various types. The following section explains the types and the technical specifications of the series CP 221x.: ED-2002-202 Published Apr 2005 Page 7 of 82 . as on date.2000 1 Processor Module Nexgen-2000 PLC system. offers two variants of the Processor module as per the application need and the cost. Feature Serial Port-1 (PG-Port) Serial Port-2 CP 2210 Yes No CP 2211 Yes Yes The table given on next page contains the technical specifications for CPU module – Processor CP 221x User Manual Document No. The Processor module stores the application program and data and executes the application program in run mode. It provides serial interface with external devices to program it and monitor the functionality.1 Module Specifications The availability of number of communication ports and extensions decides the type of the Processor module. All other technical specifications are common. ‘x’ has value 0 or 1 depending on the number of serial ports supported. 1. The Processor module fits in a slot next to the power supply module in the basic rack. The ordering code is CP 221x.Messung Systems NEXGEN . Messung Systems NEXGEN - 2000 The technical specifications of the Processor module are as follows – Processor BOOL BOOL/ BYTE /WORD /DWORD/ REAL MOVE BYTE/WORD/DWORD/ REAL ADD & SUB BYTE/WORD/DWORD/ REAL MULtiplication Execution BYTE/WORD/DWORD/ time REAL DIVision BYTE/WORD/DWORD Logical Operators (AND, OR, XOR) BYTE/WORD/DWORD/ REAL Compare 16 bit micro controller 0.4 to 0.6 µsec 0.8 / 0.8 / 0.8 / 1.5 / 1.5 µsec 1.4 / 1.4 / 2.7 / 11.8 µsec 1.9 / 1.7 / 4.2 / 17.6 µsec 2.6 / 2.4 / 9.3 / 21.3 1.4 / 1.4 / 2.7 µsec 1.4 / 1.4 / 2.7 / 11.8 µsec 250 ms default setting. Maximum scan time limit can be modified up to 1 Sec by modifying system variable _WLIMITMAXSCAN 128 Input points and 128 Output points 1 No 7680 bytes RAM 32 Kbytes RAM 48 Kbytes RAM Unlimited number of instances can be called. Supported by user definable retentive feature. 1 ms for all the timers. 24.85 days maximum Unlimited number of instances can be called. Supported by user definable retentive feature. Supported. Available as system variables. 256 Kbytes RAM (Application program code is transferred from flash to RAM at every power ON.) 128 Kb onboard flash PROM 512 Kb onboard flash PROM Provided with the memory cassette. Refer Appendix 5 Maximum program scan time limit Number of I/O points Racks Supported Marker Memory Data Memory File Memory Number of Timers (TON, TOF, TP, RTC) Timer resolution Timer Range Number of Counters (CTD, CTU, CTUD) Real Time Clock System Information Application program memory type for execution Application program code (Boot project) memory for permanent storage Application program source code memory for permanent storage External back up for the application program code and the source code Basic Expansion Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 8 of 82 Messung Systems NEXGEN - 2000 The technical specifications of the Processor module are continued – Marker (except from MB0 to MB127) and Data memory can be retained selectively. File marker memory is retained by default. Input and Output data memory can not be retained. 3.6 VDC, Ni–MH, 80 mAH Rechargeable 6 months between recharge Yes (Downloadable from PC by PC base software Bootstrap Loader Tool through serial port1) Supported Supported Password protection supported for • Project file/ POU read or write. • Source codes upload. Cyclic RUN, STOP, Single cycle, Bootstrap load • RUN • CPU • I/O • MEM • LOW BAT Data Retentivity Onboard battery Type back up Backup time Downloadable operating system Online application program change Forcing, Writing, Watch and Receipt for PLC Variables, Redirection of I/O points Application Program Security Tasks supported Operating Modes Diagnostic LED indications (Provided within 5x7 LED matrix mounted on CPU fascia) Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 9 of 82 Messung Systems NEXGEN - 2000 The technical specifications of the Processor module are continued – Communication ports (All ports are open ports) Port 1 RS232C, used as programming port with programming cable (Ordering Code 2910) connected. RS232C / 422 / 485 (Applicable for CP 2211) Port 2 Selectable up to 38.4 Kb for all ports Ring buffers for reception and Communication Buffer Memory transmission, 256 bytes for each port. Standard IEC 61131-3 Microsoft Windows based Programming Software ‘CoDeSys’ version 2.3 onwards. Languages IL, LD, FBD, SFC, LD Remote programming and online Supported. monitoring via Modem and or LAN Refer Appendix 2, Appendix 3 CPU back plane current 5V, 500 mA AS per IEC 1000 – 4 – 4 2 KV conductive noise for power Noise immunity supply 1 KV capacitive coupled noise for serial ports Communication Baud rate The Processor module series CP 221x onwards should be programmed using the programming software ‘CoDeSys’ version 2.3 onwards. Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 10 of 82 Messung Systems NEXGEN - 2000 1.2 Components The figure below shows the front view of the Processor module CP 2211 along with nomenclature. Module Ordering Code Display for CPU diagnostics indications and I/O Status Monitoring Two keys for browsing through display 9-pin Mini DIN Female connector for Port 1 9-pin D male connector for Port 2 Figure 1: Front View of the Processor Module Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 11 of 82 I/O module/s not inserted properly or faulty.5 VDC. CPU put in bootstrap load mode CPU is in ‘RUN’ mode i. Battery backup for CPU RAM is healthy. Battery is faulty. CPU watchdog fault. I/O bus read / write fault Faulty or incorrect module present in slot. Application program is healthy. Scan time exceeds beyond permissible limit. in program execution mode. The table below explains the significance of CPU diagnostics related LEDs – LED CPU ERR Color Red Status OFF ON ON R ( RUN ) Green OFF Flashing (5 Hz) IO ( I/O Error ) M ( MEM Error ) B ( LOW BAT Error ) OFF Red ON OFF ON Flashing (5 Hz) OFF ON Indication CPU is healthy Hardware fault of the Processor module.Messung Systems NEXGEN . Application program is invalid or absent. Ni-MH battery (3. as explained later in this manual.: ED-2002-202 Published Apr 2005 Page 12 of 82 .2000 1.6 VDC) is discharged bellow 2. Redirection of any I/O point All modules inserted are as per configuration declared in the application program and are healthy.3 LED Indications Five LEDs are provided on the front side of the Processor module to provide status and diagnostic information of total PLC system. Red Red Processor CP 221x User Manual Document No. Other LEDs indicate I/O status.e. CPU is in ‘STOP’ mode Application program fault CPU watch dog fault Forcing / Writing any PLC variable from programming device. Output image is addressable global memory and hence the external devices like HMI and SCADA can access it. After logic scan. The instruction ‘Refresh_Out’ writes the CPU output image to a particular I/O slot.1.4. Memory Type Input process image Output process image Marker Data File marker System variables Application program memory Addressing in Application Program Addressable as %I Addressable as %Q Addressable as %M Addressable by names Addressable indirectly Addressable by implicit names Not addressable Size 16 Bytes 16 Bytes 7680 Bytes 32 Kbytes 48 Kbytes System memory 128 Kbytes 1.4. These addresses may change during number of compilations during the application program development. the external devices like HMI and SCADA cannot access it. The input process image is not retained. Output Process Image The Processor module updates the status of output points as per the application program in the logic scan and stores the updated status in the output process image.1. The instruction ‘Refresh_In’ reads the input status from a particular slot and updates CPU input image memory. 1. The output scan activates the actual outputs as per the output process image.4. This is addressable global memory and hence the external devices like HMI and SCADA can access it.3 1. The application program then refers this status in the logic scan. Input image is addressable global memory and hence the external devices like HMI and SCADA can access it. This memory can have local or global access as per the user definition. Markers Marker memory holds the intermediate results in the application program.4 Processor CP 221x User Manual Document No.4. Data Data memory holds the intermediate results in the application program and Function Block instance data. Marker memory (except from %MB0 to %MB127) can be retained selectively. The programming software ‘CoDeSys’ assigns the addresses for the variables in data memory during compilation of the application program.1 RAM Onboard RAM has battery back up.Messung Systems NEXGEN . As the addresses are not fixed.1.2 1.4 Memory The Processor module has two onboard memory areas.1 Input Process Image The Processor module scans all the input points from configured IO modules in input scan and stores the status in input process image.2000 1. the processor executes output scan.: ED-2002-202 Published Apr 2005 Page 13 of 82 . The following sections explain the utilization of the memory 1.4. RAM and flash PROM. The output process image is not retained.1. The utilization of RAM depending on functionality is as shown below. Messung Systems NEXGEN .: ED-2002-202 Published Apr 2005 Page 14 of 82 . it stores the process settings. However. etc through the application program. It is possible to access file markers via serial communication by Modbus RTU and Nexgen protocol. For more details. Hence. Processor CP 221x User Manual Document No.2000 1.5 File Markers File marker memory stores the data. These file markers cannot be accessed directly by % address like input. Generally.1. which is retained even after program change or cold start initialization. recipe data. history and data logging information. a set of functions and functions blocks can read and write to the file markers. output and markers. the external devices like HMI and SCADA can also access this memory. refer Appendix 5.4. This facilitates easy maintenance and CPU feature up gradation. Operating system Application program code Application program source code 198 Kb 128 Kb 512 Mb 1. the operating system copies the application program code from the flash PROM to the RAM and executes from there. It is possible to update operating system codes using special PC based software ‘Bootstrap Loader Tool’.7 Application Program Memory The application program code is stored in this memory area. 1. These variables shall be read or written in the application program based on the functionality of that variable.4.2 Application Program Code (Boot Project) The programming software ‘CoDeSys’ compiles the application program to executable codes for the processor. the application program codes may be stored in the memory cassette as permanent back up and for easy transportation. At every power ON. the application program is executed from RAM. the processor copies application program codes from flash PROM to RAM and then executes the program from RAM.6 System Variables The System Variables are implicitly defined global variables.4. Processor CP 221x User Manual Document No. may result in malfunctioning of the processor. At every power ON. These codes can be stored into a permanent storage on flash PROM of the Processor module by using “Create boot project” command from ‘CoDeSys’.2000 1. this memory gets cleared at every power ON.4.: ED-2002-202 Published Apr 2005 Page 15 of 82 . 1. These variables exchange the information with PLC operating system and its functionalities.1 Operating System This memory contains the core codes of the Processor module. The memory utilization is as shown below.4. During RUN time. if written. Some variables. 1. This eliminates the need of any memory cassette permanently plugged on the Processor module as a program backup device.1.4.Messung Systems NEXGEN . refer Appendix 4.1. This code handles the various functions of the Processor module. It is possible to create a backup in onboard flash PROM of the Processor module by using “Create boot project” command from the programming software ‘CoDeSys’.2 Flash PROM The Processor has onboard nonvolatile flash PROM. Alternatively. During run time. Since these project codes are in RAM. application codes from RAM are executed.2.2. This binary code is downloaded from PC to application codes sector of RAM on the Processor module. For more details. the processor declares invalid application program code in RAM and displays ‘M’ on LED display. after power ON. if < and > keys on the keyboard are kept pressed simultaneously. the source code can also be stored in the memory cassette as permanent back up and for easy transportation. This puts PLC in ‘STOP’ mode. The programming software ‘CoDeSys’ provides two options to store this project file on either hard disk of PC or in the Processor flash PROM. variable names and comments. it is necessary to download a fresh application program code again from ‘CoDeSys’ or through memory cassette. The command ‘File’ ‘Open’ ‘Read from PLC’ can read the source code project file from the Processor module.5 RUN Time Execution The programming software ‘CoDeSys’ downloads the application program codes to RAM in the Processor module. it is necessary to store the entire application program in permanent flash PROM memory on the Processor module. At every power ON. ‘CoDeSys’ then compiles the project to executable codes for the processor used. Since this memory is volatile. it looses the data at every power ON. the application program code from flash PROM is not copied to RAM. Processor CP 221x User Manual Document No. 1. During power ON. The Processor declares invalid application program code in RAM.2. programs in various languages. It is necessary to store all this information in the format the user has defined.4. Alternatively. Thus it is possible to store the project file in compressed format in onboard flash PROM using “Source code download” command from ‘CoDeSys’. variable declaration. comments. libraries (optional) etc. the processor copies the application program code from flash PROM to RAM and then starts execution from RAM. password. Thus. If the application program code is not stored in flash PROM (‘Create boot project’ command from ‘CoDeSys’).3 Application Program Source Code User develops the application project using various IEC languages under ‘CoDeSys’ programming environment. For more details. In this case. The program is always executed from this memory.2000 1.Messung Systems NEXGEN . refer Appendix 4. The source project file contains all project related information like.: ED-2002-202 Published Apr 2005 Page 16 of 82 . 6 V Ni-MH (Nickel – Metal Hydride) rechargeable battery. the new codes must be transferred to flash PROM using ‘Create boot project’ command from ‘CoDeSys’.2000 1.: ED-2002-202 Published Apr 2005 Page 17 of 82 . which is mounted on board. red LED ‘B’ glows. During online program change. The battery provides data backup time of up to 6 months from fully charged condition. This battery also provides the back up to onboard Real Time Clock (RTC). An electronic circuit charges the battery when the module is powered ON. Once the application program is finalised. Processor CP 221x User Manual Document No. RAM is volatile memory thus in the event of a power failure. The application program code is executed from the RAM. data gets lost. If battery is discharged below 2. The operating system ensures smooth changeover from old to modified application program codes. To charge the battery again. the processor continues to execute the old application program codes until the changes are downloaded and then new PLC scan is started with the modified application program codes. if the PLC is kept in powered OFF condition. The processor module series CP 221x use 3. To retain the data in RAM.7 Battery Back Up The PLC variables data is stored in RAM. the Processor module provides battery back up. keep the Processor module powered ON for at least about 8 hours.6 Online Application Program Change The Processor supports online application program change.Messung Systems NEXGEN .5 V. 1. else the changes made in the application program codes since last ‘Create boot project’ operation will be lost during next power ON. the processor provides system buffer of 256 bytes each for reception and transmission.Messung Systems NEXGEN . RS232C/RS422/RS485 hardware Figure 2: Serial Communication Ports The Processor module provides hardware for serial interface. Thus the application program can exchange data with the serial port. With serial link cable. ST. The user can develop the application specific function blocks to handle serial communication with third party devices like printer. which directly controls the hardware interface. The figure below shows the Processor module with all the three serial ports. etc) to handle station Processor CP 221x User Manual Document No. The library Nexgen2210 provides such driver functions and function blocks along with protocol function blocks like NEXGEN_SLAVE (to handle Nexgen protocol) and MODBUS_RTU_SLAVE (to handle Modbus RTU protocol). data bytes can be transmitted and received and status of serial communication can be monitored.2000 1. it acts as open port and can communicate with any third party device by executing relevant protocol Function Block in the application program. The function blocks can be developed for handling any protocol as a master controller (to initiate communication) or slave controller (to respond to any query sent by any master controller). Using driver functions and function blocks.8 Serial Communication Ports The Processor module supports three independent serial communication ports which can communicate to different third party devices simultaneously. The operating system provides driver functions and function blocks. Acts as programming port when programming cable (Ordering Code 2910) is connected and communicates with the programming software ‘CoDeSys’ RS232C Hardware Memory cassette can download the application program. HMI. For a serial port. port parameters can be assigned. programmable logic controller.: ED-2002-202 Published Apr 2005 Page 18 of 82 . RS232C/RS422/RS485 Hardware It is open port and user can communicate with any third party device by executing relevant protocol Function Block in the application program. etc with different protocols. inverter. User can develop suitable logic in any language (SFC. 3 and 5 respectively.: ED-2002-202 Published Apr 2005 Page 19 of 82 . communication retries. 5 VDC and ground are brought out. Between pins 4 and 5. Figure 3: Connection Diagram of Communication Port 1 Pin No. The figures below show the terminal diagrams for the serial ports. Communication Port 1 Port 1 has 9-pin Mini DIN female connector and the figure below shows connections. communication error handling. The function block PORT_STATUS from library Nexgen2210 provides the status of carrier detection.2000 numbers. The function block PORT_STATUS from library Nexgen2210 provides the status of the ring. Processor CP 221x User Manual Document No.Messung Systems NEXGEN . TxD and GND on pins 2. It should not be used for any other purpose. Pin 9 provides ring indication when modem is connected and if any controlling device is dialing. 1 2 3 4 5 6 7 8 9 Signal Carrier Detect (Used for Modem) RxD TxD +5V GND Reserved (Not to be used) Reserved (Not to be used) Reserved (Not to be used) Ring Indicator (Used for Modem) Port 1 provides RS232C hardware interface with signals RxD. etc as per the application need. This 5 VDC is used for the memory cassette operation. Pin 1 provides carrier detect signal status when modem is connected. Pin 1 provides carrier detection status when modem is connected. Tx-. 3 and 5 respectively.: ED-2002-202 Published Apr 2005 Page 20 of 82 . Processor CP 221x User Manual Document No. TxD and GND are brought out on pins 2. 8 and 9 respectively. RS422 signals Tx+.Messung Systems NEXGEN . Rx. 7. RS232C signals RxD.2000 Communication Port 2 Port 2 have 9-pin D male connectors and the figure below shows connections. 5 9 9: Rx+ (RS422) 8: Rx.(RS422) 6: Reserved (not to be used) 1 6 GND: 5 Tx+ (RS422): 4 TxD (RS232C): 3 RxD (RS232C): 2 Carrier Detect (RS2232C): 1 Figure 4: Connection Diagram of Communication Port 2 Port 2 provides RS232C / RS422 / 485 hardware interface. This status is available in the application program if function block PORT_STATUS from library Nexgen2210 is executed.(RS422) 7: Tx.and Rx+ are brought out on pins 4. For the same. The backside provides 9-pin D female connector for interface with the PC or the Processor module The PC based programming software ‘CoDeSys’ can download the application program code and or source code to the cassette. ‘CoDeSys’ can upload the source code from the cassette when ever required. refer memory cassette user manual. This is a flash PROM type of intelligent memory cassette. This application program code and source code can be downloaded to the Processor module from the cassette through the serial port 1.: ED-2002-202 Published Apr 2005 Page 21 of 82 . Processor CP 221x User Manual Document No. For more details.2000 1.9 Memory Cassette The memory cassette is used to store the application program code and the source code. cassette adapter kit (9911) is required. Figure 5: Memory Cassette The front side provides a push button and two LED indications for user interface.Messung Systems NEXGEN . . The figure below shows the memory cassette. Thus. the application program can be transported easily. Type BOOL BYTE WORD DWORD SINT USINT INT UINT DINT UDINT REAL Range TRUE or FALSE 0 to 255 0 to 65535 0 to 4294967295 -128 to 127 0 to 255 -32768 to 32767 0 to 65535 -2147483648 to 2147483647 0 to 4294967295 +38 to -1. The data types are categorized in two groups as standard data types and user defined data types as explained below. These PLC variables are mapped in marker memory area or data area. 2.Messung Systems NEXGEN . and underscores that begins with a letter or an underscore. The Name should not have more than one underscore character in a row. The Name is not case sensitive.176 E to +3. the following attributes are user definable. The name should not contain any blank spaces or special characters and cannot be the same as any of the keywords.: ED-2002-202 Published Apr 2005 Page 22 of 82 .1 Name Name is a unique identifier. 2.4 E ±0 -38 +38 +1.2000 2 PLC Variables Intermediate results in the application program can be stored in PLC variables. numbers.176 E-38 -3.1 Standard Data Types The table below shows some standard data types. For declaration of any PLC variable.2 Type This attributes decides type of values it stores and memory space it consumes. which is a sequence of letters.4 E Memory space consumed 8 Bit 8 Bit 16 Bit 32 Bit 8 Bit 8 Bit 16 Bit 16 Bit 32 Bit 32 Bit 32 bit (IEEE-754 format for single precision floating point numbers) Processor CP 221x User Manual Document No.2. The length of Name is unlimited. • • • • • • • Name Type Initial Value Address Class Constant Retain 2. time in TOD begins at 12:00 A. ENUMERATION Enumeration is a user-defined data type that is made up of a number of string constants. End of string is ‘/0’ Time Data Types The data types TIME. User defines the number of elements and size of data type. A pointer can be dereferenced by adding the content operator "^" (Caret) after the pointer identifier. This address is stored in a DWORD. Time is given in seconds in DATE and DT beginning with January 1. DATE and DATE_AND_TIME (DT) are handled internally like DWORD. It refers to the number of characters in the string.2 Defined Data Types This data type is user configurable. ARRAY One.M. the default size of 80 characters is used. 1970 at 12:00 A.Messung Systems NEXGEN . If no size specification is given.: ED-2002-202 Published Apr 2005 Page 23 of 82 . two or three dimensional group of similar data types.M. A pointer can point to any data type or function block. STRUCTURE Structure is a group of different elementary data types.2000 Some more standard data types are explained below STRING A STRING type variable can contain group of characters. POINTER Pointer is a variable which holds address of another variable or FB instance data. Time is given in milliseconds in TIME and TOD. These constants are referred to as enumeration values. TIME_OF_DAY (TOD). even to user defined types. Variable or function block addresses are saved in pointers while a program is running. ADR operator assigns the address of a variable or function block to the pointer. 2. The size entry in the declaration determines how much memory space should be reserved for the variable.2. Processor CP 221x User Manual Document No. The application program execution in the logic scan refers this input process image. after power ON. it is necessary to load some predefined values to certain variables. After logic scan. The output scan refers this output process image.: ED-2002-202 Published Apr 2005 Page 24 of 82 . However after cold start initialization or if variable is not retentive. It is accessed and updated during logic scan. 2.Messung Systems NEXGEN . The memory areas addressable by using % sign have global access. Denotes fixed address %M X mmmm. retained value is loaded. Output image area ( Q ) and Marker area ( M ). WORD or DWORD Byte Address This byte address and range depends upon variable type Bit Size BOOL BYTE WORD DWORD X (Optional) B W D Figure 6: Addressing method for PLC variables The section Memory Mapping explains the PLC variables along with addressing. The Processor updates the status of output points as per the application program in logic scan and stores the updated status in the output process image area. %I The Processor scans all the input points from configured I/O modules in input scan and stores the status in the input process image area. The table below shows the addressable memory area types. initial value can programmed. During declaration of a variable. Variable Type Input I Output Q Marker M Delimiter. The bit address can be 0 to 7.2000 2. If such variable is retained. though it is optional. the variable gets initialized to its defined initial value. Processor CP 221x User Manual Document No.3 Initial Value In some applications. This memory area is used to store intermediate results in the application program. Input Output %Q Marker %M The figure below shows the addressing method for accessing such variables. The addressable memory areas are Input image area ( I ). the Processor module executes output scan and switches On/OFF all the outputs of I/O modules configured. This is a decimal point applicable while accessing bit from BYTE.4 Addressing Variable can be associated with a definite address. then after warm start initialization. n Bit address This identifies bit within specified byte address. Messung Systems NEXGEN . %MW3. even WORD addresses are valid.0 7 6 5 4 3 2 1 0 Byte 0000 Byte 0001 Byte 0002 Byte 0003 Byte 0004 %MD7676 %MW7676 %MW7678 %MB7675 %MB7676 %MB7677 %MB7678 %MB7679 %MX7679. Address %MW0 %MW2 %MW7676 %MW7678 Data Type WORD WORD WORD WORD Lower Byte %MB0 %MB2 %MB7676 %MB7678 Higher Byte %MB1 %MB3 %MB7677 %MB7679 Only. %MW7677 are invalid.4. The addressing is from %MB0 to %MB7679. Individual bit in a byte is accessed with prefix X. Marker WORD is accessed with prefix W. Processor CP 221x User Manual Document No. Odd addresses like %MW1.7 %MX7679.1 Memory Mapping Basically.5 Figure 7: Memory Map of the Markers Byte 7675 Byte 7676 Byte 7677 Byte 7678 Byte 7679 Marker memory size is 7680 bytes.0 %MX5. The figure below shows memory mapping for markers. memory mapping is byte wise. Bit 0 is Least Significant Bit and bit 7 is Most Significant Bit.: ED-2002-202 Published Apr 2005 Page 25 of 82 .5 Data Type BOOL BOOL BOOL Memory Location 0th bit of fourth marker byte 7th bit of sixth marker byte 5th bit of marker byte 7679 Marker memory can be accessed as WORD type variable. Address %MX3. Bits %MD0 %MD2 %MD4 %MW0 %MW2 %MW4 %MB0 %MB1 %MB2 %MB3 %MB4 %MB5 %MX5.2000 2. One byte consists of 8 bits.7 %MX3. 5.: ED-2002-202 Published Apr 2005 Page 26 of 82 . Local Variables The scope of the local variable is limited to a POU where it is declared. even DWORD addresses are valid. 2. The value of such variable is passed by reference. %MD3. These are read only type of local variables inside that POU. There they can be used further.5 Class Class defines the scope of the variable. That means that at the call position. Odd addresses like %MD1. the value of the variables can be given along with a call.2000 Marker memory can be accessed as DWORD type variable. VAR_IN_OUT These are local variables acting as input as well as output of any POU. The variable scope can be local or global. %MD7675 invalid. The variable does not carry same status or meaning in different POUs even though the name is same. VAR_OUT These are local variables acting as output of any POU.1 VAR These are local variables for storing temporary results of any POU. VAR_IN These are local variables acting as input to any POU.Messung Systems NEXGEN . Address %MD0 %MD2 %MD7676 Data Type DWORD DWORD DWORD Lower Byte %MW0 %MW2 %MW7676 Higher Byte %MW2 %MW4 %MW7678 Only. This type of variable is not applicable for functions (FUN) Processor CP 221x User Manual Document No. The different categories of local variables are 2. That means that these values are returned back to the POU making the call. Marker DWORD is accessed with prefix D. The other POUs cannot refer these variables. T#500ms D#2002-01-01 . 2. Example 14. ’SS-1987’ Significance Decimal value Hexadecimal value Octal value Binary value Boolean value TIME value Date value TIME_OF_DAY value DATE_AND_TIME value REAL Values STRING values Notation No prefix 16# 8# 2# TRUE or FALSE T# DATE# or D# TIME_OF_DAY# or TOD# DATE_AND_TIME or DT# No notation but number with Decimal point or e String of characters preceded and followed by single quote.5.123. These variables are used to pass information from one POU to another POU.6 Constant Any variable can be declared as constant. Processor CP 221x User Manual Document No. The global variables are defined with keyword VAR_GLOBAL.4 . The number of POUs can access global variable and modify it and this modified value is referred by another POU.Messung Systems NEXGEN .64e+009 ’Name of Operator’ .2000 2. 8#14 2#11000000. d#2000-03-04 TOD#15:36:30. 11000 16#AAC0.: ED-2002-202 Published Apr 2005 Page 27 of 82 . which is accessing it latter. %Q and %M are global variables. The variable carries same status or meaning through out the complete application program.2 Global Variables The scope of the global variable is global for the application program consisting of number of POUs. 2#10101 TRUE or FALSE T#10m30s500ms. TOD#00:00:00 DT#2002-01-01-15:36:30 7. By default variables %I. 1. T#10s. This variable can be a local variable or global variable. 16#1359 8#7. The range of value and presentation format depends on the data type. The notations for different data types are different. 0.7 Retain In the event of power fail. Function Block instance like any other PLC variable can be declared as retentive. %MW100. PLC variables %M (except 128 bytes from %MB0 to %MB127) are retentive if not explicitly declared in the application program.: ED-2002-202 Published Apr 2005 Page 28 of 82 . Processor CP 221x User Manual Document No. The local or global variables can be declared as retentive selectively. variable is initialized to the initial value or to zero. Therefore. It is not cleared during warm and cold start initialization or even after the application program download. However after cold start. it is necessary to avoid using such PLC variables directly as %MX20. user can define whether such PLC variables are retentive using keyword VAR_RETAIN. If any variable is declared as retentive.Messung Systems NEXGEN . File marker memory is retained by default. all the variable data stored in RAM gets lost. then after warm start retained value is loaded in first PLC scan. In declaration. %QB0 without explicit declaration in the application program. In some applications. PLC variables %I and %Q can not be retained.2000 2. it may be required to retain the values of variables even after power fail. By default. even DWORD addresses are valid.8 Addressing Range The following table shows the PLC variables and addressing range with respect to data type.0 to %MX7679. %IB2 to %IB127 %IW0.0 to %IX1.0 to %IX127.7 I I I B W D %IB0.7 M M M B W D %MB0. %MW3. Odd addresses like %IW1. %QD3. %MD7675 are invalid. %IW2.0 to %IX0. %QD4. %MD4 to %MD7676 Only. Variable Input BOOL Input BYTE Input WORD* Input DWORD* Output BOOL Output BYTE* Output WORD* Output DWORD Marker BOOL Marker BYTE Marker WORD Marker DWORD Type Data Type X ( X is optional ) Range %IX0. Processor CP 221x User Manual Document No.7 Q X ( X is optional ) %QX127. even WORD addresses are valid.0 to %MX0.: ED-2002-202 Published Apr 2005 Page 29 of 82 . %MD2.7 %IX1.Messung Systems NEXGEN . %MW4 to %MW7678 %MD0.0 to %QX1. %QB2 to %QB127 %QW0.2 supports access as BOOL and BYTE for input memory (%I) and output memory (%Q). %QW2.7 %MX1. %IB1. Odd addresses like %MD1. %QW4 to %QW126 %QD0. %MW7675 are invalid.7 %QX1. The programming software ‘CoDeSys’ version 2.7 I %IX127. %MB2 to %MB7679 %MW0. %QB1.7 M X ( X is optional ) %MX7679.0 to %QX0.0 to %MX1. Only.7 Q I I B W D %QB0. %ID8 to %ID124 %QX0. %MW2. %QD8 to %QD124 %MX0.2000 2. %IW4 to %IW126 %ID0. %MB1. %ID4.0 to %QX127. Hot Start _BINITSTATUS holds 1. • Destroying of battery back up retentive data because of battery back up circuit fault. 3. • Related standard initialization command (‘Reset Cold’ from ‘CoDeSys’) • Any related fault in power supply module 5. The table below explains the function of system variables – Name of Sysvar _BINITSTATUS Address 16#0EC000 Data Type BYTE Access Read only Description Holds the status of initialization. It continues to remain in STOP mode until power is ON. Each system variable has a unique Name. which is not retained. It goes to RUN mode at next power ON or after execution of any one of standard command from ‘CoDeSys’ like Run / Reset / Reset-Cold / Reset-Original'.Messung Systems NEXGEN . If a new application program is downloaded. In this case PLC functioning is normal as if there is no power disturbance.2000 3 System Variables The system variables are implicitly defined global variables. if system detects a prior power break for more than 25 ms. it puts Processor in STOP mode and the application program execution is halted. cold start is observed. It results resetting of data. the project in “Boot PROM” must be valid. 2.Stop Mode. which can exchange the information between the Processor module and the application program. _INITACTFORCE 16#0EC001 BYTE Read / Write Processor CP 221x User Manual Document No. If _INITACTFORCE byte value is modified to 5. 1. Other values are ignored.: ED-2002-202 Published Apr 2005 Page 30 of 82 . This byte is updated whenever related action is executed. if system detects a power break for less than 25 ms but greater than 10 ms. if • System detects any change in the application program. To put in RUN by power OFF.Warm Start _BINITSTATUS holds 2 on power ON. which starts with underscore ‘_’.Cold Start _BINITSTATUS holds 3. Holds current “Year” value (lower byte) of RTC in BCD. Holds scan time of last scan with 1 ms resolution. Holds current “Seconds” value of RTC in BCD. WRITE_DATE_AND_TIME. Processor CP 221x User Manual Document No. User should set Real Time Clock once by executing RTC handling functions like WRITE_DATE. PLC is put in STOP mode and ‘MEM’ LED starts flashing. This value is initialized to _WLIMITMAXSCAN on every power ON or at any standard initialization action. This variable is persistent. Holds current “Year” value (higher byte) of RTC in BCD.2000 Name of Sysvar _WCOLDSTARTCO UNTER _WWARMSTARTC OUNTER _WCURSCANTIME Address 16#0EC002 16#0EC004 16#0EC00A Data Type WORD WORD WORD Access Read Only Read Only Read Only Description Holds number of cold start initialization occurrences. The value is updated at the end of each scan. This value is initialized to zero at every power ON or after any standard initialization action. then new value is applicable for that scan only. Next scan is then checked for default value unless the required limit value is unconditionally moved in to this variable at beginning of every logic scan. This is the maximum limit for scan time. Holds current “Date” value of RTC in BCD.: ED-2002-202 Published Apr 2005 Page 31 of 82 . Holds current “Minutes” value of RTC in BCD. Holds minimum scan time in all previous PLC scans after power ON with 1 ms resolution. Holds maximum scan time in all previous PLC scans after power ON with 1 ms resolution. This value is initialized to zero on every power ON or any standard initialization action. The value is updated at the end of each scan. Holds number of warm start initialization occurrences. If current scan exceeds this limit. these system variables may contain random values. If at the beginning of logic scan this value is modified (maximum 1000 ms). Holds current “Month” value of RTC in BCD. 1970 and time of 00H:00M:00S:00MS if battery-back up is lost. This variable is persistent. The value is updated at the end of each scan. Also it is important to note that RTC is set to date of January 1.Messung Systems NEXGEN . Holds current “Hours” value of RTC in BCD. Default value for this variable is 250 ms and it is loaded before logic-scan. WRITE_TIME provided in Nexgen2210 library. _WMINSCANTIME 16#0EC00C WORD Read Only _WMAXSCANTIME 16#0EC00E WORD Read Only _WLIMITMAXSCAN 16#0EC012 WORD Read / Write _BREADSECS * _BREADMINS * _BREADHRS * _BREADDATE * _BREADMONTH * _BREADYEARL * _BREADYEARH * 16#0EC014 16#0EC015 16#0EC016 16#0EC017 16#0EC018 16#0EC019 16#0EC01A BYTE BYTE BYTE BYTE BYTE BYTE BYTE Read only Read only Read only Read only Read only Read only Read only * By default. Bits 12-15 are reserved. red LED ‘I/O ERR’ on the processor module glows. Processor CP 221x User Manual Document No.2000 Name of Sysvar _WRACK_0_IOERR ** Address 16#0EC01C Data Type WORD Access Read only Description Holds slot error status of twelve slots in Rack-0 i. ** In healthy condition.Messung Systems NEXGEN .0 is status bit for Slot-0. Basic Rack. Least significant bit is status bit for Slot-0 and Most Significant bit is status bit for Slot-11.e.: ED-2002-202 Published Apr 2005 Page 32 of 82 . This bit is TRUE if • Error in I/O configuration • Wrong module insertion • I/O Slot not configured • I/O Module hardware fault _BRACK_0_IOERR.1 is status bit for Slot-1 and so on. these system variables hold 0 value. If any of these bits holds nonzero value. _BRACK_0_IOERR. 2 No forcing of any PLC FALSE variable is done. This array is modified at every Power ON and after project download. Forcing of any PLC variable TRUE is active.5] OF DWORD Read only Read only Processor CP 221x User Manual Document No. _BCPUSTOPCAUS E 16#0EC031 BYTE Read only _DWREDIRECTTBL PTR _ASEGMENTPTR 16#0EC036 16#0EC03A DWORD ARRAY [0. Significanc Bit Details e Memory 1 Invalid Application Program Error Scan time exceeds the value 2 Scan Error of _WLIMITMAXSCAN PFNMI generated but PFNMI 3 RESET not received after Error defined 'PFRST' time..2000 Name of Sysvar _BCPUSTATUS Address 16#0EC030 Data Type BYTE Access Read only Description Holds status of the Processor. Array of Starting Addresses of various segments – _ASEGMENTPTR [0]: Input _ASEGMENTPTR [1]: Output _ASEGMENTPTR [2]: Marker _ASEGMENTPTR [3]: Data _ASEGMENTPTR [4]: File Marker. TRUE I/O error 3 FALSE No I/O error Ni-MH battery voltage is TRUE below 2.5 V or battery back 4 up circuit fault FALSE Battery back up is healthy Indicates the reason for CPU to go in Stop Mode. User initiated STOP Mode 4 User Stop command Holds the starting address of redirection table. 1 No redirection of any I/O FALSE point is carried out. Bit Status Significance TRUE CPU in RUN mode 0 FALSE CPU in STOP mode Redirection of any I/O point TRUE is defined. This is updated at every Power ON. It is cleared while going to 'RUN' Mode.: ED-2002-202 Published Apr 2005 Page 33 of 82 .Messung Systems NEXGEN . The significance of individual bit is explained below. _ADRRXPORT1 _ADRTXPORT1 _ADRRXPORT2 _ADRTXPORT2 _ADRREDIRECTCO UNT _SRTSVERSION _WRACK_0_REG_S TATUS 16#0EC060 16#0EC064 16#0EC068 16#0EC06C 16#0EC078 16#0EC1C0 16#0EC1D0 DWORD DWORD DWORD DWORD DWORD STRING (8) WORD Read only Read only Read only Read only Read only Read only Read only Processor CP 221x User Manual Document No. This bit is TRUE if CPU recognizes module in the slot. It is pointer to internal variable in RTS.2000 Name of Sysvar _ASEGMENTLEN Address 16#0EC052 Data Type ARRAY [0.Messung Systems NEXGEN .. else it is FALSE. This variable holds start address of receive buffer of serial port 2. which contains Redirection Entry Count. Buffer size is 256 bytes. Bits 12-15 are reserved. This variable holds start address of transmit buffer of serial port 2.: ED-2002-202 Published Apr 2005 Page 34 of 82 . Basic Rack.1 is bit for Slot-1 and so on. This array is modified at every Power ON and after project download. Holds slot registration status of 12 slots in Rack-0 i.5] OF WORD Access Read only Description Array of Maximum lengths of various segments – _ASEGMENTPTR [0]: Input _ASEGMENTPTR [1]: Output _ASEGMENTPTR [2]: Marker _ASEGMENTPTR [3]: Data _ASEGMENTPTR [4]: File Marker. BRACK_0_REG_STATUS.0 is bit for Slot-0. Least significant bit is registration status bit for Slot-0 and Most Significant bit is registration status bit for Slot-11. BRACK_0_REG_STATUS. This variable holds start address of receive buffer of serial port 1. Buffer size is 256 bytes.e. This variable holds start address of transmit buffer of serial port 1. Buffer size is 256 bytes. This string holds CPU RTS version. Buffer size is 256 bytes. 2000 4 PLC Configuration and I/O Addressing The I/O modules are mounted in I/O slots of base rack. There are different types of base racks as per following table – Ordering Code 2900 2912 2914 2916 2918 Description No I/O Slot.: ED-2002-202 Published Apr 2005 Page 35 of 82 .1. The figure below illustrates slot numbering associated with different types of base racks – PSU Slot PSU CPU Slot CPU 1st I/O Slot Slot 0 2nd I/O Slot Slot 1 3rd I/O Slot Slot 2 4th I/O Slot Slot 3 5th I/O Slot Slot 4 6th I/O Slot Slot 5 7th I/O Slot Slot 6 8th I/O Slot Slot 7 2900: No I/O Slots 2912: 2-I/O Slots 2914: 4-I/O Slots 2916: 6-I/O Slots 2918: 8-I/O Slots All I/O slots are identical and any I/O module can be placed in any of the I/O slots. PSU and 8-I/O slots. 4. The maximum size of base rack is having CPU. only PSU and CPU Slots 2-I/O Base Rack along with PSU and CPU Slots 4-I/O Base Rack along with PSU and CPU Slots 6-I/O Base Rack along with PSU and CPU Slots 8-I/O Base Rack along with PSU and CPU Slots The minimum size of base rack is having only CPU and PSU slots and no I/O slots. Thus it is necessary to define I/O configuration during application program development. Then rest all I/O slots are numbered from Slot-0 to Slot-7.1 I/O Slot Numbering The PSU module is placed in left most slot and CPU module occupies next slot. Processor CP 221x User Manual Document No.Messung Systems NEXGEN . the programming software for Nexgen2000 PLC.2000 4.: ED-2002-202 Published Apr 2005 Page 36 of 82 .2 PLC Configuration Procedure I/O configuration is defined using CoDeSys.Messung Systems NEXGEN . It is to be defined in following steps – Create a new project in CoDeSys with Nexgen2210 target. Then in project browser window. click on “Resources” tab – Processor CP 221x User Manual Document No.1. 2000 Double click on “PLC Configuration” and the window for defining I/o configuration will be invoked as shown below – Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 37 of 82 .Messung Systems NEXGEN . The details of a node in configuration window can be either expanded or collapsed with click on “+” or “-“sign appearing before the module description. 2-I/O Base Rack [SLOT] : The 2-I/O Base Rack has by default two submodules as “0 Pt Input + Output Module”.Messung Systems NEXGEN . These are two serial ports of the CPU module.2000 The default configuration for Nexgen2000 PLC consists of “Nexgen2000” at root of the configuration and two sub-modules as follows – CPU 2210 [FIX] : CPU Module has two sub-modules as “Port-1” and “Port2”. Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 38 of 82 . there are two nodes as 0 and 1. In case of I/O slots. By default all slots are configured with “0 Pt Input + Output Module”. It represents starting address from output memory of CPU. 0-7. Input address: This parameter indicates input memory allocated for particular slot. whereas 8-I/O base rack has 8 nodes. Every module has base parameters as follows – Module id: This is identity of the module. this number represents Slot number. where the digital input status obtained from the module in that slot will be stored during input scan.Messung Systems NEXGEN . which is transferred to the module in that slot during output scan. Output address: This parameter indicates output memory allocated for particular slot.2000 Now select individual slots from the rack with click of mouse left button on slot to be configured. which is not modifiable for the user. Node id: This is sub-module number within its base module. For 2-I/O base rack.: ED-2002-202 Published Apr 2005 Page 39 of 82 . It represents starting address from input memory of CPU. Processor CP 221x User Manual Document No. right click mouse button on the slot and select “Replace element” from the floating menu. It will invoke list of all types of available modules as shown in following figure – Processor CP 221x User Manual Document No.Messung Systems NEXGEN .: ED-2002-202 Published Apr 2005 Page 40 of 82 .2000 In order to configure a slot. 16. If a slot is configured as “16 Pt Output Module” and if 8 Pt output module is physically present in the slot (say 2711). select required slots and configure with desired I/O modules – Until now we have seen the procedure for PLC configuration with generic modules.Messung Systems NEXGEN . in multiples of 8. then CPU will not declare I/O Error. However.: ED-2002-202 Published Apr 2005 Page 41 of 82 . the slot is configured for its I/O point capacity. To facilitate such specific module configuration. then CPU will not declare I/O Error.2000 As explained in step above. This generic method of PLC configuration gives flexibility of replacing the faulty module with another module of same type but different I/O points capacity. The first 16 outputs will be activated by module and next 16 outputs will remain off. In case of generic configuration. sometimes application demands a specific module to be present in the slot and if any other type of module is replaced. 24 or 32 points of only-inputs or only-outputs or inputs+outputs. Similarly if a slot is configured as “16 Pt Output Module” and if a 32 Pt output module is physically present in the slot. The first 8 outputs will be activated by module and next 8 outputs will be ignored. Thus a slot may consume 0. then CPU should declare an I/O error. each Processor CP 221x User Manual Document No. 8. Half-Duplex mode.: ED-2002-202 Published Apr 2005 Page 42 of 82 .2000 slot has an additional parameter defined as “Module_Name”. 16 Pt DC Input module has ordering code as “2616”. Out of these two ports. if it is not used with CoDeSys. User can change this default configuration by selecting the required parameters from drop-down lists provided for all of these parameters. This is a string of 8 characters length and it should be programmed as per ordering code of the module. The CPU module has two sub modules as “Port-1” and “Port-2”. Refer Chapter 4. 8.2 regarding details of Card-Bit and I/O error handling for generic and specific configuration methods.Messung Systems NEXGEN . which should be defined as “Module_Name”. Port-1 can also be used as open protocol port. Odd. Port-1 is programming port and it is available for all variants of CPU module.g. By default it is configured for “NEXGEN_SLAVE” protocol and communication parameters as 9600. The “Station” parameter for “Nexgen_Slave” protocol is not applicable and it is ignored. then CPU continuously monitors the module present in that slot and detects I/O error for any other module found in that slot. 1. The following figure illustrates such specific configuration of a slot – If a slot is configured with “Module_Name” parameter. Processor CP 221x User Manual Document No. For e. “Freqrol”. the default configuration is no more applicable to the port. “Modbus RTU Slave”. “Freqrol”. “Modbus RTU Master”. The “Openport” FB may be called directly by application program or it may be implicitly called through some protocol FBs such as “Nexgen_Slave”. with port number as 1. “Dial_In”. “Modbus RTU Master”.” columns of the parameters window. “Send_SMS”. etc. Once the “Openport” FB is executed in logic scan. “Send_SMS”. Odd. the default configuration is no more applicable to the port. 8. The default configuration for Port-2 can be changed by user by selecting required parameters from drop-down lists.: ED-2002-202 Published Apr 2005 Page 43 of 82 . “Dial_In”. as long as application program does not call “Openport” function block from Nexgen2210 library.2000 This default configuration is applicable in run mode. Processor CP 221x User Manual Document No.” and “Max. The “Openport” FB may be called directly by application program or it may be implicitly called through some protocol FBs such as “Nexgen_Slave”. “Modbus RTU Slave”.Messung Systems NEXGEN . 1. “Dial_Out”. The following figure illustrates default configuration for Port-1 – The Port-2 of CPU module is by default configured for “MODBUS_RTU_SLAVE” protocol with communication parameters as 19200. etc. This default configuration is applicable in run mode. These limits are represented in “Min. Half Duplex mode and Station number as 1. Once the “Openport” FB is executed in logic scan. with port number as 2. In case of Modbus RTU Slave protocol the “Station” number is a valid parameter and its permissible range is from 1 to 247. as long as application program does not call “Openport” function block from Nexgen2210 library. “Dial_Out”. Messung Systems NEXGEN .2000 The following figure illustrates default configuration for Port-2 – Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 44 of 82 . Messung Systems NEXGEN .3 PLC Configuration Example The following table explains I/O addressing for 8-I/O Base rack configured with different types of I/O modules – PSU Slot CPU Slot I/O Slot-0 2616: 16 Pt DC Input Module I/O Slot-1 I/O Slot-2 2616: 16 Pt DC Input Module I/O Slot-3 2114: 8 Pt DC Input + 6 Pt Relay Output Module I/O Slot-4 I/O Slot-5 2616: 16 Pt DC Input Module I/O Slot-6 2114: 8 Pt DC Input + 6 Pt Relay Output Module %IB7 %QB4 8 Pt input + Output Module %QB5 %QB6 I/O Slot-7 2712: 12 Pt Relay Output Module 8 Pt input + Output Module 16 Pt Output Module 16 Pt Input Module Input Addresses Output Addresses - - %IB0 %IB1 - %QB0 %QB1 %IB2 %IB3 - 16 Pt Input Module Slot Configuration to be selected in CoDeSys %IB4 %QB2 %QB3 %IB5 %IB6 - Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 45 of 82 16 Pt Output Module - 8 Pt Output Module 16 Pt Input Module 2712: 12 Pt Relay Output Module 2113: Universal AC PSU 2711: 8 Pt Relay Output Module CP-2211 .2000 4.1. 1 Case Slot is holding a digital I/O module with more number of I/O points than it’s configured capacity. Only I/O points will get consumed. Only I/O points as per configuration will get consumed. but only physically available output points will be activated. Only available number of points on the module will be serviced. At power on condition. which will be updated in Input image of CPU. OFF OFF OFF OFF CPU will not report slot error. Then it was removed. OFF OFF 3 4 Slot is configured as 8. CardBit OFF I/O Err OFF Action Taken by CPU Only configured number of I/O points will be serviced. No. ON ON Processor CP 221x User Manual Document No.2 I/O Module Error detection – There are two cases based on Module Configuration defined in the project: A.2000 4. Standard I/O point configuration without specific Module ID B. 16. Input module will send status of available number of points to CPU. In both cases.: ED-2002-202 Published Apr 2005 Page 46 of 82 . 24 or 32-point slot.Messung Systems NEXGEN . which will be updated and rest of the outputs will remain off. Output module will receive status of configured number of points from CPU. OFF OFF Module will be serviced as per configured capacity of the slot. Later on a module was inserted. Input module will send status of all available points. Once the module is registered and then it is found to be absent. then the card-bit and I/O error LED will be set. CPU will not report slot error. the received data validation / truncation will be handled by the recipient depending on the available I/O points. I/O point configuration with specific Module ID Case A: Standard I/O point configuration without specific Module ID Sr. but physically there is no module in the slot. Slot is configured as 8. 2 Slot is holding a digital I/O module with less number of I/O points than its configured capacity. 16. but CPU will update only configured number of points in input image. there was not any module in the slot. 24 or 32-point slot. Output module will receive status of only configured number of points from CPU. If during run time. No. set Card-bit and I/O error LED. then OFF On till Bootup. Card-bit and I/O Error LED will be set. Later on it is removed. there is a module in the slot.Messung Systems NEXGEN . a module in un-configured rack/slot reports its presence. At power on condition. The error will be reset in warm / cold start actions. Then it is re-inserted (hot plug-in same or other module) 6 A module placed in configured slot has more boot-up time than power on waiting period defined for CPU. 24 or 32-point slot. it will be serviced as per configured capacity of the slot and Card-bit & I/O Error LED will be reset. OFF OFF OFF OFF 7 ON ON Case B: I/O point configuration with specific Module ID Sr. presence monitoring shall not be activated for the module. 1 Case Slot is configured as 8. CPU will report slot error. 24 or 32-point slot with “Module_Name”. The access. then the card-bit and I/O error LED will be set.: ED-2002-202 Published Apr 2005 Page 47 of 82 . OFF OFF Module will be serviced as per configured capacity of the slot. 16. If the module boots up later than waiting period. then OFF Before Module boots up. 16. Processor CP 221x User Manual Document No. 16. Card-bit and I/O error LED will be reset and module will be serviced as per configured capacity of the slot. CardBit OFF I/O Err OFF Action Taken by CPU Module will be serviced as per configured capacity of the slot. Till then it will be treated like empty slot. 3 On till Bootup. it will be serviced as per configured capacity of the slot. If the module boots up later than waiting period. 24 or 32-point slot with “Module_Name”.2000 5 Slot is configured as 8. Slot is configured as 8. Module absent or different “Module_Name” observed in slot A module placed in configured slot has more boot-up time than power on waiting period defined for CPU and “Module_Name” is matching. 2 ON ON Module will not be serviced. Module present in the slot has matching “Module_Name”. ON ON Once the module is registered and then it is found to be absent. Then same module is reinserted ON ON CPU will report slot error. ON OFF ON OFF 5 ON OFF ON OFF If the module is found to be absent. Processor CP 221x User Manual Document No.2000 4 Slot is configured as 8. Later on it is removed.: ED-2002-202 Published Apr 2005 Page 48 of 82 . Then it was removed. then the Card-bit and I/O error LED should be set. 24 or 32-point slot. Later on a module was inserted with matching “Module_Name”. 16. then the Card-bit and I/O error LED will be set. Module will be serviced as per configured capacity of the slot. 16. there was no module in the slot. there is a module in the slot with matching “Module_Name”. At power on condition. 24 or 32-point slot. Module will be serviced as per configured capacity of the slot. Slot is configured as 8.Messung Systems NEXGEN . If the module is found to be absent. At power on condition. OFF OFF Module will be serviced as per configured capacity of the slot. The following figure gives details of this display – CPU Status Indications RUN Slot-0 Slot-1 Slot-2 Slot-3 A2 A3 MEM B2 B3 Slot-8 B4 Ixx.1 D5 Ixx. Processor CP 221x User Manual Document No. Memory Error SCAN Error If “Low Battery” error.3 Byte Selection A5 1x B5 Ixx.0 C5 Ixx.1 Lo Bat Ixx.2 Ixx.3 2x A7 3x B7 Qxx.6 D6 Qxx. else OFF.: ED-2002-202 Output Status Published Apr 2005 Page 49 of 82 A6 Input Status A4 D4 E4 Slot Selection A1 B1 C1 D1 E1 .0 C2 Slot-5 D2 Slot-6 E2 Slot-7 I/O Err Slot-4 C3 D3 E3 Slot-9 Slot-10 Slot-11 C4 Ixx. There are two keys provided on CPU module to navigate through I/O image available on CPU.4 C7 Qxx. CPU Status indications.6 E7 Qxx.4 B6 Qxx.2000 4. else OFF.5 C6 Qxx. This display indicates CPU diagnostics status and also it facilitates I/O status monitoring.7 E6 Qxx. If “I/O Error”.7 These LEDs indications have following significance – LED Number A1 A2 A3 A4 Red OFF OFF ON ON FLASH ON Green ON FLASH Significance PLC is in RUN mode Forcing or redirection is effective.Messung Systems NEXGEN .3 I/O Status Monitoring – In Nexgen2000 PLC I/O status indication is not on individual module but there is a LED display matrix provided on CPU fascia for monitoring the status of inputs and outputs.2 E5 Ixx.5 D7 Qxx. If there is 16 Pt Input module in Slot-0. else OFF Ixx. Status of Output-Bits of the selected Slot and Byte is indicated. if the Slot is healthy.0 is ON.9 is selected Slot.4 is selected Slot.5 is ON. else OFF Qxx.4 is ON. If there is not valid project loaded in PLC (“MEM” error condition).3 is ON. else OFF Qxx. else OFF If A5.1 is ON. else OFF Ixx.2 is ON. otherwise the Slot-selection indication will be RED. I/O Status indications per slot will be shown as per PLC configuration defined in CoDeSys during project definition. It means the current status is of 1X byte. Only one Base-Rack with Max 12– I/O Slots (0-11).8 is selected Slot.0 is selected Slot.7 is ON. Processor CP 221x User Manual Document No.3 is selected Slot. A6 and A7 are OFF.2000 A5 A6 A7 B1 C1 D1 E1 B2 C2 D2 E2 B3 C3 D3 E3 B4 C4 D4 E4 B5 C5 D5 E5 B6 C6 D6 E6 B7 C7 D7 E7 ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON ON Status of Byte-1 of the Slot Status of Byte-2 of the Slot Status of Byte-3 of the Slot Slot. then CPU will read configuration from all available slots at power on.3 is ON.1 is selected Slot. else OFF Qxx. user has to press “Up” key once and then A5 LED will be put ON.0 is ON. else OFF Ixx.6 is ON.2 is ON.4 is ON.10 is selected Slot. In order to monitor next eight inputs (Byte-1). GREEN LED indicates selected Slot.5 is ON. then its first eight inputs (Byte-0) status will be indicated when B1 LED is ON and A5.1 is ON.11 is selected Ixx.2 is selected Slot. Indicates Slot-Number for which I/O Bit-Status is displayed. else OFF Ixx. Then CPU will indicate I/O status as per physical configuration read from the slots.: ED-2002-202 Published Apr 2005 Page 50 of 82 . till any project is downloaded.6 is selected Slot. This status depends on Slot-Selection and Byte-Selection.7 is ON. else OFF Ixx. At a time status of only one input byte and one output byte can be monitored. else OFF Qxx. else OFF Qxx. else OFF Qxx.7 is selected Slot. else OFF Ixx. else OFF Ixx. else OFF Qxx. else OFF Qxx. Status of Input-Bits of the selected Slot and Byte is indicated.5 is selected Slot.Messung Systems NEXGEN . A6 & A7 LEDs are OFF. then status of Byte-0 of the selected Slot is shown.6 is ON. then Byte-2 (A6 On) and Byte-3 (A7 On) of the same slot. A6 is ON indicating that the currently displayed status is of 2X byte d) Press “Up” key once to select Byte-3 (A7 On) of the same slot. Key pressed and not released for more than 1 sec: Auto increment/decrement the Slot->Byte selection with 1-second updating rate. Status and error indication LEDs for CPU are mapped in above display. A6 & A7: OFF) selection indications will be shown. otherwise it will be RED.Messung Systems NEXGEN . till key is not released. If the slot is configured with more than 16 points. Status of Input Byte-1 of Slot-0 is indicated by B4-E5 Status of Output Byte-1 of Slot-0 is indicated by B6-E7. then application project should be cleared and “MEM” LED indication should be set. corresponding Card-Bit is OFF). Then Slot-0 will again get selected. i) Action for “Up” and “Down” keys will be changed as per duration as follows – Key pressed and released within 1 sec: Inch type operation. Status of Input Byte-0 of Slot-0 is indicated by B4-E5 Status of Output Byte-0 of Slot-0 is indicated by B6-E7. otherwise next slot will get selected. j) During RUN or STOP Mode: If “Up” and “Down” keys are pressed together. b) Press “Up” key once to select Byte-1 (A5 On) of the same slot. l) The Slot number indication will be GREEN if the selected Slot is healthy (i. A7 is ON indicating that the currently displayed status is of 3X byte e) Press “Up” key to select next slot. otherwise next slot will get selected. k) During power-up sequence: If “Up” and “Down” keys are pressed together.e. then status of Byte-2 will be displayed. If the slot is configured with more than 8 points.2000 The steps given below explain the procedure to be followed for browsing through /O status monitoring. otherwise next slot will get selected. Thus Slot->Byte numbers will get selected cyclically in hierarchical order. Status of Input Byte-2 of Slot-0 is indicated by B4-E5 Status of Output Byte-2 of Slot-0 is indicated by B6-E7. then status of Byte-1 will be displayed. f) Press “Up” key to select Byte-1 (A5 On).: ED-2002-202 Published Apr 2005 Page 51 of 82 . then no action will be taken. Slot-0 (B1) and Byte-0 (A5. If the slot is configured with more than 24 points. Processor CP 221x User Manual Document No. a) At power on. Status of Input Byte-3 of Slot-0 is indicated by B4-E5 Status of Output Byte-3 of Slot-0 is indicated by B6-E7. Status of Input Byte-0 of Slot-1 is indicated by B4-E5 Status of Output Byte-0 of Slot-1 is indicated by B6-E7. h) Pressing “Down” key will track the same sequence of Slot->Byte selection in reverse order. Status and Error indications of Intelligent I/O Modules will be mapped in the I/O memory for each module and be automatically displayed on above display as I/O memory. then status of Byte-3 will be displayed. The interpretation of the I/O LEDs will vary depending on type of the Intelligent Module. g) This sequence will be followed till Slot number exceeds 0-11 range. A6 & A7: OFF) selection indications will be shown. A5 is ON indicating that the currently displayed status is of 1X byte c) Press “Up” key once to select Byte-2 (A6 On) of the same slot. Thus Slot-1 (C1) and Byte-0 (A5. Messung Systems NEXGEN . Processor CP 221x User Manual Document No.2000 Example of Status Monitoring – Let us consider the PLC configuration as explained in figure below – PSU Slot CPU Slot I/O Slot-0 2616: 16 Pt DC Input Module I/O Slot-1 I/O Slot-2 2616: 16 Pt DC Input Module I/O Slot-3 2114: 8 Pt DC Input + 6 Pt Relay Output Module I/O Slot-4 I/O Slot-5 2616: 16 Pt DC Input Module I/O Slot-6 2114: 8 Pt DC Input + 6 Pt Relay Output Module %IB7 %QB4 8 Pt input + Output Module %QB5 %QB6 I/O Slot-7 2712: 12 Pt Relay Output Module 8 Pt input + Output Module 16 Pt Output Module 16 Pt Input Module Input Addresses Output Addresses - - %IB0 %IB1 - %QB0 %QB1 %IB2 %IB3 - 16 Pt Input Module Slot Configuration to be selected in CoDeSys %IB4 %QB2 %QB3 %IB5 %IB6 - Let us assume that PLC is configured as above and all modules as per configuration are inserted in respective slots and all of them are in healthy condition.: ED-2002-202 Published Apr 2005 Page 52 of 82 16 Pt Output Module - 8 Pt Output Module 16 Pt Input Module 2712: 12 Pt Relay Output Module 2113: Universal AC PSU 2711: 8 Pt Relay Output Module CP-2211 . e. Status of %IB0 is indicated by B4 to E4 and B5 to E5 LEDs. Press Up key once to select next slot. No I/O. i.2000 Now let us go through steps to monitor the status of last byte %QB6 of 2712 module in Slot-7 on 5x7 LED display – Step 1 CPU is in RUN mode. MEM or LO-BAT errors Slot-0 is selected & is healthy. Output status is OFF Status of %IB1 A1 A2 A3 A4 A5 A6 A7 B1 B2 B3 B4 B5 B6 B7 C1 C2 C3 C4 C5 C6 C6 D1 D2 D3 D4 D5 D6 D7 E1 E2 E3 E4 E5 E6 E7 Processor CP 221x User Manual Document No. MEM or LO-BAT errors A1 A2 A3 A4 A5 A6 A7 Display Status B1 B2 B3 B4 B5 B6 B7 C1 C2 C3 C4 C5 C6 C6 D1 D2 D3 D4 D5 D6 D7 E1 E2 E3 E4 E5 E6 E7 Action to be taken Slot-0 is selected & is healthy. No I/O.e.Messung Systems NEXGEN . Slot-0 is selected. Press Up key once to select next byte from same slot. Status of %IB1 is indicated by B4 to E4 and B5 to E5 LEDs. Byte-0 of Slot-0 is selected 2 CPU is in RUN mode. %IB1. Slot-1. Default state after power on is indicated.: ED-2002-202 Byte-1 of Slot-0 is selected Output status is OFF Status of %IB0 Published Apr 2005 Page 53 of 82 . i. MEM or LO-BAT errors Slot-1 is selected & is healthy.: ED-2002-202 Output status is OFF Status of %IB2 Published Apr 2005 Page 54 of 82 .2000 3 CPU is in RUN mode. Press Up key once to select next slot.e.e. %QB1 Byte-1 of Slot-0 is selected 4 CPU is in RUN mode. No I/O. Status of Byte-0 of it is shown. Status of Byte-0 from this slot. %IB3 Byte-0 of Slot-2 is selected Processor CP 221x User Manual Document No. A1 A2 A3 A4 A5 A6 A7 B1 B2 B3 B4 B5 B6 B7 C1 C2 C3 C4 C5 C6 C6 D1 D2 D3 D4 D5 D6 D7 E1 E2 E3 E4 E5 E6 E7 Slot-1 is selected. Slot-2 Byte-1 of Slot-1 is selected 5 CPU is in RUN mode. No I/O. A1 A2 A3 A4 A5 A6 A7 B1 B2 B3 B4 B5 B6 B7 C1 C2 C3 C4 C5 C6 C6 D1 D2 D3 D4 D5 D6 D7 E1 E2 E3 E4 E5 E6 E7 Status of %QB0 Input status is OFF Status of %QB1 is indicated by B6 to E6 and B7 to E7 LEDs. Press Up key once to select next byte from same slot. No I/O. Press Up key once to select next byte from same slot.e. MEM or LO-BAT errors Slot-2 is selected & is healthy. Status of %QB0 is shown by B6 to E6 and B7 to E7 LEDs. I. i.Messung Systems NEXGEN . i. A1 A2 A3 A4 A5 A6 A7 B1 B2 B3 B4 B5 B6 B7 C1 C2 C3 C4 C5 C6 C6 D1 D2 D3 D4 D5 D6 D7 E1 E2 E3 E4 E5 E6 E7 Status of %QB1 Input status is OFF Slot-2 is selected. MEM or LO-BAT errors Slot-1 is selected & is healthy.e. i. %IB2 is indicated by B4 to E4 and B5 to E5 LEDs. i.e. i.e. Press Up key once to select next slot. CPU is in RUN mode. %QB2 is indicated by B6 to E6 and B7 to E7 LEDs. Press Up key once to select next slot. MEM or LO-BAT errors Slot-4 is selected & is healthy. Slot-3 Byte-1 of Slot-2 is selected 7 CPU is in RUN mode. No I/O. MEM or LO-BAT errors Slot-2 is selected & is healthy. %IB3 is indicated by B4 to E4 and B5 to E5 LEDs.Messung Systems NEXGEN . i. Slot-4 Slot-4 is selected. Press Up key once to select next slot. Status of Byte-1 from this slot. Output Status of Byte-0 from this slot. MEM or LO-BAT errors Slot-3 is selected & is healthy.e. A1 A2 A3 A4 A5 A6 A7 B1 B2 B3 B4 B5 B6 B7 C1 C2 C3 C4 C5 C6 C6 D1 D2 D3 D4 D5 D6 D7 E1 E2 E3 E4 E5 E6 E7 Output status is OFF Status of %IB3 Slot-3 is selected. i. %IB4 is indicated by B4 to E4 and B5 to E5 LEDs. No I/O. A1 A2 A3 A4 A5 A6 A7 B1 B2 B3 B4 B5 B6 B7 C1 C2 C3 C4 C5 C6 C6 D1 D2 D3 D4 D5 D6 D7 E1 E2 E3 E4 E5 E6 E7 Slot-2 is selected.: ED-2002-202 Status of %QB3 Input status is OFF Status of %QB2 Status of %IB4 Published Apr 2005 Page 55 of 82 .e.e.e. i. i. i.e. No I/O. %QB3 is indicated by B6 to E6 and B7 to E7 LEDs. Input Status of Byte-0 from this slot.2000 6 CPU is in RUN mode. Slot-5 Byte-0 of Slot-3 is selected 8 Byte-0 of Slot-4 is selected Processor CP 221x User Manual Document No. i.e. A1 A2 A3 A4 A5 A6 A7 B1 B2 B3 B4 B5 B6 B7 C1 C2 C3 C4 C5 C6 C6 D1 D2 D3 D4 D5 D6 D7 E1 E2 E3 E4 E5 E6 E7 Output Status of Byte-0 from this slot. i. Press Up key once to select next slot. No I/O. i.e.: ED-2002-202 Status of %QB4 Status of %IB7 Published Apr 2005 Page 56 of 82 . Input Status of Byte-1 from this slot. i. %IB7 is indicated by B4 to E4 and B5 to E5 LEDs. Output Status of Byte-0 from this slot.e. No I/O. A1 A2 A3 A4 A5 A6 A7 B1 B2 B3 B4 B5 B6 B7 C1 C2 C3 C4 C5 C6 C6 D1 D2 D3 D4 D5 D6 D7 E1 E2 E3 E4 E5 E6 E7 Slot-6 is selected. i. Slot-6. Press Up key once to select next slot. Press Up key once to select next byte from same slot. Input Status of Byte-0 from this slot. %IB5 is indicated by B4 to E4 and B5 to E5 LEDs. A1 A2 A3 A4 A5 A6 A7 B1 B2 B3 B4 B5 B6 B7 C1 C2 C3 C4 C5 C6 C6 D1 D2 D3 D4 D5 D6 D7 E1 E2 E3 E4 E5 E6 E7 Output status is OFF Status of %IB5 Slot-5 is selected. %IB6 Byte-0 of Slot-5 is selected 10 CPU is in RUN mode. Slot-7 Byte-0 of Slot-6 is selected Processor CP 221x User Manual Document No. No I/O. Input Status of Byte-0 from this slot.e.Messung Systems NEXGEN . A1 A2 A3 A4 A5 A6 A7 B1 B2 B3 B4 B5 B6 B7 C1 C2 C3 C4 C5 C6 C6 D1 D2 D3 D4 D5 D6 D7 E1 E2 E3 E4 E5 E6 E7 Slot-5 is selected. %IB6 is indicated by B4 to E4 and B5 to E5 LEDs. %QB4 is indicated by B6 to E6 and B7 to E7 LEDs.e. i. i. MEM or LO-BAT errors Slot-5 is selected & is healthy.2000 9 CPU is in RUN mode. Byte-1 of Slot-5 is selected Output status is OFF Status of %IB6 11 CPU is in RUN mode. MEM or LO-BAT errors Slot-5 is selected & is healthy.e.e. MEM or LO-BAT errors Slot-6 is selected & is healthy.e. i. It is possible to go in either direction at any stage by pressing UP or DOWN key.Messung Systems NEXGEN . Press Up key and it will roll-back to Slot-0. In case of faulty I/O module. Byte-0. Byte-1. %QB5 is indicated by B6 to E6 and B7 to E7 LEDs. i. Otherwise press Down key to see status of Slot-7. MEM or LO-BAT errors Slot-7 is selected & is healthy. then same sequence will be reverse-tracked till reaching to Slot0. Byte-0 and then it will roll-back to Slot-7. %QB6 is indicated by B6 to E6 and B7 to E7 LEDs. the common indication “I/O Error” LED (A2) glows and when respective Slot gets selected. Press Up key once to select Byte-1. Output Status of Byte-1 from this slot.e. %QB6 Byte-0 of Slot-7 is selected 13 CPU is in RUN mode. If DOWN key is pressed. i. it is indicated by red LED instead of green LED.2000 12 CPU is in RUN mode.e. using only UP key. No I/O.e. byte-0. A1 A2 A3 A4 A5 A6 A7 B1 B2 B3 B4 B5 B6 B7 C1 C2 C3 C4 C5 C6 C6 D1 D2 D3 D4 D5 D6 D7 E1 E2 E3 E4 E5 E6 E7 Slot-7 is selected. No I/O. Byte-1 of Slot-7 is selected The above steps explain browsing through I/O status monitoring in forward direction. MEM or LO-BAT errors Slot-5 is selected & is healthy.: ED-2002-202 Status of %QB6 Input status is OFF Published Apr 2005 Page 57 of 82 . i. Processor CP 221x User Manual Document No. Output Status of Byte-0 from this slot. A1 A2 A3 A4 A5 A6 A7 B1 B2 B3 B4 B5 B6 B7 C1 C2 C3 C4 C5 C6 C6 D1 D2 D3 D4 D5 D6 D7 E1 E2 E3 E4 E5 E6 E7 Status of %QB5 Input status is OFF Slot-7 is selected. 2000 5 Operating Modes The Processor has provided with four different operating modes. The logic scan then refers this stored status. 5.: ED-2002-202 Published Apr 2005 Page 58 of 82 .Messung Systems NEXGEN . The output status gets updated as per application program. Input Scan Keyboard Scan Input Redirection Possible by programming software ‘CoDeSys’ Input Forcing Possible by programming software ‘CoDeSys’ Execution of default POU ‘PLC_PRG’ Logic Scan Variable Forcing Possible by programming software ‘CoDeSys’ Output Redirection Possible by programming software ‘CoDeSys’ Output Forcing Possible by programming software ‘CoDeSys’ Output Scan Applicable only if programming cable (2910) is connected to serial port 1 Programming Communication Services Figure 8: PLC Scan The Processor scans the information related to various inputs and stores the status. • • • • RUN STOP Single cycle Bootstrap Load The subsequent sections explain the operating modes in details. The figure below shows the typical PLC scan.1 RUN In RUN mode. The execution sequence is called as a PLC scan. the Processor executes the application program. In Processor CP 221x User Manual Document No. It updates this status as per the redirection and forcing. The logic scan executes the application program line by line and the results are updated. input scan. In STOP mode. from the input scan to the output scan and then PLC is put in STOP mode. Configured interrupt event execution (like periodic. In this mode. the STOP mode behavior is different and is discussed individually in respective user manuals. 5. Refresh_In. Bootstrap Load The Processor is put in bootstrap loading mode to download a new operating system. Refresh_Out. Serial ports of CPU have default configuration defined in CoDeSys. After execution of “Openport” FB in logic scan. In STOP mode. However. it is necessary to define a POU named as “PLC_PRG”.2000 logic scan.e. To download new operating system or to update existing operating system. the Processor executes one scan cycle i. This completes one PLC scan. Other program type of POUs or Function or Function Block type of POUs may be called through PLC_PRG.4 .3 Single Cycle In single scan mode. etc) takes place on the occurrence of the event at any time during PLC scan. output scan and programming serial port remains functioning. This is possible by using functions Refresh_In and Refresh_Out respectively. except input and output scan and part of logic scan in which I/O modules are accessed using functions like IM_Read. After output scan. Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 59 of 82 5. The “Openport” FB may be called directly or implicitly through some protocol FBs like Nexgen_Slave. etc) takes place on the occurrence of these events at any time during total PLC scan.Messung Systems NEXGEN . To put the Processor in bootstrap loading mode. internal timer interrupts. digital outputs are switched OFF physically. Thus during application program development. the output image holds its last status.2 STOP When PLC is in STOP mode. the Processor remains in STOP mode and the “CPU ERR” LED on the module is put ON. the operating system of PLC calls a default POU named as PLC_PRG and it gets executed. After logic scan. The Processor then performs output scan and updates physical output status. Modbus RTU Slave. the Processor stops executing the application program. communication requests from programming device (CoDeSys) are handled. IM_Write. etc. For intelligent I/O modules. the serial ports communicate as per default configuration. output status is updated as per redirection and forcing. However. 5. Serial ports operate with configured protocol as long as there is no execution of “Openport” FB in application program. The Processor continues this operation as long as PLC is in RUN mode. System interrupt service execution (like serial communication related interrupts. Immediate Input and output status updating on I/O modules during logic scan can be executed on demand. PC based software utility Bootstrap Loader Tool is used. as long as there is no execution of “Openport” FB during logic scan. jumpers are provided at back side of the Processor module. the default configuration of the port is no more applicable. CPU watchdog fault. The subsequent topics explain in detail significance of this information.1 LED Indications The table below explains the significance of these LEDs.: ED-2002-202 Published Apr 2005 Page 60 of 82 .Messung Systems NEXGEN . CPU put in bootstrap load mode All modules inserted are as per configuration declared in the application program and are healthy. I/O bus read / write fault Faulty or incorrect module present in slot. then application program from flash PROM is not copied to the RAM and the Processor declares the application program in the RAM as invalid.2000 6 Troubleshooting The Processor module operates on 5 VDC provided by power supply module. CPU is in 'STOP' mode Application program fault CPU watch dog fault Forcing / Writing any PLC variable from programming device. PLC remains in STOP mode. in program execution mode. Redirection of any I/O point is active CPU is healthy Hardware fault of CPU module. In this case.6 VDC) is discharged bellow 2. LOW BAT Red During power ON. PLC can be put in run mode after downloading the application program either from programming software ‘CoDeSys’ or from the memory cassette. Processor CP 221x User Manual Document No. Application program is healthy. Battery is faulty. It provides five LED indications. Scan time exceeds beyond permissible limit. Memory error is indicated by displaying ‘M’ on LED display. It is fitted next to power supply module in the basic rack. Application program is invalid or absent. I/O module/s not inserted properly or faulty. which gives status and diagnostic information of PLC system. This feature is useful when any invalid instructions are programmed in application program and during run time execution it is leading to continuous resetting of the system. Ni-MH battery (3.5 VDC. if < and > keys provided on CPU fascia are kept pressed simultaneously. LED Color Status ON OFF Flashing (5 Hz) OFF RUN Green CPU Red ON OFF I/O Red ON OFF ON Flashing (5 Hz) OFF ON MEM Red Indication CPU is in 'RUN' mode i. Battery backup for CPU RAM is healthy. 6.e. Figure 9: Jumpers on the Processor Module for Bootstrap Mode Processor CP 221x User Manual Document No. which is generally used for the programming. The same serial link cable 2910 used for programming the PLC is used for this purpose.Messung Systems NEXGEN . The figure below shows the jumpers on the Processor module for switching to bootstrap mode.: ED-2002-202 Published Apr 2005 Page 61 of 82 .2000 7 Appendix 1 – Downloading Operating System The bootstrap loader tool is used to download a new operating system or to update existing operating system. The operating system is downloaded from the PC using the serial port 1 (RS232C). After downloading a new operation system. Processor CP 221x User Manual Document No. the jumper positions should be as shown in following figure – To download a new operating system.: ED-2002-202 Published Apr 2005 Page 62 of 82 . To download a new operating system.2000 For normal operation of the Processor module and for updating the existing operating system.Messung Systems NEXGEN . it is necessary to remove the Processor Module from the rack and change the jumper position. the jumper positions should be as shown in following figure – A new operating system is normally downloaded in the factory. jumper position shall be changed for the normal operation. Processor CP 221x User Manual Document No. User can browse through folder list and select the required binary file for particular OS version.Messung Systems NEXGEN .: ED-2002-202 Published Apr 2005 Page 63 of 82 . click on “Open” button and the dialog will be closed.BIN”.2000 The subsequent section explains how to use Bootstrap Loader Tool. After executing bootstrap. After selecting the file. In case of Nexgen-2000 PLC. PLC: This is a combo box and it facilitates selection of desired PLC type for which the operating system is to be updated. which indicates the selected file name for the CPU OS. The file name is indicated along with its path. File: This is an Edit field. the selected PLC type shall be ‘Nexgen2000’. Browse: Click on this button will invoke the “File open” dialog with default file type as “. The selected file name is then displayed in “File” field.exe file. main dialog for the utility will get invoked as shown below – The main dialog has various components as follows – Comm Port: This is a combo box and it facilitates selection of desired COM port of the PC for communication with PLC. as mentioned above. Thus before every OS download. the sequence of operations for updating existing OS is initiated. the erasing action is initiated. Command ‘Exit’ terminates the bootstrap utility. “OS Part” is permanently checked and it is not accessible to user.bin’ extension gets invoked. the jumper position on CPU module shall not be changed.2000 Erase Selection: This section has three check boxes to select the erasing options during OS downloading. Processor CP 221x User Manual Document No. This power cycling sequence is necessary to put the CPU in bootstrap mode. Update OS: With click on this button. the sequence of operations for downloading new OS is initiated. Once the required binary file for specific version of OS is browsed and selected. In order to execute this action properly. The erasing is done as per selection defined in “Erase” section. In order to update the OS. Exit: Click on this button will terminate the bootstrap utility.Messung Systems NEXGEN . the jumpers on CPU module shall be set to appropriate position and then PLC shall be switched off and on again. File Under ‘File’ menu. the file gets opened. Then dialog gets closed and selected file name along with its path appears in the field named as “File” on main dialog. the OS part will get erased. Same action is taken with click on “Browse” button of main dialog. Out of these three check boxes. New OS: With click on this button. a dialog for opening a file with ‘. User has option to selectively erase “User Ladder Code” (application codes) and “User Source Codes” before downloading the OS. Erase: With click on this button.: ED-2002-202 Published Apr 2005 Page 64 of 82 . commands ‘Open’ and ‘Exit’ are provided – With click on ‘Open’. Jumpers will be in same position as that of normal operation of the PLC. the system remains in bootstrap mode. After downloading the OS in “Update OS” mode. then display shows ‘M’ LED on. “Update OS” and “Erase”. the CPU goes to run mode and resumes normal operation. then ‘M’ LED indication will be on. After downloading a valid application program through CoDeSys. ‘Update OS’ and ‘Erase’ are provided – These three commands initiate the same actions as that of buttons provided on main dialog for “New OS”. then CPU goes in RUN mode and starts executing the existing application program. Processor CP 221x User Manual Document No. After downloading the OS in “New OS” mode.Messung Systems NEXGEN . The “CPU Err” LED indication is on. The normal operation of the Processor module can be resumed after downloading a valid application program through CoDeSys.: ED-2002-202 Published Apr 2005 Page 65 of 82 . User has to remove the module from the slot and change the jumper position to resume normal operation.2000 Online Under ‘File’ menu. commands ‘New OS’. If the application codes are erased during OS downloading. If application codes are not erased (“User Ladder Code” check box is un-checked). the system gets reset and if the application program codes are erased (“User Ladder Code” check box is checked). Messung Systems NEXGEN . The figures below illustrate the possible setups to establish such connection. Thus. The modem used at PC end could be internal modem or external modem. remote programming and on line monitoring is possible.: ED-2002-202 Published Apr 2005 Page 66 of 82 .2000 8 Appendix 2 – Remote Programming and On Line Monitoring via Modem The programming software ‘CoDeSys’ can communicate with the Processor module CP 221x onwards via modem. PC with the Programming software ‘CoDeSys’ Nexgen 2000 PLC To COM Port RS232C PSTN To RS232C CP 221x Port 1 External Modem at PC end External Modem at PLC end Figure 10: Set Up with External Modem PC with the Programming software ‘CoDeSys’ Nexgen 2000 PLC To Telephone socket PSTN PC with Internal Modem To RS232C CP 221x Port 1 External Modem at PLC end Figure 11: Set Up with Internal Modem Processor CP 221x User Manual Document No. it is necessary to select 3S modem driver in the ‘CoDeSys’ using command ‘Online’ ‘Communication parameters’.. ‘Communication parameters’ pops up a dialog box Click on 'New. Select device name as ‘Serial (Modem)’ by using down key or clicking on the name.2000 In normal communication using direct programming cable 9910. The selected name is highlighted.: ED-2002-202 Published Apr 2005 Page 67 of 82 . Processor CP 221x User Manual Document No.' button so that dialog box will pop up. After selection. 3S RS232 driver is selected in ‘Communication parameters’..Messung Systems NEXGEN . The command ‘Online’ shown below. To establish communication through the modem. click on OK button. : ED-2002-202 Published Apr 2005 Page 68 of 82 . For internal modem. Then dial string is sent to the modem. ‘CoDeSys’ starts serial communication for programming and on line monitoring. -This is time required for Modem to establish communication. which in turn establishes a link with remote modem connected to the PLC. ‘CoDeSys’ gateway driver initializes the modem connected at PC end with the set baud rate and other communication parameters. Baud rate can be selected to suit the link conditions.Messung Systems NEXGEN . the ‘CoDeSys’ disconnects the link by sending hang up command. Once the link is established.2000 A new channel is added with default parameter settings as shown below. choose the com port assigned to the modem during installation. Click command ‘Online’ ‘Login’ from ‘CoDeSys’. communication via modem is possible. Processor CP 221x User Manual Document No. Seconds COM Port Remark -Where xxxxx is the number to be dialed. When ‘Online’ ‘Logout’ command is issued. Terminate Communication. The different driver parameters need to be set as shown in the table below. Name Init Dial Hang up Timeout Port Default Value AT&F0 ATDT ATH 60 COM1 New Value AT ATDTxxxxx ATH 60 COM2 Comment Initialize modem Dial Number. Select the port to which external modem is connected. ---- Baudrate Parity Stop bits Motorola byteorder 38400 No 1 No 38400 No 1 No ----- Once this driver is configured. 1 Settings on PC 2 In order to execute the gateway server.97 Nexgen 2000 PLC Gateway server To COM Port RS232C To CP 221x Port 1 Hub / Switch Figure 12: Set Up with LAN Ethernet LAN In this setup. Then instance of the gateway server run on PC 2 and its icon appears in the task bar as shown below.Messung Systems NEXGEN . 9. the programming software ‘CoDeSys’ is running on PC1 and the gateway server is running on PC 2.168. double click on ‘Start’ ‘Programs’ ‘CoDeSys V2.2000 9 Appendix 3 – Remote Programming and On Line Monitoring via LAN The PLC programming software ‘CoDeSys’ can communicate with the Processor module series CP 221x via TCP/IP connection.: ED-2002-202 Published Apr 2005 Page 69 of 82 .3’ ‘Communication’ ‘Gateway’.0. The following figure illustrates the required setup to establish such connection.95 PC 2 IP Address 192. The subsequent sections explain the settings required on PC 1 and PC 2 to establish communication. Gateway Icon Processor CP 221x User Manual Document No. PC 1 with ‘CoDeSys IP Address 192. The PLC is connected to COM port of PC 2.168.0. After selection. In ‘CoDeSys’ click on the command 'Online’ ‘Communication Parameters' so that the dialog box is popped up.Messung Systems NEXGEN .: ED-2002-202 Published Apr 2005 Page 70 of 82 . Click on 'New. The selected name is highlighted.2 Settings on PC 1 To establish the connection between ‘CoDeSys’ running on PC 1 and PLC connected to PC 2.2000 9. the following settings are required at PC1. Select device name as ‘Serial (Modem)’ by using down key or clicking on the name..' button so that dialog box will pop up.. click on OK button. Processor CP 221x User Manual Document No. Enter the IP Address of the PC on which the gateway server is running. (PC 2 is having IP Address as 192. Then click on button 'Gateway.: ED-2002-202 Published Apr 2005 Page 71 of 82 .168.0. Processor CP 221x User Manual Document No. Select the ‘Connection’ as ‘TCP/IP’ from drop down list.2000 Select ‘Serial (RS232)' driver and click on 'OK'. The data request commands from ‘CoDeSys’ to the PLC are always routed through the gateway server. whereas the link between gateway server and PLC is established via RS232C serial interface.Messung Systems NEXGEN . The link between ‘CoDeSys’ and gateway server is established via TCP/IP bus.97). Execute the command 'Online’ ‘Login' in ‘CoDeSys’ running on the PC 1 and the communication between running instance of ‘CoDeSys’ on PC1 is established with Nexgen-5000 PLC connected to PC 2..' in dialog box 'Communication Parameters' to set the communication parameters of the gateway.. Then click on ‘OK’. The figure below shows the memory cassette. Figure 13: Memory Cassette The front side provides a push button and two LED indications for the user interface. the application program can be transported easily. 32 Kb Memory cassette. PC based programming software ‘CoDeSys’ can download the application program code and or source code to the cassette. Variety of options depending upon the size of application program code memory is available. This is a flash PROM type of intelligent memory cassette.2000 10 Appendix 4 – Memory Cassette The memory cassette is used to store the application program code and the source code. ‘CoDeSys’ can upload the source code from the cassette when ever required. Processor CP 221x User Manual Document No. The subsequent discussion explains how to set or configure the cassette for a particular PLC type and the application program transfer related to the cassette. Item Memory cassette. The backside provides 9-pin D female connector for the interface with the PC or the Processor module. the cassette need to be set using the PC based software ‘Bootstrap Loader Tool’. 128 Kb Memory cassette. Thus. 64 Kb Memory cassette. 392 Kb Cassette adapter kit Programming Cable Ordering Code 9901 9902 9903 9904 9905 9911 9910 Before downloading the application program to the cassette. The table below illustrates the different cassettes and related accessories. 256 Kb Memory cassette. This application program code and source code can be downloaded to the Processor module from the cassette.Messung Systems NEXGEN .: ED-2002-202 Published Apr 2005 Page 72 of 82 . which can be directly mounted on 3-pin 230 VAC socket and provides 5 VDC through 2-pin jack pin. Bootstrap Loader Tool / CoDeSys Memory Cassette PC COM Port Cassette adapter Programming cable 9910 230 VAC to 5 VDC Power supply 5 VDC Power supply To 230 VAC Power supply Figure 14: Set Up to Configure and Program the Memory Cassette The memory cassette is connected to the adapter with 9-pin D connector plugged in. 2.2000 10. One end is connected to PC using programming cable 9910 and the memory cassette is connected to the other end.Messung Systems NEXGEN .: ED-2002-202 Published Apr 2005 Page 73 of 82 . This tool is used: o o o To erase the cassette. Processor CP 221x User Manual Document No. It consists of two items. it is necessary to set the cassette using PC based software tool ‘‘Bootstrap Loader Tool’. To read the configuration of the cassette. 1.1 Configuration of Memory Cassette A new application program code and or source code can be downloaded to the blank cassette. The programming cable is connected to the COM port of the PC. The memory cassette gets 5 VDC through the adapter. To set the memory cassette. The figure below shows the entire set up. cassette adapter kit is required. 5 VDC power supply unit – It is 230 VAC to 5 VDC converter. To set the cassette for a particular PLC type. The 9-pin D connector on the other end of adapter is connected to the programming cable. Cassette adapter – It has two 9-pin D male connectors at the both ends. It has socket to connect 5 VDC externally. 5 VDC supply is connected to the adapter through jack pin of the 230 VAC to 5 VDC power supply. For the same. which is ultimately supplied to the cassette. Command ‘Select PLC’ pops up dialog box. Settings In ‘Settings’ menu. etc. Command ‘Comm Port’ provides options as Comm 1 to Comm 6. The serial link cable from PC to the cassette adapter is connected to the COM port selected. Nexgen523x. which provides drop down options as Nexgen 2000. Selected communication port displays check symbol.: ED-2002-202 Published Apr 2005 Page 74 of 82 . Nexgen 5000.2000 After executing Bootstrap. 1. Hence.4 K baud. The Menus ‘Settings’ and ‘Cassette’ are related to the memory cassette. Nexgen522x. Smartgen-20. Default communication parameter settings are 38. Processor CP 221x User Manual Document No. serial port. it is necessary to ensure proper PLC type before setting a cassette. PLC type can be selected.exe file. screen shows Menu bar as shown in the screen.Messung Systems NEXGEN . This software is used for variety of the Processor modules for the different PLC series. 8. none. Selected PLC type is displayed in the text box. Processor CP 221x User Manual Document No. For the cassette 9904. It takes few seconds to erase the entire flash PROM and after erasing. Read PLC Name With the command ‘Read PLC Name’.PLC type already set for the cassette is displayed.Messung Systems NEXGEN . the memory cassette is set for the PLC type already selected. the message ‘Cassette is erased’ is displayed. Cassette OS version – The memory cassette is an intelligent cassette.0’. Read Configuration With the command ‘Read Configuration’. Set PLC With the command ‘Set PLC’. After erasing. The message ‘PLC is <PLC type>’ is displayed. first connection with the cassette is established which is displayed by the message ‘Checking Cassette’. Once the connection is established and the cassette is set correctly. With the commands.2000 Cassette In the menu ‘Cassette’. the cassette information is displayed as: • • • Cassette size – Cassette size as per ordering code is displayed. the message ‘PLC is set’ is displayed. Erase Code Area With the command ‘Erase Code area’. the cassette can be set and the configuration of the cassette can be read. During this period. This menu provides various options as shown in the screen.: ED-2002-202 Published Apr 2005 Page 75 of 82 . Then the Flash PROM is erased displaying message ‘Erasing Flash PROM……’. PLC type . the message ‘Cassette size is 256K Bytes’ is displayed. the message ‘Cassette is erased’ is displayed. It displays operation system version available as ‘OS Version 1. the message ‘Erasing Flash PROM……’ is displayed. the application program code and source code is erased in flash PROM. The message ‘PLC is <PLC type>’ is displayed. PLC type already set for the cassette is displayed. 8 data bits and 1 stop bit. LED Green Red Blinking OFF (with 1Hz frequency) ON OFF OFF ON Status Application program code is blank. the programming software ‘CoDeSys’ can download the application program codes and source codes. In this case. it displays the size of the code. If it is blank. • The relevant error messages are displayed if the cassette physical connection or serial communication with the PC is not proper. First. 10.2000 • Ladder code status – It displays the status of application program code as blank or Invalid or valid. If the code area is blank. to download the application program code. downloading is not possible and the cassette should be set for the PLC type selected in target setting of the application program. Source code status – It displays the status of application program source code as blank or Invalid or valid. Once communication parameters are selected.: ED-2002-202 Published Apr 2005 Page 76 of 82 . none parity. set the communication parameters for ‘CoDeSys’ using menu ‘Online’ ‘Communication Parameters’.2 Sending Application Program from CoDeSys to Cassette A valid application program can be downloaded with the set up as shown in the figure 18. a new source code can be downloaded. Green LED on the cassette blinks with 1 Hz frequency and Red LED is put OFF. use commands ‘Online ‘Login’. Here. If code is valid. select serial (RS232) communication port as COM1 onwards. Other communication parameter settings are 38. If code is valid. If the PLC type of the cassette and target setting of the application program is not matching. a new application program code can be downloaded.4 K baud. The error message is displayed as shown below. If it is blank. it displays the size of the code. Application program code is valid.Messung Systems NEXGEN . Application program code is invalid Once the cassette is set. Processor CP 221x User Manual Document No. The status of the application program code is indicated by two LEDs provided on the front side of the cassette. While downloading the code. Here. Red LED on the cassette flickers for 3-4 seconds and ‘CoDeSys’ logs out displaying the error message box as shown below. While downloading the code to the cassette. Processor CP 221x User Manual Document No.Messung Systems NEXGEN . When entire code is downloaded. After successful download.: ED-2002-202 Published Apr 2005 Page 77 of 82 . green LED on the cassette stops flickering and starts blinking with 1 Hz frequency indicating valid application program code in the cassette. If button ‘No’ is pressed. Press button ‘Yes’ to download the application program code. green LED on the cassette flickers with high frequency.2000 If the cassette is set properly and the connection is established. the code is not downloaded to the cassette and logging in is completed. when download is initiated. the following dialog box will pop up. the dialog box pops up as shown below. press any button to complete the downloading process and hence logging in process. If a valid or invalid code is already present in the cassette. the message box displays the total size of the code as shown below. In this case. ‘Stop’. After successful download. The command ‘File’ ‘Open’ ‘PLC’ uploads the entire source code from the cassette. etc are not relevant with the memory cassette. While downloading the source code. Processor CP 221x User Manual Document No. ‘Create boot project’.: ED-2002-202 Published Apr 2005 Page 78 of 82 . The valid application program source code can be uploaded from the memory cassette using ‘CoDeSys’. red LED on the cassette flickers with high frequency for 3-4 seconds. If communication is not established between the cassette and ‘CoDeSys’ the error message is displayed as shown below. the error message box is displayed as shown below. green LED on the cassette flickers with low frequency.2000 The application program source code can be downloaded to the cassette using command ‘Online’ ‘Source code download’ in logging in process is complete. The cause can be problem in physical connection or the application program code is not erased completely. This command starts downloading the source code and the status is displayed as shown below until it completes the downloading process.Messung Systems NEXGEN . green LED stops flickering with low frequency. If user tries to download the source code without erasing source code area. All other commands like ‘Run’. Valid application program code and source code . in following cases – o Invalid application program code. the memory cassette is fixed on the serial port 1 with 9-pin D connector plugged in. Application program code is valid. Once the code transfer is completed. red LED flickers with high frequency for 3-4 seconds. LED Green Blinking (1Hz frequency) ON OFF Red OFF OFF ON Status Application program code is blank.In this case. o The application program code in the cassette consists of any POU from external library not supported by Processor operating system. The earlier code is preserved. The green LED on the cassette glows permanently after successful transfer. the Processor is put in STOP mode first and the code is downloaded to the module. Processor CP 221x User Manual Document No.Messung Systems NEXGEN . During transfer. The status of the application program code is indicated by two LEDs provided on the front side of the cassette. the source code is downloaded to the Processor module without putting Processor in STOP mode. the Processor is put is STOP mode first and the code is downloaded to the module.: ED-2002-202 Published Apr 2005 Page 79 of 82 . green LED starts flickering with low frequency. green LED on the cassette starts flickering with high frequency. Application program code is invalid Press push button provided on the front side of the cassette twice to initiate transfer. The 5 VDC supply for working of the memory cassette is provided by the module. The 4-character display on the Processor module shows ‘MEMR’ by putting ‘MEM’ LED ON. The Processor is put is RUN mode after completing the transfer. source code is transferred and the Processor is put in Run mode after completing the transfer. While downloading. These are error conditions and the transfer is aborted.In this case.3 Sending Application Program from Cassette to Processor Module The application program code and source code can be transferred to the Processor module. o PLC type of the cassette and the Processor module mismatch.2000 10. There are three different conditions as below: • Valid application program code only – In this case. If code transfer is initiated. • Valid application program source code only . The 4-character display on the Processor module shows the operating system version like ‘R200’ or any relevant message. For transfer. • The application code or source code is transferred from the cassette to the Processor module only if it is valid. The code and or source code if valid is transferred to the Processor module. The file marker memory is used to store process settings. recipe data. FIFO_STK. history and data logging information.2000 11 Appendix 5 – File Marker Memory The file marker variables are stored in battery backed up RAM. it is mapped in registers from 430001 to 464576. For the same.PB49150 P20. DBRD. The file marker memory is used mainly where data blocks are processed. The file marker memory is mapped in page 20 from PB0 to PB49151. File Marker Memory Area BYTE 0 BYTE 1 BYTE 2 BYTE 3 Mapping in Page (P) Variables for Nexgen Protocol P20.PB49151 454576 The file marker memory above byte 1023 and the marker memory above %MW7678 is not accessible in existing Smartline HMI and E terminal with Nexgen protocol. LIFO_STK. DBFIL. In the application program.Messung Systems NEXGEN . The necessary functions and function blocks for accessing file marker memory as different data types are provided in Utilities library and Nexgen2210 library. Nexgen_Master. Processor CP 221x User Manual Document No. function related to DB fill can be used for the purpose. B_MOVE.: ED-2002-202 Published Apr 2005 Page 80 of 82 . it is also mapped as registers with Modbus protocol. DBWR. The table below shows the dual mapping of file marker memory.PB3 Mapping in Register (4xxxxxx) Variables for Modbus Protocol 430001 430002 BYTE 49150 BYTE 49151 P20. DBSRCH.PB1 P20. This is permanently retained memory and is not cleared by the system on warm or cold start initialization. The provision to access file marker memory by external devices like HMI and SCADA is provided. etc The file marker memory or part of file marker memory can be cleared through the in application program and through PLC browser commands. etc by the application program. etc Few function blocks are listed below. Few functions are listed below.PB0 P20. The file marker memory is mapped as page memory so that the PLC variables can be accessed by Nexgen protocol. The user can access (read / write) this memory area by reference in the application program. TBL_RDWR. RTU_Slave and RTU_Master are provided. Also. Alternately. In PLC Browser the command “ClearFM <Starting Address> <Length>” is supported.PB2 P20. function blocks Nexgen_Slave. 2000 Processor CP 221x User Manual Document No.Messung Systems NEXGEN .: ED-2002-202 Published Apr 2005 Page 81 of 82 . – (+91) – 020 – 27102100 NEXGEN . ED-2002-202 Processor CP 221x User Manual Document No. Bhosari. – (+91) – 020 – 27102000 Fax. J .Block. INDIA Tel.: ED-2002-202 Published Apr 2005 Page 82 of 82 . MIDC.2000 MESSUNG SYSTEMS EL – 2.2000 PLC Processor CP 221x User Manual Document No.Messung Systems NEXGEN . PUNE – 411 026.
Copyright © 2024 DOKUMEN.SITE Inc.