LogData V23 Examples Description V111 3ADR023043M9901

Embed Size (px)

Citation preview

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    1/27

    Example Description V01

    PS563-WATER Library PackageLogData_AC500_V23 Data Logging LibraryApplication Examples

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    2/27

    LogData - Water LibraryIntroduction and Examples Description 1  AC500 / Issue: 08.2015

    Content

    1. INTRODUCTION TO DOCUMENT ............................................................................. 2

    1.1 Scope of the document ................................................................................................... 2

    1.2 Overview of the Content ................................................................................................. 2

    1.3 Compatibi lity ................................................................................................................... 2

    1.4 Safety Instruct ions .......................................................................................................... 2

    2. Logger Overview ............................................................................................................ 3

    2.1 Operat ing 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 Preparat ion ......................................................................................................................... 8

    3.2 Use Mode 0/1 Buf fer and disposal in chronolog ic order ............................................... 10

    3.2 Use mode 2: Buffer and d isposal via FTP ....................................................................... 15

    3.3 Use mode 3: Event recorder ............................................................................................ 17

    4. IEC60870 Example program ........................................................................................ 19

    4.1 Preparat ion ....................................................................................................................... 19

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

    5. REVISION HISTORY ................................................................................................ 25

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    3/27

    LogData - Water LibraryIntroduction and Examples Description 2  AC500 / Issue: 08.2015

    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 providedexample projects, to directly log data of remote communication connections of the AC500 or as standalonedata 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 60870protocol 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 databetween AC500 acting as a substation (logging data in case of interruptions in communication) and a controlstation (receiving then e.g. logged historical data after a communication is there again after an outage).

    1.3 CompatibilityThe example programs explained in this document has been used with the below engineering systemversions. 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 Engineeringprograms.

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

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    4/27

    LogData - Water LibraryIntroduction and Examples Description 3  AC500 / Issue: 08.2015

    2. Logger Overview

    The AC500 Datalogging Function Block Library contains five Function Blocks for the purpose of advancedtime-stamped data logging for different use cases. In typical use cases the AC500 application programgenerates 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/telecontrolstation 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 theDatalogging Function Blocks can store data in case of a broken or intentionally interrupted connectionbetween AC500 and the telecontrol system.

    1 AC500 application

    2 telecontrol

    Fig. 1: Overview

     Alternatively

    ·  The Datalogging Library can be used as an event recorder. In this special mode data is continuouslyrecorded in a ring buffer which can be read out after a certain event x (e.g. outage) in order to analyzethe 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 outvia 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 timestampfor use by the Datalogger. An output Function Block receives the current or retrieved data from theDatalogger 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" communicatevia SRAM FIFOin and FIFOout areas in the memory. This SRAM FIFOs are intermediate buffers and help indecoupling time wise and speeding up the necessary write/read operations on the logging file structuressignificantly. These read/write operations on the files are done in blocks of datasets, enabling a comparablyfast interaction with the otherwise slow file system.

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    5/27

    LogData - Water LibraryIntroduction and Examples Description 4  AC500 / Issue: 08.2015

    Fig. 2: Overview Function Blocks

    Each Datalogging application requires the main Function Block LOG_HANDLING , one of the input FunctionBlocks 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 BlocksLOG_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 IEC60870Library. 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 genericoutput Function Block needs to be hand-shaked with for each data set, in order to retrieve the data fromthe Datalogging files. Therefore the generic Function Blocks can also be used to integrate the datalogging into any other protocol, e.g. Modbus.

    The Function Block LOG_HANDLING ensures that also several consecutive and fast interruptions can behandled without losing data. While the log file is replayed, arriving new data is stored in the SRAM FIFOinand added to the Datalogging files (File FIFO) if the SRAM FIFOin becomes full - during that short time thelog file replay is paused. Nevertheless any data send to a control station via a communication is always withthe 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 breakhas to be calculated and limited.

     As an improvement a ping mechanism can be implemented in the Substation. This was done in the exampleprogram for the IEC logger. With this ping the interruption is already detected after 1-2 seconds (can beconfigured 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 is160 datasets. This means the data rate should be lower than approximately max. datarate = 160datasets/2seconds =>

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    6/27

    LogData - Water LibraryIntroduction and Examples Description 5  AC500 / Issue: 08.2015

    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 

    Fig. 3: Overview Mode 0/1

    Mode 0/1 is for buffering the values from the AC500 application in case of a broken or intentionallyinterrupted connection between AC500 and telecontrol. In the normal state 1 the values are directly sentfrom the FIFOin (input values from application) to FIFOout (telecontrol connection). As soon as theconnection is interrupted, the Datalogger changes to working state 2. The values are sent to the File FIFOinstead. 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 istriggered, the Datalogger changes to working state 3. It cares for disposal of the values in chronologicalorder. The buffered values are written to FIFOout (working state 3a). This may take some time during whichnew values are coming from the application and stored into FIFOin. Before the FIFOin overflows theDatalogger switches to working state 3b and buffers the new values. After that it can continue with workingstate 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 strictlychronological 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 bythe AC500 hardware/firmware), the data rate at which data should be logged in case of acommunication break has to be calculated and limited.

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    7/27

    LogData - Water LibraryIntroduction and Examples Description 6  AC500 / Issue: 08.2015

    2.1.2 Mode 2: Buffer and disposal via FTP

    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 theconnection is established again the Datalogger changes directly back to state 1 and the input values inFIFOin are directly sent to FIFOout (telecontrol connection). The buffered values in File FIFO are internallymoved from disk 1 to disk 2 which can then be accessed or used by FTP (client or server). This move actioncan also be triggered by the command MOVE_FILES, or when file 1 is full. The advantage of Mode 2 is theimmediate availability of the latest and all current values after an outage.

    2.1.3 Mode 3: Events Recorder 

    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 connectionstatus to telecontrol. If the File FIFO is full the oldest values are overwritten (ring buffer). Thus the File FIFOalways contains the values from the past period n, which is depending on the amount of values per secondand on the size of the File FIFO. When a certain event x occurs, the command MOVE_FILES can be givendirectly or after the period m. With the command MOVE_FILES the values in File FIFO are internally movedfrom disk1 to disk 2 and can be read out by an FTP action (client or server) when required.

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    8/27

    LogData - Water LibraryIntroduction and Examples Description 7  AC500 / Issue: 08.2015

    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.

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    9/27

    LogData - Water LibraryIntroduction and Examples Description 8  AC500 / Issue: 08.2015

    3. Generic Example program

    This chapter describes how to use the Generic Logger example program. The following components wereused 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 targetchange has to be performed:

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    10/27

    LogData - Water LibraryIntroduction and Examples Description 9  AC500 / Issue: 08.2015

    4. Configure in Automation builder 

    a. Activate FTP server, optionally assign passwords

    5. Download to AC500

    a. DoubleClick example_LOG_Generic_Substation_V23_062 in order to open program inCoDeSys

    b. Project – Clean All, Build

    c. Online - Set communication parameter to the CPU

    d. Online – Login, Create boot project, Run

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    11/27

    LogData - Water LibraryIntroduction and Examples Description 10  AC500 / Issue: 08.2015

    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:

    à

     All yellow fields can be configured or activated

    b. Control:- Mode 0 (Buffer and disposal in chronologic order, pure buffer)- Max No of files. 10 (Maximum: 999)

    - Max No of DS/File: 100 (Maximum: 65535)- Drive 1 = SD (if not PM592 with internal flash disk)

    c. Input values (These test values are created by the example program)- Activate all 7 data types (BOOL, BYTE, REAL, …)- Cyclically, 200 (Sending 7 datasets every second = 200 * 10 ms cycle time)

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    12/27

    LogData - Water LibraryIntroduction and Examples Description 11  AC500 / Issue: 08.2015

    d. Result:

    à

    Data is transferred directly to the control station (following the green arrows), no buffering. Thisis 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 ControlStation

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    13/27

    LogData - Water LibraryIntroduction and Examples Description 12  AC500 / Issue: 08.2015

    c. Result

    à

    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:

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    14/27

    LogData - Water LibraryIntroduction and Examples Description 13  AC500 / Issue: 08.2015

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

    f. Release button “Break”

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

    h. Result: State 3

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

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    15/27

    LogData - Water LibraryIntroduction and Examples Description 14  AC500 / Issue: 08.2015

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

    à

    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.

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    16/27

    LogData - Water LibraryIntroduction and Examples Description 15  AC500 / Issue: 08.2015

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

    à Inorder 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

    à Incomparison 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

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    17/27

    LogData - Water LibraryIntroduction and Examples Description 16  AC500 / Issue: 08.2015

    b. Reset

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

    d. Break connection

    e. Result: file1 is filled

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    18/27

    LogData - Water LibraryIntroduction and Examples Description 17  AC500 / Issue: 08.2015

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

    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:

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

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    19/27

    LogData - Water LibraryIntroduction and Examples Description 18  AC500 / Issue: 08.2015

    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:

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

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    20/27

    LogData - Water LibraryIntroduction and Examples Description 19  AC500 / Issue: 08.2015

    4. IEC60870 Example program

    This chapter describes how to use the IEC 60870 Logger example program. The following components wereused 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 substationIP 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.22SD 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 theswitch

    ·  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 executed1. 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 targetchange has to be performed:

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    21/27

    LogData - Water LibraryIntroduction and Examples Description 20  AC500 / Issue: 08.2015

    4. Configure the control station (IP Controlstation: 192.168.0.54):

    a. Activate SNTP-Client and Connection to Substation

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

    5. Download to the control station (CPU1)

    a. DoubleClick on example_LOG_IEC60870_Controlstation_V23 in order to open program inCoDeSys

    b. Project – Clean All, Build

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    22/27

    LogData - Water LibraryIntroduction and Examples Description 21  AC500 / Issue: 08.2015

    c. Online - Set communication parameter to CPU1:

    d. Online – Login, Create boot project, Run

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

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    23/27

    LogData - Water LibraryIntroduction and Examples Description 22  AC500 / Issue: 08.2015

    6. Configure substation (IP Substation: 192.168.0.55)

    a. Activate FTP server, optionally assign passwords

    7. Download to the substation (CPU2)

    a. DoubleClick example_LOG_IEC60870_Substation_V23_062 in order to open program inCoDeSys

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

    c. Project – Clean All, Build

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    24/27

    LogData - Water LibraryIntroduction and Examples Description 23  AC500 / Issue: 08.2015

    d. Online - Set communication parameter to CPU2

    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 (Buffer and disposal in chronologic order, pure buffer)- Max No of files. 10 (Maximum: 999)- Max No of DS/File: 100 (Maximum: 65535)- Drive 1 = SD (if not PM592 with internal flash disk)

    c. Input values (Test values created by the example program)- Activate all 7 data types (SP1, IT1, ….)- Cyclically, 200 (Sending 7 datasets every second = 200 * 10 ms cycle time)

    d. Result:

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

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    25/27

    LogData - Water LibraryIntroduction and Examples Description 24  AC500 / Issue: 08.2015

    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 isbuffered in FIFOin. Afterwards the FIFO buffer starts buffering (State 2):

    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)

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

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    26/27

    LogData - Water LibraryIntroduction and Examples Description 25  AC500 / Issue: 08.2015

    5. REVISION HISTORY

    Rev. ind. Page (P)Chapt. (C)

    Description DateDept./Init

    V01 No changes, only draft deleted 2013-10-23 / ACDT

    V11 All Screenshots updated (Automation Builder and newVisu), …

    2015-08-10 / ACM2

  • 8/18/2019 LogData V23 Examples Description V111 3ADR023043M9901

    27/27