Sie sind auf Seite 1von 82

Messung Systems

NEXGEN - 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: marketing@ms.messung.com 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

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

Messung Systems

NEXGEN - 2000

INDEX OF FIGURES
Figure 1: Front View of the Processor Module ....................................................................... 11 Figure 2: Serial Communication Ports .................................................................................... 18 Figure 3: Connection Diagram of Communication Port 1 ....................................................... 19 Figure 4: Connection Diagram of Communication Port 2 ....................................................... 20 Figure 5: Memory Cassette..................................................................................................... 21 Figure 6: Addressing method for PLC variables ..................................................................... 24 Figure 7: Memory Map of the Markers.................................................................................... 25 Figure 8: PLC Scan................................................................................................................. 58 Figure 9: Jumpers on the Processor Module for Bootstrap Mode .......................................... 61 Figure 10: Set Up with External Modem ................................................................................. 66 Figure 11: Set Up with Internal Modem .................................................................................. 66 Figure 12: Set Up with LAN .................................................................................................... 69 Figure 13: Memory Cassette................................................................................................... 72 Figure 14: Set Up to Configure and Program the Memory Cassette...................................... 73

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 5 of 82

Messung Systems

NEXGEN - 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. The manual has been written to be used by trained and competent personnel. The definition of such a person or persons is as follows: Any engineer who is responsible for the planning, design and construction of automatic equipment using the product associated with this manual should be of a competent nature, trained and qualified to the local and national standards required to fulfill that role. These engineers should be fully aware of all the aspects of safety about automated equipment. Any commissioning or service engineer must be of a competent nature, trained and qualified to the local and national standards required to fulfill that job. These engineers should also be trained in the use and maintenance of the completed product. This includes being completely familiar with all associated documentation for the said product. All maintenance should be carried out in accordance with established safety practices. 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. The operators should also be familiar with documentation, which is connected with the actual operation of the completed equipment. Note: The term completed equipment refers to a third party constructed device, which contains or uses the product associated with this manual. 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. Whenever any of the following symbols are encountered its associated note must be read and understood. Each of the symbols used is listed below with a brief description of its meaning.

a)

b)

c)

Warning !
Indicates special care must be taken when using this element of software.

Indicates a special point, which the user of the associate software element should be aware of.

Indicates a point of interest of further explanation.

Indicates a point to remember.

Warning !
This product can only function correctly and safely if it is setup and installed correctly, and operated and maintained as recommended.

Warning !
The specifications of product and contents of the manual are subject to change without notice.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 6 of 82

Messung Systems

NEXGEN - 2000

Processor Module
Nexgen-2000 PLC system, as on date, offers two variants of the Processor module as per the application need and the cost. 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. The Processor module fits in a slot next to the power supply module in the basic rack. The following section explains the types and the technical specifications of the series CP 221x.

1.1

Module Specifications The availability of number of communication ports and extensions decides the type of the Processor module. The ordering code is CP 221x. x has value 0 or 1 depending on the number of serial ports supported. The following table explains the difference in the various types. All other technical specifications are common.
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.: ED-2002-202

Published Apr 2005 Page 7 of 82

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, NiMH, 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

Messung Systems

NEXGEN - 2000

1.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. Other LEDs indicate I/O status, as explained later in this manual. 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. CPU watchdog fault. CPU put in bootstrap load mode CPU is in RUN mode i.e. in program execution mode. CPU is in STOP mode Application program fault CPU watch dog fault Forcing / Writing any PLC variable from programming device. Redirection of any I/O point 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. I/O module/s not inserted properly or faulty. Application program is healthy. Application program is invalid or absent. Scan time exceeds beyond permissible limit. Battery backup for CPU RAM is healthy. Ni-MH battery (3.6 VDC) is discharged bellow 2.5 VDC. Battery is faulty.

Red

Red

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 12 of 82

Messung Systems

NEXGEN - 2000

1.4

Memory The Processor module has two onboard memory areas, RAM and flash PROM. The following sections explain the utilization of the memory

1.4.1

RAM Onboard RAM has battery back up. The utilization of RAM depending on functionality is as shown below.

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.1.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. The application program then refers this status in the logic scan. The instruction Refresh_In reads the input status from a particular slot and updates CPU input image memory. Input image is addressable global memory and hence the external devices like HMI and SCADA can 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. The output scan activates the actual outputs as per the output process image. After logic scan, the processor executes output scan. The instruction Refresh_Out writes the CPU output image to a particular I/O slot. Output image is addressable global memory and hence the external devices like HMI and SCADA can access it. The output process image is not retained. Markers Marker memory holds the intermediate results in the application program. This is addressable global memory and hence the external devices like HMI and SCADA can access it. Marker memory (except from %MB0 to %MB127) can be retained selectively. Data Data memory holds the intermediate results in the application program and Function Block instance data. This memory can have local or global access as per the user definition. The programming software CoDeSys assigns the addresses for the variables in data memory during compilation of the application program. These addresses may change during number of compilations during the application program development. As the addresses are not fixed, the external devices like HMI and SCADA cannot access it.

1.4.1.2

1.4.1.3

1.4.1.4

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 13 of 82

Messung Systems

NEXGEN - 2000

1.4.1.5

File Markers File marker memory stores the data, which is retained even after program change or cold start initialization. Generally, it stores the process settings, recipe data, history and data logging information, etc through the application program. These file markers cannot be accessed directly by % address like input, output and markers. However, a set of functions and functions blocks can read and write to the file markers. It is possible to access file markers via serial communication by Modbus RTU and Nexgen protocol. Hence, the external devices like HMI and SCADA can also access this memory. For more details, refer Appendix 5.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 14 of 82

Messung Systems

NEXGEN - 2000

1.4.1.6

System Variables The System Variables are implicitly defined global variables. These variables exchange the information with PLC operating system and its functionalities. These variables shall be read or written in the application program based on the functionality of that variable. Some variables, if written, may result in malfunctioning of the processor.

1.4.1.7

Application Program Memory The application program code is stored in this memory area. During RUN time, the application program is executed from RAM. 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. At every power ON, the operating system copies the application program code from the flash PROM to the RAM and executes from there.

1.4.2

Flash PROM The Processor has onboard nonvolatile flash PROM. The memory utilization is as shown below.
Operating system Application program code Application program source code 198 Kb 128 Kb 512 Mb

1.4.2.1

Operating System This memory contains the core codes of the Processor module. This code handles the various functions of the Processor module. It is possible to update operating system codes using special PC based software Bootstrap Loader Tool. This facilitates easy maintenance and CPU feature up gradation.

1.4.2.2

Application Program Code (Boot Project) The programming software CoDeSys compiles the application program to executable codes for the processor. This binary code is downloaded from PC to application codes sector of RAM on the Processor module. During run time, application codes from RAM are executed. Since these project codes are in RAM, this memory gets cleared 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. This eliminates the need of any memory cassette permanently plugged on the Processor module as a program backup device. At every power ON, the processor copies application program codes from flash PROM to RAM and then executes the program from RAM. Alternatively, the application program codes may be stored in the memory cassette as permanent back up and for easy transportation. For more details, refer Appendix 4.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 15 of 82

Messung Systems

NEXGEN - 2000

1.4.2.3

Application Program Source Code User develops the application project using various IEC languages under CoDeSys programming environment. CoDeSys then compiles the project to executable codes for the processor used. The source project file contains all project related information like, programs in various languages, comments, variable declaration, variable names and comments, password, libraries (optional) etc. It is necessary to store all this information in the format the user has defined. The programming software CoDeSys provides two options to store this project file on either hard disk of PC or in the Processor flash PROM. Thus it is possible to store the project file in compressed format in onboard flash PROM using Source code download command from CoDeSys. The command File Open Read from PLC can read the source code project file from the Processor module. Alternatively, the source code can also be stored in the memory cassette as permanent back up and for easy transportation. For more details, refer Appendix 4.

1.5

RUN Time Execution The programming software CoDeSys downloads the application program codes to RAM in the Processor module. The program is always executed from this memory. Since this memory is volatile, it looses the data at every power ON. Thus, it is necessary to store the entire application program in permanent flash PROM memory on the Processor module. At every power ON, the processor copies the application program code from flash PROM to RAM and then starts execution from RAM.

If the application program code is not stored in flash PROM (Create boot project command from CoDeSys), after power ON, the processor declares invalid application program code in RAM and displays M on LED display. This puts PLC in STOP mode.

During power ON, if < and > keys on the keyboard are kept pressed simultaneously, the application program code from flash PROM is not copied to RAM. The Processor declares invalid application program code in RAM. In this case, it is necessary to download a fresh application program code again from CoDeSys or through memory cassette.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 16 of 82

Messung Systems

NEXGEN - 2000

1.6

Online Application Program Change The Processor supports online application program change. The application program code is executed from the RAM. During online program change, 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. The operating system ensures smooth changeover from old to modified application program codes. Once the application program is finalised, the new codes must be transferred to flash PROM using Create boot project command from CoDeSys, else the changes made in the application program codes since last Create boot project operation will be lost during next power ON.

1.7

Battery Back Up The PLC variables data is stored in RAM. RAM is volatile memory thus in the event of a power failure, data gets lost. To retain the data in RAM, the Processor module provides battery back up. This battery also provides the back up to onboard Real Time Clock (RTC). The processor module series CP 221x use 3.6 V Ni-MH (Nickel Metal Hydride) rechargeable battery, which is mounted on board. An electronic circuit charges the battery when the module is powered ON. The battery provides data backup time of up to 6 months from fully charged condition, if the PLC is kept in powered OFF condition.

If battery is discharged below 2.5 V, red LED B glows. To charge the battery again, keep the Processor module powered ON for at least about 8 hours.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 17 of 82

Messung Systems

NEXGEN - 2000

1.8

Serial Communication Ports The Processor module supports three independent serial communication ports which can communicate to different third party devices simultaneously. The figure below shows the Processor module with all the three serial ports.
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. With serial link cable, it acts as open port and can communicate with any third party device by executing relevant protocol Function Block in the application program.

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. RS232C/RS422/RS485 hardware

Figure 2: Serial Communication Ports The Processor module provides hardware for serial interface. For a serial port, the processor provides system buffer of 256 bytes each for reception and transmission. The operating system provides driver functions and function blocks, which directly controls the hardware interface. 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). The user can develop the application specific function blocks to handle serial communication with third party devices like printer, inverter, programmable logic controller, HMI, etc with different protocols. Using driver functions and function blocks, port parameters can be assigned, data bytes can be transmitted and received and status of serial communication can be monitored. Thus the application program can exchange data with the serial port. 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). User can develop suitable logic in any language (SFC, ST, etc) to handle station
Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 18 of 82

Messung Systems

NEXGEN - 2000

numbers, communication retries, communication error handling, etc as per the application need. 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.

Figure 3: Connection Diagram of Communication Port 1

Pin No. 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, TxD and GND on pins 2, 3 and 5 respectively. Pin 1 provides carrier detect signal status when modem is connected. The function block PORT_STATUS from library Nexgen2210 provides the status of carrier detection. Pin 9 provides ring indication when modem is connected and if any controlling device is dialing. The function block PORT_STATUS from library Nexgen2210 provides the status of the ring. Between pins 4 and 5, 5 VDC and ground are brought out. This 5 VDC is used for the memory cassette operation. It should not be used for any other purpose.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 19 of 82

Messung Systems

NEXGEN - 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) 7: Tx- (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. RS232C signals RxD, TxD and GND are brought out on pins 2, 3 and 5 respectively. RS422 signals Tx+, Tx-, Rx- and Rx+ are brought out on pins 4, 7, 8 and 9 respectively. Pin 1 provides carrier detection status when modem is connected. This status is available in the application program if function block PORT_STATUS from library Nexgen2210 is executed.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 20 of 82

Messung Systems

NEXGEN - 2000

1.9

Memory Cassette The memory cassette is used to store the application program code and the source code. Thus, the application program can be transported easily. This is a flash PROM type of intelligent memory cassette. The figure below shows the memory cassette. .

Figure 5: Memory Cassette

The front side provides a push button and two LED indications for user interface. 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. For the same, cassette adapter kit (9911) is required. CoDeSys can upload the source code from the cassette when ever required. This application program code and source code can be downloaded to the Processor module from the cassette through the serial port 1. For more details, refer memory cassette user manual.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 21 of 82

Messung Systems

NEXGEN - 2000

PLC Variables
Intermediate results in the application program can be stored in PLC variables. These PLC variables are mapped in marker memory area or data area. For declaration of any PLC variable, the following attributes are user definable. Name Type Initial Value Address Class Constant Retain

2.1

Name Name is a unique identifier, which is a sequence of letters, numbers, and underscores that begins with a letter or an underscore. The name should not contain any blank spaces or special characters and cannot be the same as any of the keywords. The Name is not case sensitive. The Name should not have more than one underscore character in a row. The length of Name is unlimited.

2.2

Type This attributes decides type of values it stores and memory space it consumes. The data types are categorized in two groups as standard data types and user defined data types as explained below.

2.2.1

Standard Data Types The table below shows some standard data types.
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.176 E-38 -3.4 E 0 -38 +38 +1.176 E to +3.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.: ED-2002-202

Published Apr 2005 Page 22 of 82

Messung Systems

NEXGEN - 2000

Some more standard data types are explained below STRING A STRING type variable can contain group of characters. The size entry in the declaration determines how much memory space should be reserved for the variable. It refers to the number of characters in the string. If no size specification is given, the default size of 80 characters is used. End of string is /0 Time Data Types The data types TIME, TIME_OF_DAY (TOD), DATE and DATE_AND_TIME (DT) are handled internally like DWORD. Time is given in milliseconds in TIME and TOD, time in TOD begins at 12:00 A.M. Time is given in seconds in DATE and DT beginning with January 1, 1970 at 12:00 A.M.

2.2.2

Defined Data Types This data type is user configurable. User defines the number of elements and size of data type.

ARRAY One, two or three dimensional group of similar data types.

POINTER Pointer is a variable which holds address of another variable or FB instance data. Variable or function block addresses are saved in pointers while a program is running. This address is stored in a DWORD. A pointer can point to any data type or function block, even to user defined types. ADR operator assigns the address of a variable or function block to the pointer. A pointer can be dereferenced by adding the content operator "^" (Caret) after the pointer identifier. ENUMERATION Enumeration is a user-defined data type that is made up of a number of string constants. These constants are referred to as enumeration values. STRUCTURE Structure is a group of different elementary data types.
Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 23 of 82

Messung Systems

NEXGEN - 2000

2.3

Initial Value In some applications, it is necessary to load some predefined values to certain variables, after power ON. During declaration of a variable, initial value can programmed, though it is optional. If such variable is retained, then after warm start initialization, retained value is loaded. However after cold start initialization or if variable is not retentive, the variable gets initialized to its defined initial value.

2.4

Addressing Variable can be associated with a definite address. The addressable memory areas are Input image area ( I ), Output image area ( Q ) and Marker area ( M ). The memory areas addressable by using % sign have global access. The table below shows the addressable memory area types.
%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 application program execution in the logic scan refers this input process image. 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. The output scan refers this output process image. After logic scan, the Processor module executes output scan and switches On/OFF all the outputs of I/O modules configured. This memory area is used to store intermediate results in the application program. It is accessed and updated during logic scan.

Input

Output

%Q

Marker

%M

The figure below shows the addressing method for accessing such variables.

Denotes fixed address

%M X mmmm. n

Bit address This identifies bit within specified byte address. The bit address can be 0 to 7.

Variable Type Input I Output Q Marker M

Delimiter. This is a decimal point applicable while accessing bit from BYTE, 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.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 24 of 82

Messung Systems

NEXGEN - 2000

2.4.1

Memory Mapping Basically, memory mapping is byte wise. The figure below shows memory mapping for markers.
Bits %MD0 %MD2 %MD4 %MW0 %MW2 %MW4 %MB0 %MB1 %MB2 %MB3 %MB4 %MB5 %MX5.7 %MX3.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.5 Figure 7: Memory Map of the Markers

Byte 7675 Byte 7676 Byte 7677 Byte 7678 Byte 7679

Marker memory size is 7680 bytes. The addressing is from %MB0 to %MB7679. One byte consists of 8 bits. Bit 0 is Least Significant Bit and bit 7 is Most Significant Bit. Individual bit in a byte is accessed with prefix X.
Address %MX3.0 %MX5.7 %MX7679.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. Marker WORD is accessed with prefix W.
Address %MW0 %MW2 %MW7676 %MW7678 Data Type WORD WORD WORD WORD Lower Byte %MB0 %MB2 %MB7676 %MB7678 Higher Byte %MB1 %MB3 %MB7677 %MB7679

Only, even WORD addresses are valid. Odd addresses like %MW1, %MW3, %MW7677 are invalid.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 25 of 82

Messung Systems

NEXGEN - 2000

Marker memory can be accessed as DWORD type variable. Marker DWORD is accessed with prefix D.
Address %MD0 %MD2 %MD7676 Data Type DWORD DWORD DWORD Lower Byte %MW0 %MW2 %MW7676 Higher Byte %MW2 %MW4 %MW7678

Only, even DWORD addresses are valid. Odd addresses like %MD1, %MD3, %MD7675 invalid.

2.5

Class Class defines the scope of the variable. The variable scope can be local or global. Local Variables The scope of the local variable is limited to a POU where it is declared. The variable does not carry same status or meaning in different POUs even though the name is same. The different categories of local variables are

2.5.1

VAR These are local variables for storing temporary results of any POU. The other POUs cannot refer these variables. VAR_IN These are local variables acting as input to any POU. That means that at the call position, the value of the variables can be given along with a call. These are read only type of local variables inside that POU.

VAR_OUT These are local variables acting as output of any POU. That means that these values are returned back to the POU making the call. There they can be used further.

VAR_IN_OUT These are local variables acting as input as well as output of any POU. The value of such variable is passed by reference. This type of variable is not applicable for functions (FUN)

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 26 of 82

Messung Systems

NEXGEN - 2000

2.5.2

Global Variables The scope of the global variable is global for the application program consisting of number of POUs. The variable carries same status or meaning through out the complete application program. The number of POUs can access global variable and modify it and this modified value is referred by another POU, which is accessing it latter. These variables are used to pass information from one POU to another POU. By default variables %I, %Q and %M are global variables. The global variables are defined with keyword VAR_GLOBAL.

2.6

Constant Any variable can be declared as constant. The range of value and presentation format depends on the data type. This variable can be a local variable or global variable. The notations for different data types are different.
Example 14, 11000 16#AAC0, 16#1359 8#7, 8#14 2#11000000, 2#10101 TRUE or FALSE T#10m30s500ms, T#10s, T#500ms D#2002-01-01 , d#2000-03-04 TOD#15:36:30.123, TOD#00:00:00 DT#2002-01-01-15:36:30 7.4 , 1.64e+009 Name of Operator , 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.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 27 of 82

Messung Systems

NEXGEN - 2000

2.7

Retain In the event of power fail, all the variable data stored in RAM gets lost. In some applications, it may be required to retain the values of variables even after power fail. The local or global variables can be declared as retentive selectively. If any variable is declared as retentive, then after warm start retained value is loaded in first PLC scan. However after cold start, variable is initialized to the initial value or to zero. Function Block instance like any other PLC variable can be declared as retentive. By default, PLC variables %M (except 128 bytes from %MB0 to %MB127) are retentive if not explicitly declared in the application program. Therefore, it is necessary to avoid using such PLC variables directly as %MX20.0, %MW100, %QB0 without explicit declaration in the application program. In declaration, user can define whether such PLC variables are retentive using keyword VAR_RETAIN. PLC variables %I and %Q can not be retained. File marker memory is retained by default. It is not cleared during warm and cold start initialization or even after the application program download.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 28 of 82

Messung Systems

NEXGEN - 2000

2.8

Addressing Range The following table shows the PLC variables and addressing range with respect to data type.
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.0 to %IX0.7 %IX1.0 to %IX1.7

%IX127.0 to %IX127.7 I I I B W D %IB0, %IB1, %IB2 to %IB127 %IW0, %IW2, %IW4 to %IW126 %ID0, %ID4, %ID8 to %ID124 %QX0.0 to %QX0.7 %QX1.0 to %QX1.7

X ( X is optional )

%QX127.0 to %QX127.7 Q I I B W D %QB0, %QB1, %QB2 to %QB127 %QW0, %QW2, %QW4 to %QW126 %QD0, %QD4, %QD8 to %QD124 %MX0.0 to %MX0.7 %MX1.0 to %MX1.7

X ( X is optional )

%MX7679.0 to %MX7679.7 M M M B W D %MB0, %MB1, %MB2 to %MB7679 %MW0, %MW2, %MW4 to %MW7678 %MD0, %MD2, %MD4 to %MD7676

Only, even WORD addresses are valid. Odd addresses like %IW1, %MW3, %MW7675 are invalid. Only, even DWORD addresses are valid. Odd addresses like %MD1, %QD3, %MD7675 are invalid. The programming software CoDeSys version 2.2 supports access as BOOL and BYTE for input memory (%I) and output memory (%Q).

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 29 of 82

Messung Systems

NEXGEN - 2000

System Variables
The system variables are implicitly defined global variables, which can exchange the information between the Processor module and the application program. Each system variable has a unique Name, which starts with underscore _. 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. This byte is updated whenever related action is executed. 1- Hot Start _BINITSTATUS holds 1, if system detects a power break for less than 25 ms but greater than 10 ms. In this case PLC functioning is normal as if there is no power disturbance. 2- Warm Start _BINITSTATUS holds 2 on power ON, if system detects a prior power break for more than 25 ms. It results resetting of data, which is not retained. 3- Cold Start _BINITSTATUS holds 3, if System detects any change in the application program. If a new application program is downloaded, cold start is observed. Destroying of battery back up retentive data because of battery back up circuit fault. Related standard initialization command (Reset Cold from CoDeSys) Any related fault in power supply module 5- Stop Mode, Other values are ignored. If _INITACTFORCE byte value is modified to 5, it puts Processor in STOP mode and the application program execution is halted. It continues to remain in STOP mode until power is ON. 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'. To put in RUN by power OFF, the project in Boot PROM must be valid.

_INITACTFORCE

16#0EC001

BYTE

Read / Write

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 30 of 82

Messung Systems

NEXGEN - 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. This variable is persistent. Holds number of warm start initialization occurrences. This variable is persistent. Holds scan time of last scan with 1 ms resolution. 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. Holds minimum scan time in all previous PLC scans after power ON with 1 ms resolution. The value is updated at the end of each scan. This value is initialized to _WLIMITMAXSCAN on every power ON or at any standard initialization action. Holds maximum scan time in all previous PLC scans after power ON with 1 ms resolution. The value is updated at the end of each scan. This value is initialized to zero on every power ON or any standard initialization action. This is the maximum limit for scan time. If current scan exceeds this limit, PLC is put in STOP mode and MEM LED starts flashing. Default value for this variable is 250 ms and it is loaded before logic-scan. If at the beginning of logic scan this value is modified (maximum 1000 ms), 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. Holds current Seconds value of RTC in BCD. Holds current Minutes value of RTC in BCD. Holds current Hours value of RTC in BCD. Holds current Date value of RTC in BCD. Holds current Month value of RTC in BCD. Holds current Year value (lower byte) of RTC in BCD. Holds current Year value (higher byte) of RTC in BCD.

_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, these system variables may contain random values. User should set Real Time Clock once by executing RTC handling functions like WRITE_DATE, WRITE_DATE_AND_TIME, WRITE_TIME provided in Nexgen2210 library. Also it is important to note that RTC is set to date of January 1, 1970 and time of 00H:00M:00S:00MS if battery-back up is lost.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 31 of 82

Messung Systems

NEXGEN - 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.e. Basic Rack. Least significant bit is status bit for Slot-0 and Most Significant bit is status bit for Slot-11. 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.0 is status bit for Slot-0, _BRACK_0_IOERR.1 is status bit for Slot-1 and so on. Bits 12-15 are reserved.

** In healthy condition, these system variables hold 0 value. If any of these bits holds nonzero value, red LED I/O ERR on the processor module glows.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 32 of 82

Messung Systems

NEXGEN - 2000

Name of Sysvar _BCPUSTATUS

Address
16#0EC030

Data Type BYTE

Access Read only

Description Holds status of the Processor. The significance of individual bit is explained below. Bit Status Significance TRUE CPU in RUN mode 0 FALSE CPU in STOP mode Redirection of any I/O point TRUE is defined. 1 No redirection of any I/O FALSE point is carried out. Forcing of any PLC variable TRUE is active. 2 No forcing of any PLC FALSE variable is done. 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. It is cleared while going to 'RUN' Mode. 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. User initiated STOP Mode 4 User Stop command Holds the starting address of redirection table. This is updated at every Power ON. Array of Starting Addresses of various segments _ASEGMENTPTR [0]: Input _ASEGMENTPTR [1]: Output _ASEGMENTPTR [2]: Marker _ASEGMENTPTR [3]: Data _ASEGMENTPTR [4]: File Marker. This array is modified at every Power ON and after project download.

_BCPUSTOPCAUS E

16#0EC031

BYTE

Read only

_DWREDIRECTTBL PTR _ASEGMENTPTR

16#0EC036 16#0EC03A

DWORD ARRAY [0..5] OF DWORD

Read only Read only

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 33 of 82

Messung Systems

NEXGEN - 2000

Name of Sysvar _ASEGMENTLEN

Address
16#0EC052

Data Type ARRAY [0..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. This array is modified at every Power ON and after project download. This variable holds start address of receive buffer of serial port 1. Buffer size is 256 bytes. This variable holds start address of transmit buffer of serial port 1. Buffer size is 256 bytes. This variable holds start address of receive buffer of serial port 2. Buffer size is 256 bytes. This variable holds start address of transmit buffer of serial port 2. Buffer size is 256 bytes. It is pointer to internal variable in RTS, which contains Redirection Entry Count. This string holds CPU RTS version. Holds slot registration status of 12 slots in Rack-0 i.e. Basic Rack. Least significant bit is registration status bit for Slot-0 and Most Significant bit is registration status bit for Slot-11. This bit is TRUE if CPU recognizes module in the slot, else it is FALSE. BRACK_0_REG_STATUS.0 is bit for Slot-0, BRACK_0_REG_STATUS.1 is bit for Slot-1 and so on. Bits 12-15 are reserved.

_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.: ED-2002-202

Published Apr 2005 Page 34 of 82

Messung Systems

NEXGEN - 2000

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, 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. The maximum size of base rack is having CPU, PSU and 8-I/O slots.

4.1.1 I/O Slot Numbering

The PSU module is placed in left most slot and CPU module occupies next slot. Then rest all I/O slots are numbered from Slot-0 to Slot-7. 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. Thus it is necessary to define I/O configuration during application program development.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 35 of 82

Messung Systems

NEXGEN - 2000

4.1.2 PLC Configuration Procedure I/O configuration is defined using CoDeSys, the programming software for Nexgen2000 PLC. 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.: ED-2002-202

Published Apr 2005 Page 36 of 82

Messung Systems

NEXGEN - 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 - 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. These are two serial ports of the CPU module. 2-I/O Base Rack [SLOT] : The 2-I/O Base Rack has by default two submodules as 0 Pt Input + Output Module. The details of a node in configuration window can be either expanded or collapsed with click on + or -sign appearing before the module description.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 38 of 82

Messung Systems

NEXGEN - 2000

Now select individual slots from the rack with click of mouse left button on slot to be configured. By default all slots are configured with 0 Pt Input + Output Module. Every module has base parameters as follows Module id: This is identity of the module, which is not modifiable for the user. Node id: This is sub-module number within its base module. In case of I/O slots, this number represents Slot number. For 2-I/O base rack, there are two nodes as 0 and 1, whereas 8-I/O base rack has 8 nodes, 0-7. Input address: This parameter indicates input memory allocated for particular slot. It represents starting address from input memory of CPU, where the digital input status obtained from the module in that slot will be stored during input scan. Output address: This parameter indicates output memory allocated for particular slot. It represents starting address from output memory of CPU, which is transferred to the module in that slot during output scan.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 39 of 82

Messung Systems

NEXGEN - 2000

In order to configure a slot, 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.: ED-2002-202

Published Apr 2005 Page 40 of 82

Messung Systems

NEXGEN - 2000

As explained in step above, select required slots and configure with desired I/O modules

Until now we have seen the procedure for PLC configuration with generic modules. In case of generic configuration, the slot is configured for its I/O point capacity, in multiples of 8. Thus a slot may consume 0, 8, 16, 24 or 32 points of only-inputs or only-outputs or inputs+outputs.

If a slot is configured as 16 Pt Output Module and if 8 Pt output module is physically present in the slot (say 2711), then CPU will not declare I/O Error. The first 8 outputs will be activated by module and next 8 outputs will be ignored.

Similarly if a slot is configured as 16 Pt Output Module and if a 32 Pt output module is physically present in the slot, then CPU will not declare I/O Error. The first 16 outputs will be activated by module and next 16 outputs will remain off.

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.

However, sometimes application demands a specific module to be present in the slot and if any other type of module is replaced, then CPU should declare an I/O error. To facilitate such specific module configuration, each
Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 41 of 82

Messung Systems

NEXGEN - 2000

slot has an additional parameter defined as Module_Name. This is a string of 8 characters length and it should be programmed as per ordering code of the module. For e.g. 16 Pt DC Input module has ordering code as 2616, which should be defined as Module_Name. The following figure illustrates such specific configuration of a slot

If a slot is configured with Module_Name parameter, then CPU continuously monitors the module present in that slot and detects I/O error for any other module found in that slot.

Refer Chapter 4.2 regarding details of Card-Bit and I/O error handling for generic and specific configuration methods.

The CPU module has two sub modules as Port-1 and Port-2. Out of these two ports, Port-1 is programming port and it is available for all variants of CPU module.

Port-1 can also be used as open protocol port, if it is not used with CoDeSys. By default it is configured for NEXGEN_SLAVE protocol and communication parameters as 9600, Odd, 8, 1, Half-Duplex mode. The Station parameter for Nexgen_Slave protocol is not applicable and it is ignored.

User can change this default configuration by selecting the required parameters from drop-down lists provided for all of these parameters.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 42 of 82

Messung Systems

NEXGEN - 2000

This default configuration is applicable in run mode, as long as application program does not call Openport function block from Nexgen2210 library, with port number as 1. 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, Modbus RTU Master, Freqrol, Dial_In, Dial_Out, Send_SMS, etc. Once the Openport FB is executed in logic scan, the default configuration is no more applicable to the port. 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, Odd, 8, 1, Half Duplex mode and Station number as 1. In case of Modbus RTU Slave protocol the Station number is a valid parameter and its permissible range is from 1 to 247. These limits are represented in Min. and Max. columns of the parameters window.

The default configuration for Port-2 can be changed by user by selecting required parameters from drop-down lists.

This default configuration is applicable in run mode, as long as application program does not call Openport function block from Nexgen2210 library, with port number as 2. 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, Modbus RTU Master, Freqrol, Dial_In, Dial_Out, Send_SMS, etc. Once the Openport FB is executed in logic scan, the default configuration is no more applicable to the port.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 43 of 82

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 - 2000

4.1.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

Messung Systems

NEXGEN - 2000

4.2 I/O Module Error detection There are two cases based on Module Configuration defined in the project: A. Standard I/O point configuration without specific Module ID B. I/O point configuration with specific Module ID Case A: Standard I/O point configuration without specific Module ID

Sr. No.
1

Case
Slot is holding a digital I/O module with more number of I/O points than its configured capacity.

CardBit
OFF

I/O Err
OFF

Action Taken by CPU


Only configured number of I/O points will be serviced. Input module will send status of all available points, but CPU will update only configured number of points in input image. Output module will receive status of only configured number of points from CPU, which will be updated and rest of the outputs will remain off. Only available number of points on the module will be serviced. Input module will send status of available number of points to CPU, which will be updated in Input image of CPU. Output module will receive status of configured number of points from CPU, but only physically available output points will be activated. In both cases, the received data validation / truncation will be handled by the recipient depending on the available I/O points. CPU will not report slot error. Only I/O points as per configuration will get consumed.

Slot is holding a digital I/O module with less number of I/O points than its configured capacity.

OFF

OFF

Slot is configured as 8, 16, 24 or 32-point slot, but physically there is no module in the slot. Slot is configured as 8, 16, 24 or 32-point slot. At power on condition, there was not any module in the slot. Later on a module was inserted. Then it was removed.

OFF

OFF

OFF

OFF

CPU will not report slot error. Only I/O points will get consumed.

OFF

OFF

Module will be serviced as per configured capacity of the slot. 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.

ON

ON

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 46 of 82

Messung Systems

NEXGEN - 2000

Slot is configured as 8, 16, 24 or 32-point slot. At power on condition, there is a module in the slot. Later on it is removed.

OFF

OFF

Module will be serviced as per configured capacity of the slot.

ON

ON

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. Card-bit and I/O error LED will be reset and module will be serviced as per configured capacity of the slot. If the module boots up later than waiting period, it will be serviced as per configured capacity of the slot. Till then it will be treated like empty slot. CPU will report slot error, set Card-bit and I/O error LED. The access, presence monitoring shall not be activated for the module. 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. If during run time, a module in un-configured rack/slot reports its presence.

OFF

OFF

OFF

OFF

ON

ON

Case B: I/O point configuration with specific Module ID

Sr. No.
1

Case
Slot is configured as 8, 16, 24 or 32-point slot with Module_Name. Module present in the slot has matching Module_Name. Slot is configured as 8, 16, 24 or 32-point slot with Module_Name. 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.

CardBit
OFF

I/O Err
OFF

Action Taken by CPU


Module will be serviced as per configured capacity of the slot.

ON

ON

Module will not be serviced.

On till Bootup, then OFF

On till Bootup, then OFF

Before Module boots up, Card-bit and I/O Error LED will be set. If the module boots up later than waiting period, it will be serviced as per configured capacity of the slot and Card-bit & I/O Error LED will be reset.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 47 of 82

Messung Systems

NEXGEN - 2000

Slot is configured as 8, 16, 24 or 32-point slot. At power on condition, there was no module in the slot. Later on a module was inserted with matching Module_Name. Then it was removed. Slot is configured as 8, 16, 24 or 32-point slot. At power on condition, there is a module in the slot with matching Module_Name. Later on it is removed. Then same module is reinserted

ON

ON

CPU will report slot error.

OFF

OFF

Module will be serviced as per configured capacity of the slot. If the module is found to be absent, then the Card-bit and I/O error LED will be set. Module will be serviced as per configured capacity of the slot.

ON OFF

ON OFF

ON OFF

ON OFF

If the module is found to be absent, then the Card-bit and I/O error LED should be set. Module will be serviced as per configured capacity of the slot.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 48 of 82

Messung Systems

NEXGEN - 2000

4.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. This display indicates CPU diagnostics status and also it facilitates I/O status monitoring. There are two keys provided on CPU module to navigate through I/O image available on CPU. 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.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.1

Lo Bat

Ixx.2

Ixx.3

Byte Selection

A5
1x

B5 Ixx.4 B6
Qxx.0

C5 Ixx.5 C6
Qxx.1

D5 Ixx.6 D6
Qxx.2

E5 Ixx.7 E6
Qxx.3

2x

A7
3x

B7
Qxx.4

C7
Qxx.5

D7
Qxx.6

E7
Qxx.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. If I/O Error, else OFF. Memory Error SCAN Error If Low Battery error, else OFF. CPU Status indications.

Processor CP 221x User Manual Document No.: 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

Messung Systems

NEXGEN - 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- 0 is selected Slot- 1 is selected Slot- 2 is selected Slot- 3 is selected Slot- 4 is selected Slot- 5 is selected Slot- 6 is selected Slot- 7 is selected Slot- 8 is selected Slot- 9 is selected Slot- 10 is selected Slot- 11 is selected Ixx.0 is ON, else OFF Ixx.1 is ON, else OFF Ixx.2 is ON, else OFF Ixx.3 is ON, else OFF Ixx.4 is ON, else OFF Ixx.5 is ON, else OFF Ixx.6 is ON, else OFF Ixx.7 is ON, else OFF Qxx.0 is ON, else OFF Qxx.1 is ON, else OFF Qxx.2 is ON, else OFF Qxx.3 is ON, else OFF Qxx.4 is ON, else OFF Qxx.5 is ON, else OFF Qxx.6 is ON, else OFF Qxx.7 is ON, else OFF

If A5, A6 and A7 are OFF, then status of Byte-0 of the selected Slot is shown. Indicates Slot-Number for which I/O Bit-Status is displayed. Only one Base-Rack with Max 12 I/O Slots (0-11). GREEN LED indicates selected Slot, if the Slot is healthy; otherwise the Slot-selection indication will be RED. Status of Input-Bits of the selected Slot and Byte is indicated.

Status of Output-Bits of the selected Slot and Byte is indicated.

I/O Status indications per slot will be shown as per PLC configuration defined in CoDeSys during project definition. If there is not valid project loaded in PLC (MEM error condition), then CPU will read configuration from all available slots at power on. Then CPU will indicate I/O status as per physical configuration read from the slots, till any project is downloaded. At a time status of only one input byte and one output byte can be monitored. This status depends on Slot-Selection and Byte-Selection. If there is 16 Pt Input module in Slot-0, then its first eight inputs (Byte-0) status will be indicated when B1 LED is ON and A5, A6 & A7 LEDs are OFF. In order to monitor next eight inputs (Byte-1), user has to press Up key once and then A5 LED will be put ON. It means the current status is of 1X byte.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 50 of 82

Messung Systems

NEXGEN - 2000

The steps given below explain the procedure to be followed for browsing through /O status monitoring. a) At power on, Slot-0 (B1) and Byte-0 (A5, A6 & A7: OFF) selection indications will be shown. 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. b) Press Up key once to select Byte-1 (A5 On) of the same slot. If the slot is configured with more than 8 points, then status of Byte-1 will be displayed, otherwise next slot will get selected. 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. 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. If the slot is configured with more than 16 points, then status of Byte-2 will be displayed, otherwise next slot will get selected. 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. 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. If the slot is configured with more than 24 points, then status of Byte-3 will be displayed, otherwise next slot will get selected. 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. A7 is ON indicating that the currently displayed status is of 3X byte e) Press Up key to select next slot. Thus Slot-1 (C1) and Byte-0 (A5, A6 & A7: OFF) selection indications will be shown. 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. f) Press Up key to select Byte-1 (A5 On), then Byte-2 (A6 On) and Byte-3 (A7 On) of the same slot. g) This sequence will be followed till Slot number exceeds 0-11 range. Then Slot-0 will again get selected. Thus Slot->Byte numbers will get selected cyclically in hierarchical order. h) Pressing Down key will track the same sequence of Slot->Byte selection in reverse order. 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. Key pressed and not released for more than 1 sec: Auto increment/decrement the Slot->Byte selection with 1-second updating rate, till key is not released. j) During RUN or STOP Mode: If Up and Down keys are pressed together, then no action will be taken. k) During power-up sequence: If Up and Down keys are pressed together, then application project should be cleared and MEM LED indication should be set. l) The Slot number indication will be GREEN if the selected Slot is healthy (i.e. corresponding Card-Bit is OFF), otherwise it will be RED. Status and error indication LEDs for CPU are mapped in above display. 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. The interpretation of the I/O LEDs will vary depending on type of the Intelligent Module.
Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 51 of 82

Messung Systems

NEXGEN - 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.

Processor CP 221x User Manual Document No.: 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

Messung Systems

NEXGEN - 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. No I/O, 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. Default state after power on is indicated. Slot-0 is selected. Status of %IB0 is indicated by B4 to E4 and B5 to E5 LEDs. Press Up key once to select next byte from same slot, i.e. %IB1. Status of %IB1 is indicated by B4 to E4 and B5 to E5 LEDs. Press Up key once to select next slot, i.e. Slot-1.

Byte-0 of Slot-0 is selected

2 CPU is in RUN mode. No I/O, 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.: ED-2002-202

Byte-1 of Slot-0 is selected

Output status is OFF

Status of %IB0

Published Apr 2005 Page 53 of 82

Messung Systems

NEXGEN - 2000

3 CPU is in RUN mode. No I/O, MEM or LO-BAT errors Slot-1 is selected & is healthy. 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. Status of Byte-0 of it is shown. I.e. Status of %QB0 is shown by B6 to E6 and B7 to E7 LEDs. Press Up key once to select next byte from same slot. i.e. %QB1

Byte-1 of Slot-0 is selected

4 CPU is in RUN mode. No I/O, MEM or LO-BAT errors Slot-1 is selected & is healthy. 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 slot. i.e. Slot-2

Byte-1 of Slot-1 is selected

5 CPU is in RUN mode. No I/O, MEM or LO-BAT errors Slot-2 is selected & is healthy. 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. Status of Byte-0 from this slot, i.e. %IB2 is indicated by B4 to E4 and B5 to E5 LEDs. Press Up key once to select next byte from same slot. i.e. %IB3

Byte-0 of Slot-2 is selected

Processor CP 221x User Manual Document No.: ED-2002-202

Output status is OFF

Status of %IB2

Published Apr 2005 Page 54 of 82

Messung Systems

NEXGEN - 2000

6 CPU is in RUN mode. No I/O, MEM or LO-BAT errors Slot-2 is selected & is healthy. 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. Status of Byte-1 from this slot, i.e. %IB3 is indicated by B4 to E4 and B5 to E5 LEDs. Press Up key once to select next slot, i.e. Slot-3

Byte-1 of Slot-2 is selected

7 CPU is in RUN mode. No I/O, MEM or LO-BAT errors Slot-3 is selected & is healthy. 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. Input Status of Byte-0 from this slot, i.e. %IB4 is indicated by B4 to E4 and B5 to E5 LEDs. Output Status of Byte-0 from this slot, i.e. %QB2 is indicated by B6 to E6 and B7 to E7 LEDs. Press Up key once to select next slot, i.e. Slot-4 Slot-4 is selected. CPU is in RUN mode. No I/O, MEM or LO-BAT errors Slot-4 is selected & is healthy. 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.e. %QB3 is indicated by B6 to E6 and B7 to E7 LEDs. Press Up key once to select next slot, i.e. Slot-5

Byte-0 of Slot-3 is selected

Byte-0 of Slot-4 is selected

Processor CP 221x User Manual Document No.: ED-2002-202

Status of %QB3

Input status is OFF

Status of %QB2

Status of %IB4

Published Apr 2005 Page 55 of 82

Messung Systems

NEXGEN - 2000

9 CPU is in RUN mode. No I/O, MEM or LO-BAT errors Slot-5 is selected & is healthy. 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. Input Status of Byte-0 from this slot, i.e. %IB5 is indicated by B4 to E4 and B5 to E5 LEDs. Press Up key once to select next byte from same slot. i.e. %IB6

Byte-0 of Slot-5 is selected

10 CPU is in RUN mode. No I/O, MEM or LO-BAT errors Slot-5 is selected & is healthy. 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. Input Status of Byte-1 from this slot, i.e. %IB6 is indicated by B4 to E4 and B5 to E5 LEDs. Press Up key once to select next slot, i.e. Slot-6.

Byte-1 of Slot-5 is selected

Output status is OFF

Status of %IB6

11 CPU is in RUN mode. No I/O, MEM or LO-BAT errors Slot-6 is selected & is healthy. 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. Input Status of Byte-0 from this slot, i.e. %IB7 is indicated by B4 to E4 and B5 to E5 LEDs. Output Status of Byte-0 from this slot, i.e. %QB4 is indicated by B6 to E6 and B7 to E7 LEDs. Press Up key once to select next slot, i.e. Slot-7

Byte-0 of Slot-6 is selected

Processor CP 221x User Manual Document No.: ED-2002-202

Status of %QB4

Status of %IB7

Published Apr 2005 Page 56 of 82

Messung Systems

NEXGEN - 2000

12 CPU is in RUN mode. No I/O, MEM or LO-BAT errors Slot-5 is selected & is healthy. 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. Output Status of Byte-0 from this slot, i.e. %QB5 is indicated by B6 to E6 and B7 to E7 LEDs. Press Up key once to select Byte-1, i.e. %QB6

Byte-0 of Slot-7 is selected

13 CPU is in RUN mode. No I/O, MEM or LO-BAT errors Slot-7 is selected & is healthy. 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. Output Status of Byte-1 from this slot, i.e. %QB6 is indicated by B6 to E6 and B7 to E7 LEDs. Press Up key and it will roll-back to Slot-0, Byte-0. Otherwise press Down key to see status of Slot-7, byte-0.

Byte-1 of Slot-7 is selected

The above steps explain browsing through I/O status monitoring in forward direction, using only UP key. If DOWN key is pressed, then same sequence will be reverse-tracked till reaching to Slot0, Byte-0 and then it will roll-back to Slot-7, Byte-1. It is possible to go in either direction at any stage by pressing UP or DOWN key. In case of faulty I/O module, the common indication I/O Error LED (A2) glows and when respective Slot gets selected, it is indicated by red LED instead of green LED.

Processor CP 221x User Manual Document No.: ED-2002-202

Status of %QB6

Input status is OFF

Published Apr 2005 Page 57 of 82

Messung Systems

NEXGEN - 2000

Operating Modes
The Processor has provided with four different operating modes. RUN STOP Single cycle Bootstrap Load

The subsequent sections explain the operating modes in details. 5.1 RUN In RUN mode, the Processor executes the application program. The execution sequence is called as a PLC scan. The figure below shows the typical PLC scan.

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. It updates this status as per the redirection and forcing. The logic scan then refers this stored status. The logic scan executes the application program line by line and the results are updated. The output status gets updated as per application program. In
Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 58 of 82

Messung Systems

NEXGEN - 2000

logic scan, the operating system of PLC calls a default POU named as PLC_PRG and it gets executed. Thus during application program development, it is necessary to define a POU named as PLC_PRG. Other program type of POUs or Function or Function Block type of POUs may be called through PLC_PRG. After logic scan, output status is updated as per redirection and forcing. The Processor then performs output scan and updates physical output status. After output scan, communication requests from programming device (CoDeSys) are handled. This completes one PLC scan. The Processor continues this operation as long as PLC is in RUN mode. Immediate Input and output status updating on I/O modules during logic scan can be executed on demand. This is possible by using functions Refresh_In and Refresh_Out respectively. System interrupt service execution (like serial communication related interrupts, internal timer interrupts, etc) takes place on the occurrence of these events at any time during total PLC scan. Configured interrupt event execution (like periodic, etc) takes place on the occurrence of the event at any time during PLC scan, except input and output scan and part of logic scan in which I/O modules are accessed using functions like IM_Read, IM_Write, Refresh_In, Refresh_Out. 5.2 STOP When PLC is in STOP mode, digital outputs are switched OFF physically. In STOP mode, the Processor stops executing the application program. However, input scan, output scan and programming serial port remains functioning. However, the output image holds its last status. For intelligent I/O modules, the STOP mode behavior is different and is discussed individually in respective user manuals. Serial ports of CPU have default configuration defined in CoDeSys. Serial ports operate with configured protocol as long as there is no execution of Openport FB in application program. The Openport FB may be called directly or implicitly through some protocol FBs like Nexgen_Slave, Modbus RTU Slave, etc. After execution of Openport FB in logic scan, the default configuration of the port is no more applicable. In STOP mode, the serial ports communicate as per default configuration, as long as there is no execution of Openport FB during logic scan. 5.3 Single Cycle In single scan mode, the Processor executes one scan cycle i.e. from the input scan to the output scan and then PLC is put in STOP mode. Bootstrap Load The Processor is put in bootstrap loading mode to download a new operating system. In this mode, the Processor remains in STOP mode and the CPU ERR LED on the module is put ON. To put the Processor in bootstrap loading mode, jumpers are provided at back side of the Processor module. To download new operating system or to update existing operating system, PC based software utility Bootstrap Loader Tool is used.
Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 59 of 82

5.4

Messung Systems

NEXGEN - 2000

Troubleshooting
The Processor module operates on 5 VDC provided by power supply module. It is fitted next to power supply module in the basic rack. It provides five LED indications, which gives status and diagnostic information of PLC system. The subsequent topics explain in detail significance of this information.

6.1

LED Indications The table below explains the significance of these LEDs.

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.e. in program execution mode. CPU is in 'STOP' mode Application program fault CPU watch dog fault Forcing / Writing any PLC variable from programming device. Redirection of any I/O point is active CPU is healthy Hardware fault of CPU module. CPU watchdog fault. 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. I/O module/s not inserted properly or faulty. Application program is healthy. Application program is invalid or absent. Scan time exceeds beyond permissible limit. Battery backup for CPU RAM is healthy. Ni-MH battery (3.6 VDC) is discharged bellow 2.5 VDC. Battery is faulty.

LOW BAT Red

During power ON, if < and > keys provided on CPU fascia are kept pressed simultaneously, then application program from flash PROM is not copied to the RAM and the Processor declares the application program in the RAM as invalid. Memory error is indicated by displaying M on LED display. PLC remains in STOP mode. In this case, PLC can be put in run mode after downloading the application program either from programming software CoDeSys or from the memory cassette. 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.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 60 of 82

Messung Systems

NEXGEN - 2000

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), which is generally used for the programming. The same serial link cable 2910 used for programming the PLC is used for this purpose. The figure below shows the jumpers on the Processor module for switching to bootstrap mode.

Figure 9: Jumpers on the Processor Module for Bootstrap Mode

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 61 of 82

Messung Systems

NEXGEN - 2000

For normal operation of the Processor module and for updating the existing operating system, the jumper positions should be as shown in following figure

To download a new operating system, the jumper positions should be as shown in following figure

A new operating system is normally downloaded in the factory. To download a new operating system, it is necessary to remove the Processor Module from the rack and change the jumper position. After downloading a new operation system, jumper position shall be changed for the normal operation.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 62 of 82

Messung Systems

NEXGEN - 2000

The subsequent section explains how to use Bootstrap Loader Tool. After executing bootstrap.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. PLC: This is a combo box and it facilitates selection of desired PLC type for which the operating system is to be updated. In case of Nexgen-2000 PLC, the selected PLC type shall be Nexgen2000. File: This is an Edit field, which indicates the selected file name for the CPU OS. The file name is indicated along with its path. Browse: Click on this button will invoke the File open dialog with default file type as .BIN. User can browse through folder list and select the required binary file for particular OS version. After selecting the file, click on Open button and the dialog will be closed. The selected file name is then displayed in File field, as mentioned above.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 63 of 82

Messung Systems

NEXGEN - 2000

Erase Selection: This section has three check boxes to select the erasing options during OS downloading. Out of these three check boxes, OS Part is permanently checked and it is not accessible to user. Thus before every OS download, the OS part will get erased. User has option to selectively erase User Ladder Code (application codes) and User Source Codes before downloading the OS. New OS: With click on this button, the sequence of operations for downloading new OS is initiated. In order to execute this action properly, the jumpers on CPU module shall be set to appropriate position and then PLC shall be switched off and on again. 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 updating existing OS is initiated. In order to update the OS, the jumper position on CPU module shall not be changed. Jumpers will be in same position as that of normal operation of the PLC. Erase: With click on this button, the erasing action is initiated. The erasing is done as per selection defined in Erase section. Exit: Click on this button will terminate the bootstrap utility. File Under File menu, commands Open and Exit are provided

With click on Open, a dialog for opening a file with .bin extension gets invoked. Once the required binary file for specific version of OS is browsed and selected, 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. Same action is taken with click on Browse button of main dialog. Command Exit terminates the bootstrap utility.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 64 of 82

Messung Systems

NEXGEN - 2000

Online Under File menu, commands New OS, Update OS and Erase are provided

These three commands initiate the same actions as that of buttons provided on main dialog for New OS, Update OS and Erase.

After downloading the OS in Update OS mode, the system gets reset and if the application program codes are erased (User Ladder Code check box is checked), then display shows M LED on. The normal operation of the Processor module can be resumed after downloading a valid application program through CoDeSys. If application codes are not erased (User Ladder Code check box is un-checked), then CPU goes in RUN mode and starts executing the existing application program. After downloading the OS in New OS mode, the system remains in bootstrap mode. The CPU Err LED indication is on. User has to remove the module from the slot and change the jumper position to resume normal operation. If the application codes are erased during OS downloading, then M LED indication will be on. After downloading a valid application program through CoDeSys, the CPU goes to run mode and resumes normal operation.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 65 of 82

Messung Systems

NEXGEN - 2000

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. Thus, remote programming and on line monitoring is possible. The modem used at PC end could be internal modem or external modem. The figures below illustrate the possible setups to establish such connection.
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.: ED-2002-202

Published Apr 2005 Page 66 of 82

Messung Systems

NEXGEN - 2000

In normal communication using direct programming cable 9910, 3S RS232 driver is selected in Communication parameters. To establish communication through the modem, it is necessary to select 3S modem driver in the CoDeSys using command Online Communication parameters. The command Online shown below. Communication parameters pops up a dialog box

Click on 'New...' button so that dialog box will pop up. Select device name as Serial (Modem) by using down key or clicking on the name. The selected name is highlighted. After selection, click on OK button.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 67 of 82

Messung Systems

NEXGEN - 2000

A new channel is added with default parameter settings as shown below.

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. Terminate Communication. Seconds COM Port Remark -Where xxxxx is the number to be dialed. -This is time required for Modem to establish communication. Select the port to which external modem is connected. For internal modem, choose the com port assigned to the modem during installation. Baud rate can be selected to suit the link conditions. ----

Baudrate Parity Stop bits Motorola byteorder

38400 No 1 No

38400 No 1 No

-----

Once this driver is configured, communication via modem is possible. Click command Online Login from CoDeSys. CoDeSys gateway driver initializes the modem connected at PC end with the set baud rate and other communication parameters. Then dial string is sent to the modem, which in turn establishes a link with remote modem connected to the PLC. Once the link is established, CoDeSys starts serial communication for programming and on line monitoring. When Online Logout command is issued, the CoDeSys disconnects the link by sending hang up command.
Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 68 of 82

Messung Systems

NEXGEN - 2000

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. The following figure illustrates the required setup to establish such connection.
PC 1 with CoDeSys IP Address 192.168.0.95 PC 2 IP Address 192.168.0.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, the programming software CoDeSys is running on PC1 and the gateway server is running on PC 2. The PLC is connected to COM port of PC 2. The subsequent sections explain the settings required on PC 1 and PC 2 to establish communication. 9.1 Settings on PC 2 In order to execute the gateway server, double click on Start Programs CoDeSys V2.3 Communication Gateway. Then instance of the gateway server run on PC 2 and its icon appears in the task bar as shown below.
Gateway Icon

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 69 of 82

Messung Systems

NEXGEN - 2000

9.2

Settings on PC 1 To establish the connection between CoDeSys running on PC 1 and PLC connected to PC 2, the following settings are required at PC1. In CoDeSys click on the command 'Online Communication Parameters' so that the dialog box is popped up.

Click on 'New...' button so that dialog box will pop up. Select device name as Serial (Modem) by using down key or clicking on the name. The selected name is highlighted. After selection, click on OK button.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 70 of 82

Messung Systems

NEXGEN - 2000

Select Serial (RS232)' driver and click on 'OK'. Then click on button 'Gateway...' in dialog box 'Communication Parameters' to set the communication parameters of the gateway.

Select the Connection as TCP/IP from drop down list. Enter the IP Address of the PC on which the gateway server is running. (PC 2 is having IP Address as 192.168.0.97). Then click on OK. 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. The link between CoDeSys and gateway server is established via TCP/IP bus, whereas the link between gateway server and PLC is established via RS232C serial interface. The data request commands from CoDeSys to the PLC are always routed through the gateway server.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 71 of 82

Messung Systems

NEXGEN - 2000

10 Appendix 4 Memory Cassette


The memory cassette is used to store the application program code and the source code. Thus, the application program can be transported easily. This is a flash PROM type of intelligent memory cassette. PC based programming software CoDeSys can download the application program code and or source code to the cassette. This application program code and source code can be downloaded to the Processor module from the cassette. CoDeSys can upload the source code from the cassette when ever required. 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 backside provides 9-pin D female connector for the interface with the PC or the Processor module. Variety of options depending upon the size of application program code memory is available. The table below illustrates the different cassettes and related accessories.
Item Memory cassette, 32 Kb Memory cassette, 64 Kb Memory cassette, 128 Kb Memory cassette, 256 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 cassette need to be set using the PC based software Bootstrap Loader Tool. 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.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 72 of 82

Messung Systems

NEXGEN - 2000

10.1 Configuration of Memory Cassette A new application program code and or source code can be downloaded to the blank cassette. For the same, it is necessary to set the cassette using PC based software tool Bootstrap Loader Tool. This tool is used: o o o To erase the cassette. To set the cassette for a particular PLC type. To read the configuration of the cassette.

To set the memory cassette, cassette adapter kit is required. It consists of two items. 1. Cassette adapter It has two 9-pin D male connectors at the both ends. One end is connected to PC using programming cable 9910 and the memory cassette is connected to the other end. It has socket to connect 5 VDC externally, which is ultimately supplied to the cassette. 2. 5 VDC power supply unit It is 230 VAC to 5 VDC converter, which can be directly mounted on 3-pin 230 VAC socket and provides 5 VDC through 2-pin jack pin. The figure below shows the entire set up.
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. The 9-pin D connector on the other end of adapter is connected to the programming cable. The programming cable is connected to the COM port of the PC. 5 VDC supply is connected to the adapter through jack pin of the 230 VAC to 5 VDC power supply. The memory cassette gets 5 VDC through the adapter.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 73 of 82

Messung Systems

NEXGEN - 2000

After executing Bootstrap.exe file, screen shows Menu bar as shown in the screen. The Menus Settings and Cassette are related to the memory cassette.

Settings In Settings menu, serial port, PLC type can be selected. Command Comm Port provides options as Comm 1 to Comm 6. Selected communication port displays check symbol. Default communication parameter settings are 38.4 K baud, none, 8, 1. The serial link cable from PC to the cassette adapter is connected to the COM port selected.

This software is used for variety of the Processor modules for the different PLC series. Hence, it is necessary to ensure proper PLC type before setting a cassette.

Command Select PLC pops up dialog box, which provides drop down options as Nexgen 2000, Nexgen 5000, Smartgen-20, Nexgen522x, Nexgen523x, etc. Selected PLC type is displayed in the text box.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 74 of 82

Messung Systems

NEXGEN - 2000

Cassette In the menu Cassette, the cassette can be set and the configuration of the cassette can be read. This menu provides various options as shown in the screen.

Set PLC With the command Set PLC, the memory cassette is set for the PLC type already selected. With the commands, 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, the message PLC is set is displayed. Then the Flash PROM is erased displaying message Erasing Flash PROM. It takes few seconds to erase the entire flash PROM and after erasing, the message Cassette is erased is displayed.

Erase Code Area With the command Erase Code area, the application program code and source code is erased in flash PROM. During this period, the message Erasing Flash PROM is displayed. After erasing, the message Cassette is erased is displayed.

Read PLC Name With the command Read PLC Name, PLC type already set for the cassette is displayed. The message PLC is <PLC type> is displayed.

Read Configuration With the command Read Configuration, the cassette information is displayed as: Cassette size Cassette size as per ordering code is displayed. For the cassette 9904, the message Cassette size is 256K Bytes is displayed. PLC type - PLC type already set for the cassette is displayed. The message PLC is <PLC type> is displayed. Cassette OS version The memory cassette is an intelligent cassette. It displays operation system version available as OS Version 1.0.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 75 of 82

Messung Systems

NEXGEN - 2000

Ladder code status It displays the status of application program code as blank or Invalid or valid. If code is valid, it displays the size of the code. If it is blank, a new application program code can be downloaded. Source code status It displays the status of application program source code as blank or Invalid or valid. If code is valid, it displays the size of the code. If it is blank, a new source code can be downloaded.

The relevant error messages are displayed if the cassette physical connection or serial communication with the PC is not proper. The status of the application program code is indicated by two LEDs provided on the front side of the cassette.
LED Green Red Blinking OFF (with 1Hz frequency) ON OFF OFF ON Status Application program code is blank.

Application program code is valid. Application program code is invalid

Once the cassette is set, the programming software CoDeSys can download the application program codes and source codes.

10.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. If the code area is blank, Green LED on the cassette blinks with 1 Hz frequency and Red LED is put OFF. First, set the communication parameters for CoDeSys using menu Online Communication Parameters. Here, select serial (RS232) communication port as COM1 onwards. Other communication parameter settings are 38.4 K baud, none parity, 8 data bits and 1 stop bit. Once communication parameters are selected, to download the application program code, use commands Online Login. If the PLC type of the cassette and target setting of the application program is not matching. The error message is displayed as shown below. In this case, downloading is not possible and the cassette should be set for the PLC type selected in target setting of the application program.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 76 of 82

Messung Systems

NEXGEN - 2000

If the cassette is set properly and the connection is established, the following dialog box will pop up.

Press button Yes to download the application program code. While downloading the code to the cassette, the message box displays the total size of the code as shown below. While downloading the code, green LED on the cassette flickers with high frequency.

If button No is pressed, the code is not downloaded to the cassette and logging in is completed. If a valid or invalid code is already present in the cassette, when download is initiated, Red LED on the cassette flickers for 3-4 seconds and CoDeSys logs out displaying the error message box as shown below.

When entire code is downloaded, the dialog box pops up as shown below.

Here, press any button to complete the downloading process and hence logging in process. After successful download, green LED on the cassette stops flickering and starts blinking with 1 Hz frequency indicating valid application program code in the cassette.
Processor CP 221x User Manual Document No.: ED-2002-202 Published Apr 2005 Page 77 of 82

Messung Systems

NEXGEN - 2000

The application program source code can be downloaded to the cassette using command Online Source code download in logging in process is complete. This command starts downloading the source code and the status is displayed as shown below until it completes the downloading process. While downloading the source code, green LED on the cassette flickers with low frequency.

After successful download, green LED stops flickering with low frequency. If communication is not established between the cassette and CoDeSys the error message is displayed as shown below.

The cause can be problem in physical connection or the application program code is not erased completely. If user tries to download the source code without erasing source code area, the error message box is displayed as shown below. In this case, red LED on the cassette flickers with high frequency for 3-4 seconds.

All other commands like Run, Stop, Create boot project, etc are not relevant with the memory cassette.

The valid application program source code can be uploaded from the memory cassette using CoDeSys. The command File Open PLC uploads the entire source code from the cassette.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 78 of 82

Messung Systems

NEXGEN - 2000

10.3 Sending Application Program from Cassette to Processor Module The application program code and source code can be transferred to the Processor module. For transfer, the memory cassette is fixed on the serial port 1 with 9-pin D connector plugged in. The 5 VDC supply for working of the memory cassette is provided by the module. The code and or source code if valid is transferred to the Processor module. The status of the application program code is indicated by two LEDs provided on the front side of the cassette.
LED Green Blinking (1Hz frequency) ON OFF Red OFF OFF ON Status Application program code is blank. Application program code is valid. Application program code is invalid

Press push button provided on the front side of the cassette twice to initiate transfer. There are three different conditions as below: Valid application program code only In this case, the Processor is put in STOP mode first and the code is downloaded to the module. While downloading, green LED on the cassette starts flickering with high frequency. 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. The 4-character display on the Processor module shows the operating system version like R200 or any relevant message. The green LED on the cassette glows permanently after successful transfer. If code transfer is initiated, red LED flickers with high frequency for 3-4 seconds, in following cases o Invalid application program code. o PLC type of the cassette and the Processor module mismatch. o The application program code in the cassette consists of any POU from external library not supported by Processor operating system. These are error conditions and the transfer is aborted. The earlier code is preserved. Valid application program source code only - In this case, the source code is downloaded to the Processor module without putting Processor in STOP mode. During transfer, green LED starts flickering with low frequency. Valid application program code and source code - In this case, the Processor is put is STOP mode first and the code is downloaded to the module. Once the code transfer is completed, source code is transferred and the Processor is put in Run mode after completing the transfer.

The application code or source code is transferred from the cassette to the Processor module only if it is valid.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 79 of 82

Messung Systems

NEXGEN - 2000

11 Appendix 5 File Marker Memory


The file marker variables are stored in battery backed up RAM. The file marker memory is used to store process settings, recipe data, history and data logging information, etc by the application program. This is permanently retained memory and is not cleared by the system on warm or cold start initialization. The user can access (read / write) this memory area by reference in the application program. The file marker memory is used mainly where data blocks are processed. The necessary functions and function blocks for accessing file marker memory as different data types are provided in Utilities library and Nexgen2210 library. Few functions are listed below. DBFIL, DBRD, DBSRCH, DBWR, B_MOVE, etc Few function blocks are listed below. TBL_RDWR, FIFO_STK, LIFO_STK, etc The file marker memory or part of file marker memory can be cleared through the in application program and through PLC browser commands. In the application program, function related to DB fill can be used for the purpose. In PLC Browser the command ClearFM <Starting Address> <Length> is supported. The provision to access file marker memory by external devices like HMI and SCADA is provided. The file marker memory is mapped as page memory so that the PLC variables can be accessed by Nexgen protocol. Alternately, it is also mapped as registers with Modbus protocol. The file marker memory is mapped in page 20 from PB0 to PB49151. Also, it is mapped in registers from 430001 to 464576. For the same, function blocks Nexgen_Slave, Nexgen_Master, RTU_Slave and RTU_Master are provided. The table below shows the dual mapping of file marker memory.
File Marker Memory Area BYTE 0 BYTE 1 BYTE 2 BYTE 3 Mapping in Page (P) Variables for Nexgen Protocol P20.PB0 P20.PB1 P20.PB2 P20.PB3 Mapping in Register (4xxxxxx) Variables for Modbus Protocol 430001 430002

BYTE 49150 BYTE 49151

P20.PB49150 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.

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 80 of 82

Messung Systems

NEXGEN - 2000

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 81 of 82

Messung Systems

NEXGEN - 2000

MESSUNG SYSTEMS
EL 2, J - Block, MIDC, Bhosari, PUNE 411 026. INDIA Tel. (+91) 020 27102000 Fax. (+91) 020 27102100

NEXGEN - 2000 PLC

Processor CP 221x User Manual


Document No. ED-2002-202

Processor CP 221x User Manual Document No.: ED-2002-202

Published Apr 2005 Page 82 of 82

Das könnte Ihnen auch gefallen