Вы находитесь на странице: 1из 27
Example Description, V01 PS563-WATER Library Package LogData_AC500_V23 Data Logging Library Application Examples

Example Description, V01

PS563-WATER Library Package LogData_AC500_V23 Data Logging Library Application Examples

Example Description, V01 PS563-WATER Library Package LogData_AC500_V23 Data Logging Library Application Examples

Content

1. INTRODUCTION TO DOCUMENT

2

1.1 Scope of the document

2

1.2 Overview of the Content

2

1.3 Compatibility

2

1.4 Safety Instructions

2

2. Logger Overview

3

2.1

Operating Modes of the Logger

5

2.1.1 Mode 0/1: Buffer and disposal in chronologic order

5

2.1.2 Mode 2: Buffer and disposal via FTP

6

2.1.3 Mode 3: Events Recorder

6

3. Generic Example program

8

3.1

Preparation

8

3.2

Use Mode 0/1 Buffer and disposal in chronologic order

10

3.2

Use mode 2: Buffer and disposal via FTP

15

3.3

Use mode 3: Event recorder

17

4. IEC60870 Example program

19

4.1 Preparation

19

4.2 Use Mode 0/1: Buffer and disposal in chronologic order

23

5. REVISION HISTORY

25

1.

INTRODUCTION TO DOCUMENT

1.1 Scope of the document

This document is intended for explaining the first use of the LogData AC500 library, with the provided example projects, to directly log data of remote communication connections of the AC500 or as standalone data logger.

1.2 Overview of the Content

There are two example projects provided for the two different use cases of the logger. In chapter 3 the Example for logging of generic protocols is described, while the logging for IEC 60870 protocol is described in chapter 4. The necessary preparation of the AC500 is explained at the beginning of each of these example chapters. In the ready to run application programs Ethernet communication is assumed to transfer and receive data between AC500 acting as a substation (logging data in case of interruptions in communication) and a control station (receiving then e.g. logged historical data after a communication is there again after an outage).

1.3 Compatibility

The example programs explained in this document has been used with the below engineering system versions. It should also work with other versions; nevertheless some small adaptations may be necessary, for future versions.

· AC500 Control Builder Plus CBP V2.3., as delivered with Automation Builder V 1.0 Suite of Engineering programs.

1.4 Safety Instructions

The user must follow all applicable safety instructions and the guidelines mentioned in the user documents of the ABB products used in the example program

· Read the complete safety instructions for the AC500 before installation and commissioning.

· Read all safety instructions of your control station system manuals

2. Logger Overview

The AC500 Datalogging Function Block Library contains five Function Blocks for the purpose of advanced time-stamped data logging for different use cases. In typical use cases the AC500 application program generates data which are normally transmitted to a telecontrol system for storage and further processing or displaying to the end user. Typically, these may be remote applications like water pumping stations or solar power plants where the connection between the remote station (AC500) and a central SCADA/telecontrol station is not always stable or only sporadically connected. Sporadically connected can be by intention e.g. to save communication costs or open ports/connections to be handled by a control station. Then the Datalogging Function Blocks can store data in case of a broken or intentionally interrupted connection between AC500 and the telecontrol system.

connection between AC500 and the telecontrol system. Fig. 1: Overview 1 AC500 application 2 telecontrol

Fig. 1: Overview

1 AC500 application

2 telecontrol

Alternatively

· The Datalogging Library can be used as an event recorder. In this special mode data is continuously recorded in a ring buffer which can be read out after a certain event x (e.g. outage) in order to analyze the values especially before but also after the event x.

· Data can be logged only and on command transferred to the ftp area to be analyzed offline or taken out via the SD card. The following figure 2 gives an overview of the described interaction of the Datalogging Function Blocks. There is always an input Function Block needed which transfers the input data into data sets with timestamp for use by the Datalogger. An output Function Block receives the current or retrieved data from the Datalogger in case of communication or further processing. The input Function Blocks "LOG_xxx_INPUT", the Function Block "LOG_HANDLING" and the output Function Blocks "LOG_xxx_OUTPUT" communicate via SRAM FIFOin and FIFOout areas in the memory. This SRAM FIFOs are intermediate buffers and help in decoupling time wise and speeding up the necessary write/read operations on the logging file structures significantly. These read/write operations on the files are done in blocks of datasets, enabling a comparably fast interaction with the otherwise slow file system.

Fig. 2: Overview Function Blocks Each Datalogging application requires the main Function Block LOG_HANDLING ,

Fig. 2: Overview Function Blocks

Each Datalogging application requires the main Function Block LOG_HANDLING , one of the input Function Blocks to provide data to be logged and one output Function Block to retrieve the data. As input and output Function Blocks two different types exist:

· For logging data of an interrupted IEC60870 communication, the Function Blocks LOG_IEC60870_INPUT and LOG_IEC60870_OUTPUT are provided. The IEC60870 Datalogging Function Blocks support the IEC data types and work internally with the standard AC500 IEC60870 Library. The IEC Datalogger output Function Block does not need special handling or control/inputs.

· For other types of general data LOG_GENERIC_INPUT and LOG_GENERIC_OUTPUT are provided. The generic Datalogging Function Blocks support an even larger variety of data types. The generic output Function Block needs to be hand-shaked with for each data set, in order to retrieve the data from the Datalogging files. Therefore the generic Function Blocks can also be used to integrate the data logging into any other protocol, e.g. Modbus. The Function Block LOG_HANDLING ensures that also several consecutive and fast interruptions can be handled without losing data. While the log file is replayed, arriving new data is stored in the SRAM FIFOin and added to the Datalogging files (File FIFO) if the SRAM FIFOin becomes full - during that short time the log file replay is paused. Nevertheless any data send to a control station via a communication is always with the oldest data first (FIFIO = “First In First Out”). As it takes up to 30 seconds before a communication break is detected (e.g. with TCP/IP protocols by the AC500 hardware/firmware), the data rate at which data should be logged in case of a communication break has to be calculated and limited. As an improvement a ping mechanism can be implemented in the Substation. This was done in the example program for the IEC logger. With this ping the interruption is already detected after 1-2 seconds (can be configured in the example program). As the SRAM FIFOin has to store data during this time, its size limits the data rate. The SRAM FIFO size is 160 datasets. This means the data rate should be lower than approximately max. datarate = 160 datasets/2seconds => <80 datasets/second The data rates for storing only without this detection can be much higher and depends on the CPU and memory type chosen; see “Overview of technical details” in the online help. The data is always logged in directly readable csv format, see “CSV-File Formats” in the online help. Depending on the input Function Block and data type, the log file contains only one or up to 32 data variables per time-stamped data set, see “CSV-File Formats” in the online help. The Datalogging files can be configured (up to 65k datasets per file, up to 999 consecutive log files, name format).

2.1 Operating Modes of the Logger

This chapter describes the different operating modes of the Datalogging and their behavior:

· Mode 0/1: Buffer and disposal in chronologic order

o

Mode 0: Limited storage (keeps oldest, but stops if full)

o

Mode 1: Endless (ring buffer) operation modes (deletes oldest)

· Mode 2: Buffer and disposal via FTP, Log file(s) copied to ftp server area for further use

· Mode 3: Events Recorder, logs data before and after an event.

2.1.1 Mode 0/1: Buffer and disposal in chronologic order

2.1.1 Mode 0/1: Buffer and disposal in chronologic order Fig. 3: Overview Mode 0/1 Mode 0/1

Fig. 3: Overview Mode 0/1

Mode 0/1 is for buffering the values from the AC500 application in case of a broken or intentionally interrupted connection between AC500 and telecontrol. In the normal state 1 the values are directly sent from the FIFOin (input values from application) to FIFOout (telecontrol connection). As soon as the connection is interrupted, the Datalogger changes to working state 2. The values are sent to the File FIFO instead. When the File FIFO is full, the Datalogging is stopped (Mode 0) or the oldest data will be overwritten (Mode 1 = ringbuffer). When the connection is established again and the RELEASE_HISTORY pin is triggered, the Datalogger changes to working state 3. It cares for disposal of the values in chronological order. The buffered values are written to FIFOout (working state 3a). This may take some time during which new values are coming from the application and stored into FIFOin. Before the FIFOin overflows the Datalogger switches to working state 3b and buffers the new values. After that it can continue with working state 3a. Only if the File FIFO is empty (all files deleted) the Datalogger changes back to normal state 1. The advantage of Mode 0/1 is that all values (directly and buffered) are sent to telecontrol in strictly chronological order which is expected by most control stations (SCADA systems/historians).

As it takes up to 30 seconds before a communication break is detected (e.g. with TCP/IP protocols by the AC500 hardware/firmware), the data rate at which data should be logged in case of a communication break has to be calculated and limited.

2.1.2

Mode 2: Buffer and disposal via FTP

2.1.2 Mode 2: Buffer and disposal via FTP Fig. 4: Overview Mode 2 Mode 2 is

Fig. 4: Overview Mode 2

Mode 2 is also used for buffering the values from AC500 application in case of a broken connection between AC500 and telecontrol. State 1 and state 2 are similar to Mode 0/1. The difference is the disposal. When the connection is established again the Datalogger changes directly back to state 1 and the input values in FIFOin are directly sent to FIFOout (telecontrol connection). The buffered values in File FIFO are internally moved from disk 1 to disk 2 which can then be accessed or used by FTP (client or server). This move action can also be triggered by the command MOVE_FILES, or when file 1 is full. The advantage of Mode 2 is the immediate availability of the latest and all current values after an outage.

2.1.3 Mode 3: Events Recorder

values after an outage. 2.1.3 Mode 3: Events Recorder Fig. 5: Overview Mode 3 Mode 3

Fig. 5: Overview Mode 3

Mode 3 is used to record data values around an event, before and after the event x, e.g. outage of a part of the plant. The values are continuously recorded into the File FIFO file system independent of the connection status to telecontrol. If the File FIFO is full the oldest values are overwritten (ring buffer). Thus the File FIFO always contains the values from the past period n, which is depending on the amount of values per second and on the size of the File FIFO. When a certain event x occurs, the command MOVE_FILES can be given directly or after the period m. With the command MOVE_FILES the values in File FIFO are internally moved from disk1 to disk 2 and can be read out by an FTP action (client or server) when required.

Fig. 6: The buffered values represent the time before the event (n-m) and after the

Fig. 6: The buffered values represent the time before the event (n-m) and after the event (m).

The advantage of mode 3 is that the values from the time period before the event (n-m) and after the event (m) are recorded and can help to reconstruct the cause and effect of the event.

3. Generic Example program

This chapter describes how to use the Generic Logger example program. The following components were used for the example::

· One AC500 CPU (PM573 or higher), representing the substation, which sends the Generic data and / or logs them according to the selected mode.

o

IP address, e.g. 192.168.0.22

o

SD card must be inserted. Alternative: Use a PM592 with internal flash disk

· ABB Automation Builder, Version 1.1, running on a PC which is connected to the AC500 via Ethernet

· Library: LogData_AC500_V23.lib (Library Version 1.1.0)

· Example project: “Example_Generic_LogData_V23.project”

3.1 Preparation

The following steps have to be executed

1. Copy the library (LogData_AC500_V23.lib) into the common library folder:

C:\Program Files (x86)\Common Files\CAA-Targets\ABB_AC500\AC500_V12\library\PS563- WATER\library or C:\Program Files \Common Files\CAA-Targets\ABB_AC500\AC500_V12\library\PS563-WATER\library

2. Open the example project (example_Generic_LogData_V23.project) with AB

3. The example is based on one AC500 CPU, type PM592-ETH. For use with other CPU types a target change has to be performed:

with other CPU types a target change has to be performed: LogData - Water Library Introduction

4. Configure in Automation builder

4. Configure in Automation builder a. Activate FTP server, optionally assign passwords 5. Download to AC500

a. Activate FTP server, optionally assign passwords

5. Download to AC500

a. DoubleClick example_LOG_Generic_Substation_V23_062 in order to open program in CoDeSys

b. Project – Clean All, Build

c. Online - Set communication parameter to the CPU

Build c. Online - Set communication parameter to the CPU d. Online – Login, Create boot

d. Online – Login, Create boot project, Run

3.2 Use Mode 0/1 Buffer and disposal in chronologic order

1. Configure test program for Mode 0/1

a. Open Visualization: LogData_GENERIC_total2:

for Mode 0/1 a. Open Visualization: LogData_GENERIC_total2: All yellow fields can be configured or activated b.

All yellow fields can be configured or activated

b. Control:

- Mode 0

- Max No of files. 10

- Max No of DS/File: 100

- Drive 1 = SD

c. Input values

- Activate all 7 data types

- Cyclically, 200

(Buffer and disposal in chronologic order, pure buffer)

(Maximum: 999)

(Maximum: 65535)

(if not PM592 with internal flash disk)

(These test values are created by the example program)

(BOOL, BYTE, REAL, …)

(Sending 7 datasets every second = 200 * 10 ms cycle time)

à

d.

Result:

d. Result: à Data is transferred directly to the control station (following the green arrows), no

à

Data is transferred directly to the control station (following the green arrows), no buffering. This is the normal state = State 1 in Figure 3.

2. Mode 0 with break

a. Start with normal state = State 1

b. Simulate connection break by pressing the Break button between RAM FIFOOut and Control Station

c.

Result

c. Result à Control station is disconnected (color in the arrow turns to orange). Logger switches

à

Control station is disconnected (color in the arrow turns to orange). Logger switches to State 2:

Data is written into the File FIFO instead, starting with file1.csv.

d. When a file is full, the next file is written:

file1.csv. d. When a file is full, the next file is written: LogData - Water Library

e. The files on the SD card can be verified by connecting the AC500 with an FTP client (e.g. FileZilla):

by connecting the AC500 with an FTP client (e.g. FileZilla): f. Release button “Break” g. Press

f. Release button “Break”

g. Press button “Release History” (Signal from the Control station that history data is released)

h. Result: State 3

station that history data is released) h. Result: State 3 à Data is read from file

à Data is read from file buffer (File FIFO) and sent via RAMFIFOout to the Control station (State 3a). In the meantime new data is buffered in RAM FIFOin. Before this buffer overflows the state is shortly switched to 3b in order to save the new data in the File FIFO:

i. When the File FIFO is empty the logger switches to the normal State 1:

i. When the File FIFO is empty the logger switches to the normal State 1:

FIFO is empty the logger switches to the normal State 1: The files on the SD

The files on the SD card are deleted accordingly

3. Mode 0 with buffer overflow

à

a. Reset all values by pressing button “Reset”

b. Press button “Break”

c. Wait until maximum number of files in File FIFO is reached:

à The buffering stops and the FIFOin runs full.

d.

The FIFOin gets and overflow after some time and newest data get lost:

gets and overflow after some time and newest data get lost: à In order to avoid

à In

order to avoid losing the newest data mode 1 can be used instead

4. Mode 1 without buffer overflow (similar to mode 0, but Ring buffer)

a. Enter Mode 1

b. Reset

c. Break connection

d. Wait until maximum number of files in File FIFO is reached

Wait until maximum number of files in File FIFO is reached à In comparison to Mode

à In

comparison to Mode 0 the buffering continues by overwriting the oldest files (Ring-Buffer mode)

3.2 Use mode 2: Buffer and disposal via FTP

a. Enter mode 2

b. Reset

c. Set Drive2 = SD (if not PM592 with internal flash disk)

d. Break connection

e. Result: file1 is filled

flash disk) d. Break connection e. Result: file1 is filled LogData - Water Library Introduction and

f. When file1 is full it is automatically copied to the FTP folder with a unique name consisting of the date and time. These files can be retreived for further processing using an FTP client:

can be retreived for further processing using an FTP client: g. Other triggers for copying the

g. Other triggers for copying the file can be: Button „Move files“ or release “Break” button

3.3 Use mode 3: Event recorder

a. Enter mode 3

b. Reset

c. Data is always and continously buffered, independent of the Break button. No data is transferred to the control station:

Break button. No data is transferred to the control station: d. When the maximum number of

d. When the maximum number of files is reached the first files are overwritten (ring buffer mode)

e. In case of an event (e.g. fault in the plant) the command “MOVE_FILES” should be initiated after a certain time period m. In this example it can be triggered by the button “Move files”. With this command the complete buffer is copied to the FTP folder:

command the complete buffer is copied to the FTP folder: f. These files in the FTP

f. These files in the FTP folder can be retreived for further diagnostics using the FTP client. They represent a certain time period before the event (n-m) and the period after the event (m), see also online documentation:

period after the event (m), see also online documentation: LogData - Water Library Introduction and Examples

4. IEC60870 Example program

This chapter describes how to use the IEC 60870 Logger example program. The following components were used for the example:

· Two AC500 CPUs (PM573 or higher), interconnected via Ethernet using an Ethernet switch

1. CPU1: Control station: Receiving the IEC 60870 data from the substation IP address, e.g. 192.168.0.21

2. CPU2: Substation: Sending the IEC 60870 data and logging it in case of connection interrupt, IP address, e.g. 192.168.0.22 SD card must be inserted if not PM592 with internal flash disk

· ABB Automation Builder, Version 1.1, running on a PC which is connected to the AC500 pair via the switch

· Library: LogData_AC500_V23.lib (Library Version 1.1.0)

· Example project: example_IEC60870_LogData_V23.project

4.1 Preparation

The following steps have to be executed

1. Load the library (LogData_AC500_V23.lib) into the common library folder:

C:\Program Files (x86)\Common Files\CAA-Targets\ABB_AC500\AC500_V12\PS563-WATER\library or C:\Program Files\Common Files\CAA-Targets\ABB_AC500\AC500_V12\PS563-WATER\library

2. Open the example project (example_IEC60870_LogData_V23.project) with AB

3. The example is based on two AC500 CPUs, type PM592-ETH. For use with other CPU types a target change has to be performed:

with other CPU types a target change has to be performed: LogData - Water Library Introduction

4.

Configure the control station (IP Controlstation: 192.168.0.54):

a. Activate SNTP-Client and Connection to Substation

a. Activate SNTP-Client and Connection to Substation b. Enter IP address of the Substation (e.g. 192.16.5.55)

b. Enter IP address of the Substation (e.g. 192.16.5.55)

b. Enter IP address of the Substation (e.g. 192.16.5.55) 5. Download to the control station (CPU1)

5. Download to the control station (CPU1)

a. DoubleClick on example_LOG_IEC60870_Controlstation_V23 in order to open program in CoDeSys

b. Project – Clean All, Build

c.

Online - Set communication parameter to CPU1:

c. Online - Set communication parameter to CPU1: d. Online – Login, Create boot project, Run

d. Online – Login, Create boot project, Run

e. Later PLC_PRG can be used for observing the received data:

Later PLC_PRG can be used for observing the received data: LogData - Water Library Introduction and

6.

Configure substation (IP Substation: 192.168.0.55)

a. Activate FTP server, optionally assign passwords

a. Activate FTP server, optionally assign passwords 7. Download to the substation (CPU2) a. DoubleClick

7. Download to the substation (CPU2)

a. DoubleClick example_LOG_IEC60870_Substation_V23_062 in order to open program in CoDeSys

b. Enter the correct IP address of the control station for the PING mechanism:

IP address of the control station for the PING mechanism: c. Project – Clean All, Build

c. Project – Clean All, Build

d.

Online - Set communication parameter to CPU2

d. Online - Set communication parameter to CPU2 e. Online – Login, Create boot project, Run

e. Online – Login, Create boot project, Run

4.2 Use Mode 0/1: Buffer and disposal in chronologic order

1. Configure test program for Mode 0/1

a. Open Visualization: LogData_IEC60870_total2:

à All yellow fields can be configured or activated

b. Control:

- Mode 0

- Max No of files. 10

- Max No of DS/File: 100

- Drive 1 = SD

(Buffer and disposal in chronologic order, pure buffer)

(Maximum: 999)

(Maximum: 65535)

(if not PM592 with internal flash disk)

c. Input values (Test values created by the example program)

- Activate all 7 data types

- Cyclically, 200

(SP1, IT1, ….)

(Sending 7 datasets every second = 200 * 10 ms cycle time)

d. Result:

7 datasets every second = 200 * 10 ms cycle time) d. Result: à Data is

à Data is transferred directly to the control station (following the green arrows), no buffering. This state is called State 1 in Figure 3.

2.

Mode 0 with real connection break

a. Starting point: State 1

b. Disconnect physical Ethernet cable from CPU1 (Control station)

c. It takes around 1 second until the diconnection is recognized. In the meantime the data is buffered in FIFOin. Afterwards the FIFO buffer starts buffering (State 2):

Afterwards the FIFO buffer starts buffering (State 2): d. Plug Ethernet cable back into CPU1 e.

d. Plug Ethernet cable back into CPU1

e. Release history

f. Result like above: State 3 (Reading data from File FIFO) and State 1 (when File FIFO is empty)

Modes 1, 2 and 3 work as described in the previous chapter (Generic).

Modes 1, 2 and 3 work as described in the previous chapter (Generic).

Note

5.

REVISION HISTORY

Rev. ind.

Page (P)

Description

Date

Chapt. (C)

Dept./Init

V01

 

No changes, only draft deleted

2013-10-23 / ACDT

V11

All

Screenshots updated (Automation Builder and new Visu), …

2015-08-10 / ACM2

M

Note:

We reserve the right to make technical changes or modify the contents of this document without prior notice. With regard to purchase orders, the agreed particulars shall prevail. ABB AG does not accept any responsibility whatsoever for potential errors or possible lack of information in this document. We reserve all rights in this document and in the subject matter and illustrations contained therein. Any reproduction, disclosure to third parties or utilization of its contents – in whole or in parts – is forbidden without prior written consent of ABB AG. © Copyright 2012 ABB , All rights reserved

abb

ABB Automation Products GmbH Wallstadter Str. 59 68526 Ladenburg, Germany Phone: +49 62 21 701 1444 Fax : +49 62 21 701 1382 E-Mail: plc.sales@de.abb.com

www.abb.com/plc