ed 2002 202processor221xusermanual

82
Messung Systems NEXGEN - 2000 Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 1 of 82 Processor CP 221x User Manual Document No.: ED-2002-202 Version: 1. 0 MESSUNG SYSTEMS EL-2, J- Block MIDC Bhosari, Pune – 411026. (INDIA) Tel: (+91)-020-27102000 Fax: (+91)-020-27102100 Email: [email protected] WEB: http://www.messungautomation.com/

Upload: brahmanymail

Post on 29-Nov-2014

522 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 1 of 82

Processor CP 221x User Manual

Document No.: ED-2002-202

Version: 1. 0

MESSUNG SYSTEMS EL-2, J- Block MIDC Bhosari,

Pune – 411026. (INDIA)

Tel: (+91)-020-27102000 Fax: (+91)-020-27102100

Email: [email protected] WEB: http://www.messungautomation.com/

Page 2: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 2 of 82

Revision: Version Date Description 1.00 April 2005 Processor CP 221x User Manual

Page 3: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 3 of 82

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 Name ..................................................................................................................... 22 2.2 Type....................................................................................................................... 22

2.2.1 Standard Data Types ........................................................................................ 22 2.2.2 Defined Data Types........................................................................................... 23

2.3 Initial Value ............................................................................................................ 24 2.4 Addressing............................................................................................................. 24

2.4.1 Memory Mapping............................................................................................... 25 2.5 Class...................................................................................................................... 26

2.5.1 Local Variables.................................................................................................. 26 2.5.2 Global Variables ................................................................................................ 27

2.6 Constant ................................................................................................................ 27 2.7 Retain..................................................................................................................... 28 2.8 Addressing Range ................................................................................................. 29

3 System Variables ........................................................................................................... 30 4 PLC Configuration and I/O Addressing....................................................................... 35

4.1.1 I/O Slot Numbering............................................................................................ 35 4.1.2 PLC Configuration Procedure ........................................................................... 36 4.1.3 PLC Configuration Example .............................................................................. 45

4.2 I/O Module Error detection – ................................................................................. 46 4.3 I/O Status Monitoring –.......................................................................................... 49

5 Operating Modes............................................................................................................ 58 5.1 RUN ....................................................................................................................... 58 5.2 STOP ..................................................................................................................... 59 5.3 Single Cycle........................................................................................................... 59

Page 4: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 4 of 82

5.4 Bootstrap Load ...................................................................................................... 59 6 Troubleshooting............................................................................................................. 60

6.1 LED Indications...................................................................................................... 60 7 Appendix 1 – Downloading Operating System........................................................... 61 8 Appendix 2 – Remote Programming and On Line Monitoring via Modem .............. 66 9 Appendix 3 – Remote Programming and On Line Monitoring via LAN.................... 69

9.1 Settings on PC 2.................................................................................................... 69 9.2 Settings on PC 1.................................................................................................... 70

10 Appendix 4 – Memory Cassette ................................................................................ 72 10.1 Configuration of Memory Cassette ........................................................................ 73 10.2 Sending Application Program from CoDeSys to Cassette .................................... 76 10.3 Sending Application Program from Cassette to Processor Module ...................... 79

11 Appendix 5 – File Marker Memory............................................................................ 80

Page 5: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 5 of 82

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

Page 6: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 6 of 82

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:

a) 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.

b) 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.

c) 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 it’s associated note must be read and understood. Each of the symbols used is listed below with a brief description of its meaning. 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.

Page 7: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 7 of 82

1 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 CP 2210 CP 2211

Serial Port-1 (PG-Port) Yes Yes

Serial Port-2 No Yes

The table given on next page contains the technical specifications for CPU module –

Page 8: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 8 of 82

The technical specifications of the Processor module are as follows –

Processor 16 bit micro controller BOOL 0.4 to 0.6 µsec BOOL/ BYTE /WORD /DWORD/ REAL MOVE 0.8 / 0.8 / 0.8 / 1.5 / 1.5 µsec

BYTE/WORD/DWORD/REAL ADD & SUB 1.4 / 1.4 / 2.7 / 11.8 µsec

BYTE/WORD/DWORD/REAL MULtiplication 1.9 / 1.7 / 4.2 / 17.6 µsec

BYTE/WORD/DWORD/REAL DIVision 2.6 / 2.4 / 9.3 / 21.3

BYTE/WORD/DWORD Logical Operators (AND, OR, XOR)

1.4 / 1.4 / 2.7 µsec

Execution time

BYTE/WORD/DWORD/REAL Compare 1.4 / 1.4 / 2.7 / 11.8 µsec

Maximum program scan time limit

250 ms default setting. Maximum scan time limit can be modified up to 1 Sec by modifying system variable _WLIMITMAXSCAN

Number of I/O points 128 Input points and 128 Output points

Basic 1 Racks Supported Expansion No Marker Memory 7680 bytes RAM Data Memory 32 Kbytes RAM File Memory 48 Kbytes RAM

Number of Timers (TON, TOF, TP, RTC)

Unlimited number of instances can be called. Supported by user definable retentive feature.

Timer resolution 1 ms for all the timers. Timer Range 24.85 days maximum

Number of Counters (CTD, CTU, CTUD)

Unlimited number of instances can be called. Supported by user definable retentive feature.

Real Time Clock Supported. System Information Available as system variables.

Application program memory type for execution

256 Kbytes RAM (Application program code is transferred from flash to RAM at every power ON.)

Application program code (Boot project) memory for permanent storage

128 Kb onboard flash PROM

Application program source code memory for permanent storage 512 Kb onboard flash PROM

External back up for the application program code and the source code

Provided with the memory cassette. Refer Appendix 5

Page 9: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 9 of 82

The technical specifications of the Processor module are continued –

Data Retentivity

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.

Type 3.6 VDC, Ni–MH, 80 mAH Rechargeable Onboard battery

back up Backup time 6 months between recharge

Downloadable operating system Yes (Downloadable from PC by PC base software Bootstrap Loader Tool through serial port1)

Online application program change Supported

Forcing, Writing, Watch and Receipt for PLC Variables, Redirection of I/O points

Supported

Application Program Security

Password protection supported for • Project file/ POU read or

write. • Source codes upload.

Tasks supported Cyclic

Operating Modes RUN, STOP, Single cycle, Bootstrap load

Diagnostic LED indications (Provided within 5x7 LED matrix mounted on CPU fascia)

• RUN • CPU • I/O • MEM • LOW BAT

Page 10: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 10 of 82

The technical specifications of the Processor module are continued –

Port 1

RS232C, used as programming port with programming cable (Ordering Code 2910) connected.

Communication ports (All ports are open ports) Port 2 RS232C / 422 / 485

(Applicable for CP 2211)

Communication Baud rate Selectable up to 38.4 Kb for all ports

Communication Buffer Memory Ring buffers for reception and transmission, 256 bytes for each port.

Standard IEC 61131-3

Software Microsoft Windows based ‘CoDeSys’ version 2.3 onwards.Programming

Languages IL, LD, FBD, SFC, LD Remote programming and online monitoring via Modem and or LAN

Supported. Refer Appendix 2, Appendix 3

CPU back plane current 5V, 500 mA AS per IEC 1000 – 4 – 4 2 KV conductive noise for power supply Noise immunity 1 KV capacitive coupled noise for serial ports

The Processor module series CP 221x onwards should be programmed using the programming software ‘CoDeSys’ version 2.3 onwards.

Page 11: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 11 of 82

1.2 Components The figure below shows the front view of the Processor module CP 2211 along with nomenclature.

Figure 1: Front View of the Processor Module

9-pin D male connector for Port 2

9-pin Mini DIN Female connector for Port 1

Two keys for browsing through display

Display for CPU diagnostics indications and I/O Status Monitoring

Module Ordering Code

Page 12: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 12 of 82

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 Color Status Indication

OFF CPU is healthy Hardware fault of the Processor module. CPU watchdog fault.

CPU ERR Red ON

CPU put in bootstrap load mode ON CPU is in ‘RUN’ mode i.e. in program execution mode.

CPU is in ‘STOP’ mode Application program fault OFF CPU watch dog fault Forcing / Writing any PLC variable from programming device.

R ( RUN ) Green

Flashing (5 Hz) Redirection of any I/O point

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

IO ( I/O Error )

Red ON

I/O module/s not inserted properly or faulty. OFF Application program is healthy. ON Application program is invalid or absent. M

( MEM Error )

Red Flashing (5 Hz)

Scan time exceeds beyond permissible limit.

OFF Battery backup for CPU RAM is healthy. Ni-MH battery (3.6 VDC) is discharged bellow 2.5 VDC.

B ( LOW BAT Error )

Red ON Battery is faulty.

Page 13: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 13 of 82

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 Addressing in Application Program Size Input process image Addressable as %I 16 Bytes Output process image Addressable as %Q 16 Bytes Marker Addressable as %M 7680 Bytes Data Addressable by names 32 Kbytes File marker Addressable indirectly 48 Kbytes System variables Addressable by implicit names System memory Application program memory Not addressable 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.

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

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

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

Page 14: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 14 of 82

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.

Page 15: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 15 of 82

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 198 Kb Application program code 128 Kb Application program source code 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.

Page 16: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 16 of 82

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.

Page 17: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 17 of 82

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.

Page 18: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 18 of 82

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.

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

RS232C Hardware

Acts as programming port when programming cable (Ordering Code 2910) is connected and communicates with the programming software ‘CoDeSys’

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.

Memory cassette can download 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

Page 19: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 19 of 82

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

1 Carrier Detect (Used for Modem)

2 RxD

3 TxD

4 +5V

5 GND

6 Reserved (Not to be used)

7 Reserved (Not to be used)

8 Reserved (Not to be used)

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

Page 20: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 20 of 82

Communication Port 2

Port 2 have 9-pin D male connectors and the figure below shows connections.

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.

9: Rx+ (RS422) 8: Rx- (RS422) 7: Tx- (RS422) 6: Reserved (not to be used)

GND: 5Tx+ (RS422): 4

TxD (RS232C): 3RxD (RS232C): 2

Carrier Detect (RS2232C): 11

5

6

9

Page 21: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 21 of 82

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.

Page 22: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 22 of 82

2 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 Range Memory space consumed

BOOL TRUE or FALSE 8 Bit BYTE 0 to 255 8 Bit WORD 0 to 65535 16 Bit DWORD 0 to 4294967295 32 Bit SINT -128 to 127 8 Bit USINT 0 to 255 8 Bit INT -32768 to 32767 16 Bit UINT 0 to 65535 16 Bit DINT -2147483648 to 2147483647 32 Bit UDINT 0 to 4294967295 32 Bit

REAL

-3.4 E+38 to -1.176 E-38

± 0 +1.176 E-38 to +3.4 E+38

32 bit (IEEE-754 format for single precision floating point numbers)

Page 23: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 23 of 82

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 de-referenced 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.

Page 24: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 24 of 82

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.

Input %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.

Output %Q

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.

Marker %M This memory area is used to store intermediate results in the application program. It is accessed and updated during logic scan.

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

%M X mmmm. n

Figure 6: Addressing method for PLC variables

The section Memory Mapping explains the PLC variables along with addressing.

Denotes fixed address

Variable Type Input I Output Q Marker M

Bit Size BOOL X

(Optional) BYTE B WORD W DWORD D

Delimiter. This is a decimal point applicable while accessing bit from BYTE, WORD or DWORD

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

Byte Address This byte address and range depends upon variable type

Page 25: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 25 of 82

2.4.1 Memory Mapping Basically, memory mapping is byte wise. The figure below shows memory mapping for markers.

Bits 7 6 5 4 3 2 1 0 %MD0 %MW0 %MB0 Byte 0000

%MB1 Byte 0001 %MD2 %MW2 %MB2 Byte 0002 %MB3 %MX3.0 Byte 0003 %MD4 %MW4 %MB4 Byte 0004 %MB5 %MX5.7 %MB7675 Byte 7675 %MD7676 %MW7676 %MB7676 Byte 7676

%MB7677 Byte 7677 %MW7678 %MB7678 Byte 7678 %MB7679 Byte 7679

Figure 7: Memory Map of the Markers

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 Data Type Memory Location %MX3.0 BOOL 0th bit of fourth marker byte %MX5.7 BOOL 7th bit of sixth marker byte %MX7679.5 BOOL 5th bit of marker byte 7679

Marker memory can be accessed as WORD type variable. Marker WORD is accessed with prefix W.

Address Data Type Lower Byte Higher Byte %MW0 WORD %MB0 %MB1 %MW2 WORD %MB2 %MB3 %MW7676 WORD %MB7676 %MB7677 %MW7678 WORD %MB7678 %MB7679

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

%MX7679.5

Page 26: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 26 of 82

Marker memory can be accessed as DWORD type variable. Marker DWORD is accessed with prefix D.

Address Data Type Lower Byte Higher Byte %MD0 DWORD %MW0 %MW2 %MD2 DWORD %MW2 %MW4 %MD7676 DWORD %MW7676 %MW7678

2.5 Class Class defines the scope of the variable. The variable scope can be local or global.

2.5.1 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

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)

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

Page 27: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 27 of 82

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.

Notation Example Significance

No prefix 14, 11000 Decimal value 16# 16#AAC0, 16#1359 Hexadecimal value 8# 8#7, 8#14 Octal value 2# 2#11000000, 2#10101 Binary value TRUE or FALSE TRUE or FALSE Boolean value T# T#10m30s500ms, T#10s,

T#500ms TIME value

DATE# or D# D#2002-01-01 , d#2000-03-04 Date value TIME_OF_DAY# or TOD#

TOD#15:36:30.123, TOD#00:00:00

TIME_OF_DAY value

DATE_AND_TIME or DT#

DT#2002-01-01-15:36:30 DATE_AND_TIME value

No notation but number with Decimal point or e

7.4 , 1.64e+009 REAL Values

String of characters preceded and followed by single quote.

’Name of Operator’ , ’SS-1987’ STRING values

Page 28: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 28 of 82

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.

Page 29: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 29 of 82

2.8 Addressing Range The following table shows the PLC variables and addressing range with respect to data type.

Variable Type Data Type Range

Input BOOL I X

( X is optional )

%IX0.0 to %IX0.7 %IX1.0 to %IX1.7 %IX127.0 to %IX127.7

Input BYTE I B %IB0, %IB1, %IB2 to %IB127

Input WORD* I W %IW0, %IW2, %IW4 to %IW126

Input DWORD* I D %ID0, %ID4, %ID8 to %ID124

Output BOOL Q X

( X is optional )

%QX0.0 to %QX0.7 %QX1.0 to %QX1.7 %QX127.0 to %QX127.7

Output BYTE* Q B %QB0, %QB1, %QB2 to %QB127

Output WORD* I W %QW0, %QW2, %QW4 to %QW126

Output DWORD I D %QD0, %QD4, %QD8 to %QD124

Marker BOOL M X

( X is optional )

%MX0.0 to %MX0.7 %MX1.0 to %MX1.7 %MX7679.0 to %MX7679.7

Marker BYTE M B %MB0, %MB1, %MB2 to %MB7679

Marker WORD M W %MW0, %MW2, %MW4 to %MW7678

Marker DWORD M D %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).

Page 30: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 30 of 82

3 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 Address Data Type Access 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.

_BINITSTATUS 16#0EC000 BYTE Read only

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 _INITACTFORCE 16#0EC001 BYTE Read /

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

Page 31: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 31 of 82

Name of Sysvar Address Data Type Access Description _WCOLDSTARTCOUNTER

16#0EC002 WORD Read Only

Holds number of cold start initialization occurrences. This variable is persistent.

_WWARMSTARTCOUNTER

16#0EC004 WORD Read Only

Holds number of warm start initialization occurrences. This variable is persistent.

_WCURSCANTIME 16#0EC00A WORD Read Only

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.

_WMINSCANTIME 16#0EC00C WORD Read Only

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.

_WMAXSCANTIME 16#0EC00E WORD Read Only

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.

_WLIMITMAXSCAN 16#0EC012 WORD Read / Write

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.

_BREADSECS * 16#0EC014 BYTE Read only

Holds current “Seconds” value of RTC in BCD.

_BREADMINS * 16#0EC015 BYTE Read only

Holds current “Minutes” value of RTC in BCD.

_BREADHRS * 16#0EC016 BYTE Read only

Holds current “Hours” value of RTC in BCD.

_BREADDATE * 16#0EC017 BYTE Read only

Holds current “Date” value of RTC in BCD.

_BREADMONTH * 16#0EC018 BYTE Read only

Holds current “Month” value of RTC in BCD.

_BREADYEARL * 16#0EC019 BYTE Read only

Holds current “Year” value (lower byte) of RTC in BCD.

_BREADYEARH * 16#0EC01A BYTE Read only

Holds current “Year” value (higher byte) of RTC in BCD.

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

Page 32: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 32 of 82

Name of Sysvar Address Data Type Access Description _WRACK_0_IOERR **

16#0EC01C WORD Read only

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.

Page 33: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 33 of 82

Name of Sysvar Address Data Type Access 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

TRUE Redirection of any I/O point is defined. 1

FALSE No redirection of any I/O point is carried out.

TRUE Forcing of any PLC variable is active. 2

FALSE No forcing of any PLC variable is done.

TRUE I/O error 3 FALSE No I/O error

TRUE Ni-MH battery voltage is below 2.5 V or battery back up circuit fault

_BCPUSTATUS 16#0EC030 BYTE Read only

4

FALSE Battery back up is healthy Indicates the reason for CPU to go in Stop Mode. It is cleared while going to 'RUN' Mode.

Bit Significance Details

1 Memory Error Invalid Application Program

2 Scan Error Scan time exceeds the value of _WLIMITMAXSCAN

3 PFNMI Error

PFNMI generated but RESET not received after defined 'PFRST' time.

_BCPUSTOPCAUSE

16#0EC031 BYTE Read only

4 User Stop User initiated STOP Mode command

_DWREDIRECTTBLPTR

16#0EC036 DWORD Read only

Holds the starting address of redirection table. This is updated at every Power ON.

_ASEGMENTPTR 16#0EC03A ARRAY [0..5] OF DWORD

Read only

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.

Page 34: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 34 of 82

Name of Sysvar Address Data Type Access Description _ASEGMENTLEN 16#0EC052 ARRAY

[0..5] OF WORD

Read only

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.

_ADRRXPORT1 16#0EC060 DWORD Read only

This variable holds start address of receive buffer of serial port 1. Buffer size is 256 bytes.

_ADRTXPORT1 16#0EC064 DWORD Read only

This variable holds start address of transmit buffer of serial port 1. Buffer size is 256 bytes.

_ADRRXPORT2 16#0EC068 DWORD Read only

This variable holds start address of receive buffer of serial port 2. Buffer size is 256 bytes.

_ADRTXPORT2 16#0EC06C DWORD Read only

This variable holds start address of transmit buffer of serial port 2. Buffer size is 256 bytes.

_ADRREDIRECTCOUNT

16#0EC078 DWORD Read only

It is pointer to internal variable in RTS, which contains Redirection Entry Count.

_SRTSVERSION 16#0EC1C0 STRING (8)

Read only This string holds CPU RTS version.

_WRACK_0_REG_STATUS

16#0EC1D0 WORD Read only

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.

Page 35: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 35 of 82

4 PLC Configuration and I/O Addressing

The I/O modules are mounted in I/O slots of base rack. There are different types of base racks as per following table –

Ordering Code Description

2900 No I/O Slot, only PSU and CPU Slots 2912 2-I/O Base Rack along with PSU and CPU Slots 2914 4-I/O Base Rack along with PSU and CPU Slots 2916 6-I/O Base Rack along with PSU and CPU Slots 2918 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

CPU Slot

1st I/O Slot

2nd I/O Slot

3rd I/O Slot

4th I/O Slot

5th I/O Slot

6th I/O Slot

7th I/O Slot

8th I/O Slot

PSU CPU Slot 0

Slot 1

Slot 2

Slot 3

Slot 4

Slot 5

Slot 6

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.

Page 36: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 36 of 82

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 –

Page 37: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 37 of 82

Double click on “PLC Configuration” and the window for defining I/o configuration will be invoked as shown below –

Page 38: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 38 of 82

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 “Port-2”. 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 sub-modules 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.

Page 39: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 39 of 82

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.

Page 40: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 40 of 82

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 –

Page 41: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 41 of 82

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

Page 42: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 42 of 82

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.

Page 43: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 43 of 82

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.

Page 44: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 44 of 82

The following figure illustrates default configuration for Port-2 –

Page 45: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 45 of 82

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

I/O Slot-1

I/O Slot-2

I/O Slot-3

I/O Slot-4

I/O Slot-5

I/O Slot-6

I/O Slot-7

2113

: Uni

vers

al A

C P

SU

CP

-221

1

2616

: 16

Pt D

C In

put M

odul

e

2712

: 12

Pt R

elay

Out

put

Mod

ule

2616

: 16

Pt D

C In

put M

odul

e

2114

: 8 P

t DC

Inpu

t + 6

Pt

Rel

ay O

utpu

t Mod

ule

2711

: 8 P

t Rel

ay O

utpu

t M

odul

e

2616

: 16

Pt D

C In

put M

odul

e

2114

: 8 P

t DC

Inpu

t + 6

Pt

Rel

ay O

utpu

t Mod

ule

2712

: 12

Pt R

elay

Out

put

Mod

ule

Slot - Configuration to be selected in CoDeSys

- -

16 P

t Inp

ut

Mod

ule

16 P

t Out

put

Mod

ule

16 P

t Inp

ut

Mod

ule

8 P

t inp

ut +

O

utpu

t Mod

ule

8 P

t Out

put

Mod

ule

16 P

t Inp

ut

Mod

ule

8 P

t inp

ut +

O

utpu

t Mod

ule

16 P

t Out

put

Mod

ule

Input Addresses

- - %IB0%IB1

- %IB2%IB3

%IB4 - %IB5%IB6

%IB7 -

Output Addresses

- - - %QB0%QB1

- %QB2 %QB3 - %QB4 %QB5%QB6

Page 46: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 46 of 82

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. Case Card-

Bit I/O Err Action Taken by CPU 1 Slot is holding a digital I/O

module with more number of I/O points than it’s configured capacity.

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

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

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

3 Slot is configured as 8, 16, 24 or 32-point slot, but physically there is no module in the slot.

OFF OFF CPU will not report slot error. Only I/O points as per configuration will get consumed.

Slot is configured as 8, 16, 24 or 32-point slot. At power on condition, there was not any module in the slot.

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

Later on a module was inserted.

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

4

Then it was removed. 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.

Page 47: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 47 of 82

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

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

Later on it is removed. 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.

5

Then it is re-inserted (hot plug-in same or other module)

OFF OFF Card-bit and I/O error LED will be reset and module will be serviced as per configured capacity of the slot.

6 A module placed in configured slot has more boot-up time than power on waiting period defined for CPU.

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

7 If during run time, a module in un-configured rack/slot reports its presence.

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

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

Sr. No. Case Card-

Bit I/O Err Action Taken by CPU 1 Slot is configured as 8, 16,

24 or 32-point slot with “Module_Name”. Module present in the slot has matching “Module_Name”.

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

2 Slot is configured as 8, 16, 24 or 32-point slot with “Module_Name”. Module absent or different “Module_Name” observed in slot

ON ON Module will not be serviced.

3 A module placed in configured slot has more boot-up time than power on waiting period defined for CPU and “Module_Name” is matching.

On till Boot-up, then OFF

On till Boot-up, 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.

Page 48: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 48 of 82

Slot is configured as 8, 16, 24 or 32-point slot. At power on condition, there was no module in the slot.

ON ON CPU will report slot error.

Later on a module was inserted with matching “Module_Name”.

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

4

Then it was removed. ON ON If the module is found to be absent, then the Card-bit and I/O error LED will be set.

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

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

Later on it is removed. ON ON If the module is found to be absent, then the Card-bit and I/O error LED should be set.

5

Then same module is re-inserted

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

Page 49: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 49 of 82

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 –

A1 RUN

B1 Slot-0

C1 Slot-1

D1 Slot-2

E1 Slot-3

A2 I/O Err

B2 Slot-4

C2 Slot-5

D2 Slot-6

E2 Slot-7

A3 MEM

B3 Slot-8

C3 Slot-9

D3 Slot-10

E3 Slot-11

Slo

t Sel

ectio

n

CP

U S

tatu

s In

dica

tions

A4 Lo Bat

B4 Ixx.0

C4 Ixx.1

D4 Ixx.2

E4 Ixx.3

A5 1x

B5 Ixx.4

C5 Ixx.5

D5 Ixx.6

E5 Ixx.7

Inpu

t S

tatu

s

A6 2x

B6 Qxx.0

C6 Qxx.1

D6 Qxx.2

E6 Qxx.3

Byt

e S

elec

tion

A7 3x

B7 Qxx.4

C7 Qxx.5

D7 Qxx.6

E7 Qxx.7

Out

put

Sta

tus

These LEDs indications have following significance –

LED Number Red Green Significance

OFF ON PLC is in RUN mode A1 OFF FLASH Forcing or redirection is

effective. A2 ON If “I/O Error”, else OFF.

ON Memory Error A3 FLASH SCAN Error

A4 ON If “Low Battery” error, else OFF.

CPU Status indications.

Page 50: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 50 of 82

A5 ON Status of Byte-1 of the Slot A6 ON Status of Byte-2 of the Slot A7 ON Status of Byte-3 of the Slot

If A5, A6 and A7 are OFF, then status of Byte-0 of the selected Slot is shown.

B1 ON Slot- 0 is selected C1 ON Slot- 1 is selected D1 ON Slot- 2 is selected E1 ON Slot- 3 is selected B2 ON Slot- 4 is selected C2 ON Slot- 5 is selected D2 ON Slot- 6 is selected E2 ON Slot- 7 is selected B3 ON Slot- 8 is selected C3 ON Slot- 9 is selected D3 ON Slot- 10 is selected E3 ON Slot- 11 is selected

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.

B4 ON Ixx.0 is ON, else OFF C4 ON Ixx.1 is ON, else OFF D4 ON Ixx.2 is ON, else OFF E4 ON Ixx.3 is ON, else OFF B5 ON Ixx.4 is ON, else OFF C5 ON Ixx.5 is ON, else OFF D5 ON Ixx.6 is ON, else OFF E5 ON Ixx.7 is ON, else OFF

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

B6 ON Qxx.0 is ON, else OFF C6 ON Qxx.1 is ON, else OFF D6 ON Qxx.2 is ON, else OFF E6 ON Qxx.3 is ON, else OFF B7 ON Qxx.4 is ON, else OFF C7 ON Qxx.5 is ON, else OFF D7 ON Qxx.6 is ON, else OFF E7 ON Qxx.7 is ON, else OFF

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.

Page 51: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 51 of 82

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.

Page 52: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 52 of 82

Example of Status Monitoring – Let us consider the PLC configuration as explained in figure below –

PSU Slot

CPU Slot

I/O Slot-0

I/O Slot-1

I/O Slot-2

I/O Slot-3

I/O Slot-4

I/O Slot-5

I/O Slot-6

I/O Slot-7

21

13: U

nive

rsal

AC

PS

U

CP

-221

1

2616

: 16

Pt D

C In

put M

odul

e

2712

: 12

Pt R

elay

Out

put

Mod

ule

2616

: 16

Pt D

C In

put M

odul

e

2114

: 8 P

t DC

Inpu

t + 6

Pt

Rel

ay O

utpu

t Mod

ule

2711

: 8 P

t Rel

ay O

utpu

t M

odul

e

2616

: 16

Pt D

C In

put M

odul

e

2114

: 8 P

t DC

Inpu

t + 6

Pt

Rel

ay O

utpu

t Mod

ule

2712

: 12

Pt R

elay

Out

put

Mod

ule

Slot - Configuration to be selected in CoDeSys

- -

16 P

t Inp

ut

Mod

ule

16 P

t Out

put

Mod

ule

16 P

t Inp

ut

Mod

ule

8 P

t inp

ut +

O

utpu

t Mod

ule

8 P

t Out

put

Mod

ule

16 P

t Inp

ut

Mod

ule

8 P

t inp

ut +

O

utpu

t Mod

ule

16 P

t Out

put

Mod

ule

Input Addresses

- - %IB0%IB1

- %IB2%IB3

%IB4 - %IB5%IB6

%IB7 -

Output Addresses

- - - %QB0%QB1

- %QB2 %QB3 - %QB4 %QB5%QB6

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.

Page 53: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 53 of 82

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 Display Status Action to be taken

1

A1 B1 C1 D1 E1

A2 B2 C2 D2 E2

A3 B3 C3 D3 E3

Slo

t-0 is

se

lect

ed &

is

hea

lthy.

CP

U is

in R

UN

m

ode.

No

I/O,

ME

M o

r LO

-BA

T er

rors

A4 B4 C4 D4 E4

A5 B5 C5 D5 E5 Sta

tus

of

%IB

0

A6 B6 C6 D6 E6

Byt

e-0

of

Slo

t-0 is

se

lect

ed

A7 B7 C6 D7 E7 Out

put

stat

us

is O

FF

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.

2

A1 B1 C1 D1 E1

A2 B2 C2 D2 E2

A3 B3 C3 D3 E3 S

lot-0

is

sele

cted

&

is h

ealth

y.

CP

U is

in R

UN

m

ode.

No

I/O,

ME

M o

r LO

-BA

T er

rors

A4 B4 C4 D4 E4

A5 B5 C5 D5 E5 Sta

tus

of

%IB

1

A6 B6 C6 D6 E6

Byt

e-1

of

Slo

t-0 is

se

lect

ed

A7 B7 C6 D7 E7 Out

put

stat

us

is O

FF

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.

Page 54: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 54 of 82

3

A1 B1 C1 D1 E1

A2 B2 C2 D2 E2

A3 B3 C3 D3 E3

Slo

t-1 is

se

lect

ed &

is

hea

lthy.

CP

U is

in R

UN

m

ode.

No

I/O,

ME

M o

r LO

-BA

T er

rors

A4 B4 C4 D4 E4

A5 B5 C5 D5 E5 Inpu

t st

atus

is

OFF

A6 B6 C6 D6 E6

Byt

e-1

of

Slo

t-0 is

se

lect

ed

A7 B7 C6 D7 E7 Sta

tus

of

%Q

B0

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

4

A1 B1 C1 D1 E1

A2 B2 C2 D2 E2

A3 B3 C3 D3 E3

Slo

t-1 is

se

lect

ed &

is

hea

lthy.

CP

U is

in R

UN

m

ode.

No

I/O,

ME

M o

r LO

-BA

T er

rors

A4 B4 C4 D4 E4

A5 B5 C5 D5 E5 Inpu

t st

atus

is

OFF

A6 B6 C6 D6 E6

Byt

e-1

of

Slo

t-1 is

se

lect

ed

A7 B7 C6 D7 E7 Sta

tus

of

%Q

B1

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

5

A1 B1 C1 D1 E1

A2 B2 C2 D2 E2

A3 B3 C3 D3 E3

Slo

t-2 is

se

lect

ed &

is

hea

lthy.

CP

U is

in R

UN

m

ode.

No

I/O,

ME

M o

r LO

-BA

T er

rors

A4 B4 C4 D4 E4

A5 B5 C5 D5 E5 Sta

tus

of

%IB

2

A6 B6 C6 D6 E6

Byt

e-0

of

Slo

t-2 is

se

lect

ed

A7 B7 C6 D7 E7 Out

put

stat

us

is O

FF

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

Page 55: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 55 of 82

6

A1 B1 C1 D1 E1

A2 B2 C2 D2 E2

A3 B3 C3 D3 E3

Slo

t-2 is

se

lect

ed &

is

hea

lthy.

CP

U is

in R

UN

m

ode.

No

I/O,

ME

M o

r LO

-BA

T er

rors

A4 B4 C4 D4 E4

A5 B5 C5 D5 E5 Sta

tus

of

%IB

3

A6 B6 C6 D6 E6

Byt

e-1

of

Slo

t-2 is

se

lect

ed

A7 B7 C6 D7 E7 Out

put

stat

us

is O

FF

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

7

A1 B1 C1 D1 E1

A2 B2 C2 D2 E2

A3 B3 C3 D3 E3

Slo

t-3 is

se

lect

ed &

is

hea

lthy.

CP

U is

in R

UN

m

ode.

No

I/O,

ME

M o

r LO

-BA

T er

rors

A4 B4 C4 D4 E4

A5 B5 C5 D5 E5 Sta

tus

of

%IB

4 A6 B6 C6 D6 E6

Byt

e-0

of

Slo

t-3 is

se

lect

ed

A7 B7 C6 D7 E7 Sta

tus

of

%Q

B2

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

8

A1 B1 C1 D1 E1

A2 B2 C2 D2 E2

A3 B3 C3 D3 E3

Slo

t-4 is

se

lect

ed &

is

hea

lthy.

CP

U is

in R

UN

m

ode.

No

I/O,

ME

M o

r LO

-BA

T er

rors

A4 B4 C4 D4 E4

A5 B5 C5 D5 E5 Inpu

t st

atus

is

OFF

A6 B6 C6 D6 E6

Byt

e-0

of

Slo

t-4 is

se

lect

ed

A7 B7 C6 D7 E7 Sta

tus

of

%Q

B3

Slot-4 is selected. 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

Page 56: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 56 of 82

9

A1 B1 C1 D1 E1

A2 B2 C2 D2 E2

A3 B3 C3 D3 E3

Slo

t-5 is

se

lect

ed &

is

hea

lthy.

CP

U is

in R

UN

m

ode.

No

I/O,

ME

M o

r LO

-BA

T er

rors

A4 B4 C4 D4 E4

A5 B5 C5 D5 E5 Sta

tus

of

%IB

5

A6 B6 C6 D6 E6

Byt

e-0

of

Slo

t-5 is

se

lect

ed

A7 B7 C6 D7 E7 Out

put

stat

us

is O

FF

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

10

A1 B1 C1 D1 E1

A2 B2 C2 D2 E2

A3 B3 C3 D3 E3

Slo

t-5 is

se

lect

ed &

is

hea

lthy.

CP

U is

in R

UN

m

ode.

No

I/O,

ME

M o

r LO

-BA

T er

rors

A4 B4 C4 D4 E4

A5 B5 C5 D5 E5 Sta

tus

of

%IB

6 A6 B6 C6 D6 E6

Byt

e-1

of

Slo

t-5 is

se

lect

ed

A7 B7 C6 D7 E7 Out

put

stat

us

is O

FF

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.

11

A1 B1 C1 D1 E1

A2 B2 C2 D2 E2

A3 B3 C3 D3 E3

Slo

t-6 is

se

lect

ed &

is

hea

lthy.

CP

U is

in R

UN

m

ode.

No

I/O,

ME

M o

r LO

-BA

T er

rors

A4 B4 C4 D4 E4

A5 B5 C5 D5 E5 Sta

tus

of

%IB

7

A6 B6 C6 D6 E6

Byt

e-0

of

Slo

t-6 is

se

lect

ed

A7 B7 C6 D7 E7 Sta

tus

of

%Q

B4

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

Page 57: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 57 of 82

12

A1 B1 C1 D1 E1

A2 B2 C2 D2 E2

A3 B3 C3 D3 E3

Slo

t-5 is

se

lect

ed &

is

hea

lthy.

CP

U is

in R

UN

m

ode.

No

I/O,

ME

M o

r LO

-BA

T er

rors

A4 B4 C4 D4 E4

A5 B5 C5 D5 E5 Inpu

t st

atus

is

OFF

A6 B6 C6 D6 E6

Byt

e-0

of

Slo

t-7 is

se

lect

ed

A7 B7 C6 D7 E7 Sta

tus

of

%Q

B5

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

13

A1 B1 C1 D1 E1

A2 B2 C2 D2 E2

A3 B3 C3 D3 E3

Slo

t-7 is

se

lect

ed &

is

hea

lthy.

CP

U is

in R

UN

m

ode.

No

I/O,

ME

M o

r LO

-BA

T er

rors

A4 B4 C4 D4 E4

A5 B5 C5 D5 E5 Inpu

t st

atus

is

OFF

A6 B6 C6 D6 E6

Byt

e-1

of

Slo

t-7 is

se

lect

ed

A7 B7 C6 D7 E7 Sta

tus

of

%Q

B6

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.

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 Slot-0, 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.

Page 58: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 58 of 82

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

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

Input Scan

Keyboard Scan

Input Redirection

Input Forcing

Logic Scan

Output Redirection

Output Forcing

Output Scan

Programming Communication Services

Variable Forcing

Applicable only if programming cable (2910) is connected to serial port 1

Possible by programming software ‘CoDeSys’

Possible by programming software ‘CoDeSys’

Possible by programming software ‘CoDeSys’

Execution of default POU ‘PLC_PRG’

Possible by programming software ‘CoDeSys’

Possible by programming software ‘CoDeSys’

Page 59: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 59 of 82

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.

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

Page 60: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 60 of 82

6 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 Indication

ON CPU is in 'RUN' mode i.e. in program execution mode. CPU is in 'STOP' mode Application program fault OFF CPU watch dog fault Forcing / Writing any PLC variable from programming device.

RUN Green

Flashing (5 Hz) Redirection of any I/O point is active OFF CPU is healthy

Hardware fault of CPU module. CPU watchdog fault. CPU Red ON CPU put in bootstrap load mode

OFF 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 Red ON

I/O module/s not inserted properly or faulty. OFF Application program is healthy. ON Application program is invalid or absent. MEM Red Flashing (5 Hz)

Scan time exceeds beyond permissible limit.

OFF Battery backup for CPU RAM is healthy. Ni-MH battery (3.6 VDC) is discharged bellow 2.5 VDC. LOW BAT Red ON Battery is faulty.

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.

Page 61: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 61 of 82

7 Appendix 1 – Downloading Operating System

The bootstrap loader tool is used to download a new operating system or to update existing operating system. The operating system is downloaded from the PC using the serial port 1 (RS232C), 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

Page 62: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 62 of 82

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.

Page 63: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 63 of 82

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.

Page 64: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 64 of 82

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.

Page 65: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 65 of 82

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.

Page 66: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 66 of 82

8 Appendix 2 – Remote Programming and On Line Monitoring via Modem

The programming software ‘CoDeSys’ can communicate with the Processor module CP 221x onwards via modem. 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.

Figure 10: Set Up with External Modem

Figure 11: Set Up with Internal Modem

Nexgen 2000 PLC

RS232C PSTN

External Modem at PLC end

To CP 221x Port 1

RS232C

External Modemat PC end

To COM Port

PC with the Programming software ‘CoDeSys’

Nexgen 2000 PLC

RS232C

PSTN

External Modem at PLC end

To CP 221x Port 1

To Telephone socket

PC with Internal Modem

PC with the Programming software ‘CoDeSys’

Page 67: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 67 of 82

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’ ‘Communication parameters’ pops up a dialog box shown below.

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.

Page 68: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 68 of 82

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 Default Value

New Value

Comment Remark

Init AT&F0 AT Initialize modem -- Dial ATDT ATDTxxxxx Dial Number. Where xxxxx is the number to

be dialed. Hang up ATH ATH Terminate

Communication. --

Timeout 60 60 Seconds This is time required for Modem to establish communication.

Port COM1 COM2 COM Port Select the port to which external modem is connected. For internal modem, choose the com port assigned to the modem during installation.

Baudrate 38400 38400 -- Baud rate can be selected to suit the link conditions.

Parity No No -- -- Stop bits 1 1 -- -- Motorola byteorder No 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.

Page 69: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 69 of 82

9 Appendix 3 – Remote Programming and On Line Monitoring via LAN

The PLC programming software ‘CoDeSys’ can communicate with the Processor module series CP 221x via TCP/IP connection. The following figure illustrates the required setup to establish such connection.

Figure 12: Set Up with 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

Ethernet LANHub / Switch

RS232C

PC 1 with ‘CoDeSys IP Address

192.168.0.95

PC 2 IP Address

192.168.0.97

Nexgen 2000 PLC

To CP 221x Port 1

To COM Port

Gateway server

Page 70: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 70 of 82

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.

Page 71: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 71 of 82

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.

Page 72: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 72 of 82

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 Ordering Code Memory cassette, 32 Kb 9901 Memory cassette, 64 Kb 9902 Memory cassette, 128 Kb 9903 Memory cassette, 256 Kb 9904 Memory cassette, 392 Kb 9905 Cassette adapter kit 9911 Programming Cable 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.

Page 73: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 73 of 82

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 To erase the cassette. o To set the cassette for a particular PLC type. o 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.

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.

PC COM Port

Programming cable 9910 Cassette adapter

Memory Cassette

5 VDC Power supply

To 230 VAC Power supply

230 VAC to 5 VDCPower supply

Bootstrap Loader Tool /CoDeSys

Page 74: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 74 of 82

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.

Page 75: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 75 of 82

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

Page 76: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 76 of 82

• 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 Status

Blinking (with 1Hz frequency)

OFF Application program code is blank.

ON OFF Application program code is valid. OFF ON 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.

Page 77: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 77 of 82

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.

Page 78: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 78 of 82

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.

Page 79: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 79 of 82

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 Red Status

Blinking (1Hz frequency)

OFF Application program code is blank.

ON OFF Application program code is valid. OFF ON 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.

Page 80: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 80 of 82

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 Mapping in Page (P) Variables

for Nexgen Protocol Mapping in Register (4xxxxxx) Variables for Modbus Protocol

BYTE 0 P20.PB0 BYTE 1 P20.PB1

430001

BYTE 2 P20.PB2 BYTE 3 P20.PB3

430002

BYTE 49150 P20.PB49150 BYTE 49151 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.

Page 81: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 81 of 82

Page 82: ED 2002 202Processor221xUserManual

Messung Systems NEXGEN - 2000

Processor CP 221x User Manual Published Apr 2005 Document No.: ED-2002-202 Page 82 of 82

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