750_programming_102010

83
ACOS 750 Telecontrol and automation CoDeSys ® : PLC Communication Library

Upload: ehsan-rohani

Post on 30-Apr-2017

260 views

Category:

Documents


13 download

TRANSCRIPT

ACOS 750 Telecontrol and automation

CoDeSys®: PLC Communication Library

Preliminary note

Your safety tips:

DANGER

Insufficient attention or incorrect compliance with this information means serious riskof injury or even death..

WARNING

Insufficient attention or incorrect compliance with this information means serious riskof injury or serious property damage.

CAUTION

Insufficient attention or incorrect compliance with this information means risk of injuryor slight damage to property.

Additional note:

TIP

This note highlights you additional information or helpful tips.

Copyright DisclaimerCopyright © IDS GmbH All rights reserved.Reprints or copies of this document may not be made,even in part.This document may not be reproduced in whole or inpart, in any form (photocopying, microfilm or other pro-cesses), nor may it be electronically processed, repro-duced or distributed, even for the purpose of lessonsor instruction, without the written consent of IDSGmbH.We reserve the right to claim damages in the event ofinfringements of the above.IDS GmbHNobelstraße 18D-76275 Ettlingen

Some of the functions described in this document areoptional, in the sense that only certain product versionsinclude these functions. Other functions not describedin this document may be capable of running in the sys-tem, but we are unable to provide any guarantee forthese functions.The content of the documentation is checked regularly.Any necessary corrections are contained in subse-quent editions.We reserve the right to make technical modifications.

Table of Contents

1 Programming of PLCs via CoDeSys® V3

1.1 Notes on PLC Programming ......................................................................................... 11.2 First Steps ................................................................................................................... 1

1.2.1 Installation of IEC60870 repository ...................................................................... 21.2.2 Integration of Device Description Files ................................................................ 2

1.3 How to Create a New CoDeSys® V3 Project ................................................................. 51.4 CoDeSys® V3 Settings ................................................................................................ 71.5 Connect CoDeSys® to ACOS 750 SPS ....................................................................... 141.6 Load PLC Program to ACOS 750 ............................................................................... 151.7 Addressing of the input and output area acc. to IEC 61131-3 ........................................ 161.8 Add visualisation ........................................................................................................ 161.9 General System Behaviour ......................................................................................... 18

1.9.1 Reset Warm Application ................................................................................... 181.9.2 Reset Cold Application ..................................................................................... 181.9.3 Reset Source Application .................................................................................. 181.9.4 Create Boot Application .................................................................................... 18

1.10 Remanent Variables - RETAIN, PERSISTENT ........................................................... 181.10.1 Retain Variables ............................................................................................. 191.10.2 Persistent Variables ........................................................................................ 191.10.3 Synoptical Table - Behaviour of Remanent Variables ........................................ 20

1.11 Network Variables .................................................................................................... 201.11.1 Definition of Network Properties of a Global Variable List (Sender) .................... 211.11.2 How to Add a Global Network Variable List (Receiver) ...................................... 22

2 IEC 60870-5 Communication Library

2.1 Operation Sequence .................................................................................................. 262.2 Reception of Data in Monitoring Direction .................................................................... 29

2.2.1 GET_SPI - Get Single-Point Information ............................................................ 292.2.2 GET_DPI - Get Double-Point Information ........................................................... 302.2.3 GET_RSPI - Get Regulating-Step Position Information ....................................... 312.2.4 GET_IT - Get Counter Value ............................................................................. 322.2.5 GET_MV_REAL - Get Floating-Point Measured Value ........................................ 332.2.6 GET_MV_NORM - Get Normalised Measured Value .......................................... 342.2.7 GET_MV_SCALED - Get Scaled Measured Value .............................................. 35

2.3 Reception of Data in Command Direction .................................................................... 362.3.1 GET_SC - Get Single Command ....................................................................... 362.3.2 GET_DC - Double Command ........................................................................... 382.3.3 GET_RSC - Get Regulating-Step Command ...................................................... 402.3.4 GET_SPC_REAL - Get Floating-Point Setpoint .................................................. 422.3.5 GET_SPC_NORM - Get Normalised Setpoint .................................................... 452.3.6 GET_SPC_SCALED - Get Scaled Setpoint ........................................................ 48

2.4 Transmission of Data in Monitoring Direction ............................................................... 512.4.1 SET_SPI - Send Single-Point Information .......................................................... 512.4.2 SET_DPI - Send Double-Point Information ......................................................... 532.4.3 SET_RSPI - Send Regulating-Step Position Information ..................................... 552.4.4 SET_IT - Send Counter Value ........................................................................... 572.4.5 SET_MV_REAL - Send Measured Value ........................................................... 592.4.6 SET_MV_NORM - Send Normalised Measured Value ........................................ 612.4.7 SET_MV_SCALED - Send Scaled Measured Value ............................................ 63

2.5 Transmission of Data in Command Direction ............................................................... 652.5.1 SET_SC - Send Single Command ..................................................................... 652.5.2 SET_DC - Send Double Command ................................................................... 68

IDS GmbH, 10/2010 iii

2.5.3 SET_RSC - Send Regulating-Step Command .................................................... 702.5.4 SET_SPC_REAL - Send Setpoint ..................................................................... 732.5.5 SET_SPC_NORM- Send Normalised Setpoint ................................................... 752.5.6 SET_SPC_REAL - Send Setpoint ..................................................................... 77

2.6 System Time ............................................................................................................. 792.6.1 GET_SYSTEMTIME02 ..................................................................................... 79

Programming of PLCs via CoDeSys® V3 – Manual

IDS GmbH, 10/2010 iv

1. Programming of PLCs via CoDeSys® V3This manual provides information on the programming of ACOS 750 PLCs via CoDeSys® V3 and givesan overview of the appropriate communication library to enable access to information objects in ac-cordance with IEC 60870-5-101/104.

For further information on the programming of PLCs via CoDeSys® V3, please refer to the CoDeSys®

V3 online Help function.

1.1. Notes on PLC Programming

• Integrated PLC

The ACOS 750 automation and telecontrol device features an integrated PLC runtime system. Thefollowing central processor modules are supported:

- CU78A with LCD (128x64 pixels)

- CU78B

- CU78C Compact with integrated power supply unit

• The CoDeSys® V3 Programming System

The CoDeSys® V3 programming system can be used for the programming of PLCs in accordancewith the international standard IEC 61131-3.

NoteThe PLC can be programmed via the Ethernet interface of the central processor module.

• Program Memory

For the PLC program, the central processor module provides 1.5 MB of buffered memory.

The data (variables) are buffered and stored separately in one area of the MRAM. For data storage,a memory space of 96 kB is reT_SCved.

1.2. First Steps

IDS GmbH, 10/2010 1

1.2.1. Installation of IEC60870 repository

In order to use the telecontrol functions with the PLC, you hat to add the "IDS-library"

Figure 1: Bibliotheksrepository

Install via the menu Tools/library repository the file "iec60870.library".

1.2.2. Integration of Device Description Files

In order to be able to use CoDeSys® V3 for programming of the ACOS 750 PLC, you have to install thefollowing device description files under Tools/Device Repository:

• "acos750cu78.devdesc.xml"

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 2

• "acos750ebus.devdesc.xml"

Figure 2: Device repository

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 3

File typeWhen you install the ACOS 750 device description files in CoDeSys®, switch the file typefrom EtherCAT XML (*.xml) to device description file (*.devdesc.xml).

Figure 3: File type

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 4

1.3. How to Create a New CoDeSys® V3 Project

Figure 4: Creating a new project

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 5

If you wish to create a new project, you have to select "ACOS 750-CU78 (IDS GmbH") as the program-mable device.

Figure 5: Selecting ACOS 750-CU78

You can freely choose one of the following programming languages: SFC, IL, CFC, FBD, LD and ST.

NoteOnce you have selected a specific programming language for writing your program it willnot be possible to change it at a later stage.

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 6

In the present example, we have chosen CFC as a programming language. After having created a newproject, the Devices and POU (Program Organization Unit) view looks like this:

Figure 6: Device view

Figure 7: POUs view

The POUs window includes the project settings.

The Devices view shows a tree structure which includes the device ("Device (ACOS 750-CU78)" withan application inserted underneath. The latter contains the program (edited via CFC) "PLC_PRG" andthe obligatory task configurations with a "MainTask" for the operation of the PLC-PRG program.

Additionally, the application contains a Library Manager which, by default, contains the "IoStandard.li-brary" that is required for I/O configuration, as well as the "Standard.library" which provides all functionsand function blocks required by the IEC61131-3 norm as standard blocks for an IEC programming sys-tem.

The additional node "PLC Logic" below the "Device (ACOS 750-CU78)" node is only a symbolic nodeindicating that the device is actually "programmable".

1.4. CoDeSys® V3 Settings

In a newly created project, you have to add the ACOS_750_E_BUS to the device by right-clicking "Device-> Add Device". The E-BUS is the interface between the runtime system and the I/O level. The hardware

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 7

(I/O level) only needs to be parametrised in ACOS ET and does not require additional parametrisationin CoDeSys®.

Figure 8: Add ACOS 750 E_BUS

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 8

The declaration of variables with direct addressing (AT declaration) according to IEC 61131-3 is donevia the Global Variable List. Example:

PumpeStart AT %QX0.0 : BOOL;

To do this, you have to right-click the Global Variable List (GVL) in order to add it to "Application -> AddObject -> GVL".

Figure 9: How to add a Global Variable List

NoteYou can automatically insert the variable declaration according to the hardware (I/O level)parametrised in ACOS ET in the GVL of CoDeSys® via the clipboard.

If you want the variables to keep their value even after a system failure, you have to declare themaccordingly in a special variables list as "Persistent Variables". For further information on PersistentVariables, please refer to Chapt. 1.5 You can add a Persistent Variable List in the same way as a GVL.

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 9

Figure 10: How to add a Persistent Variable

Apart from the default program "PLC_PRG", you can also add further POUs, including programs, func-tion blocks or functions to the application.

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 10

NoteFunction blocks and functions can also be stored in the POU view, the advantage being thatyou can use it in all devices/applications.

Figure 11: How to add a program

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 11

After adding a new program or re-naming the "PLC_PRG" program, you have to call them up in theappropriate task in the task configuration. Here you can also specify the program execution sequence.It is advisable, however, to remove programs which you do not intend to use.

Figure 12: Task configuration

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 12

Figure 13: Complete device view

The subdialog "PLC Settings" of the Device editor serves for the configuration of some of the basicsettings for the PLC. The following illustration shows the prescribed configuration of an ACOS 750 de-vice, unless specified otherwise by the user:

Figure 14: Device dialog, PLC settings

Application for I/O handling: At first, this box contains the standard application that is automaticallyinserted into a standard project via default, but the operator can also select any other application fromthe drop-down list.

• PLC settings

Update I/Os while in stop: When this option is activated (default), the values of the input and outputchannels are updated even when the PLC changes over to the Stop status. If the watchdog detectsa fault, the outputs are set to the the default values.

Behaviour for outputs in Stop: The drop-down list offers the following options for the treatment ofoutput channels when the PLC is in the Stop status:

- Keep values:The current values are kept.

- Set all outputs to default: Here, the system assigns the default values resulting from the I/Omap.

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 13

- Execute program: The treatment of output values can be controlled via a program contained inthe project. The name of this program can be specified via the input help function; it is executedwhen the PLC changes to the Stop status.

Update all variables in all devices: If this option is activated, all I/O variables are updated for alldevices in the current PLC configuration in each cycle of the bus cycle task. This option is equivalentto the option "Always update variables" which can also be set individually for each device in the "I/O map" dialog.

• Bus cycle options

Bus cycle task: The drop-down list offers a selection of all tasks that are defined in the task con-figuration of the active application. (e.g. "MainTask", EtherCAT Master" etc.). The standard settingthat is specified in the device description is already set (default). It is possible to select a differentsetting; in this case, however, the following must be considered:

NoteBefore changing the setting to "unspecified", one should be aware of the possible effects."unspecified" means that the standard behaviour, as defined in the device description,takes effect. Therefore the description has to be checked accordingly. As a standard, itis possible to define the task with the shortest cycle time as default setting, but also thatwith the longest cycle time!

1.5. Connect CoDeSys® to ACOS 750 SPS

If the programming device (PC, laptop etc.) is connected to the ACOS 750-CU78 device via Ethernetand both clients have an IP address in the same subnetwork, you have to establish a connection inCoDeSys®. The Gateway server is automatically started as service during system startup.

Please check the status via the corresponding icon in the bottom icon bar:

Gateway is running.

Gateway is stopped - you have to start it manually.

Open the communication settings in the central window by double-clicking "Device". After that, proceedas follows:

1. Add gateway

2. Search the network

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 14

3. Select a device and set the active path

Figure 15: Connect CoDeSys with the PLC

In the "idsdev_1[0064]" PLC, 1 stands for the CAASDU address according to IEC 60870-5; the number64 in the square bracket stands for the host portion of the IP address in hexadecimal writing.

1.6. Load PLC Program to ACOS 750

You can load a PLC program onto the station via "Menu/Online -> Log on 'Application [Device: PLCLogic]'". If the application is marked green, the CPU status is 'Run'. If the application is still marked red- i.e. the status is 'Stop' - you can start via the "Start application" button.

NoteIt is possible to create several applications in one device. These applications can be loaded,started and stopped individually. The "RUN" switch of ACOS 750 can be used for simulta-neously starting and stopping all applications of the device.

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 15

1.7. Addressing of the input and output area acc. to IEC 61131-3

Addressing of the input and output area acc. to IEC 61131-3 is based on the hardware (I/O level) par-ametrised in ACOS ET and the resulting information object model.

Informationobject

I/O module Information ob-ject range

Addr. acc to IEC 61131-3 Quanti-ty

Data type

Event signals Digital Input 4097 - 6145 dez

1001 - 1801 hex

at%IX0.0

at%IX0.1

...

at%IX255.7

2048 BOOL

Measured val-ues

Analog input 8193 - 8449 dez

2001 - 2101 hex

at%IW256

at%IW258

...

at%IW2302

1024 INT, REAL

Counter val-ues

Counter input 12289 - 12545 dez

3001 - 3101 hex

at%ID2304 (ZW)

at%IW2308 (Status)

at%ID2312 (ZW)

at%IW2316 (Status)

...

at%ID4344 (ZW)

at%IW4348 (Status)

256 UDINT

INT

Commands Digital output 24577 - 26625 dez

6001 - 6801 hex

at%QX0.0

at%QX0.1

...

at%QX255.7

2048 BOOL

Setpoints Analog output 20481 - 20737 dez

5001 - 5101 hex

at%QW256

at%QW258

...

at%QW2302

1024 INT, REAL

1.8. Add visualisation

If you are using the central processor module CU78A, you can parametrise the output via LCD (fully-graphic, resolution 128x64 pixels) by means of CoDeSys® V3. You can add a visualisation to your projectby right-clicking the items "Application -> Add object -> Visualization". When you have inserted a visu-alisation in the Device tree underneath an Application, a Visualization Manager object with targetvisualisation and VISU_Task is added automatically. The "Visualization Manager" defines common set-tings for all visualisations of the application, e.g. size, start visualisation, settings for Web and targetvisualisation. The code that is generated for the visualisation objects of the project can be loaded onto

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 16

the PLC, i.e. on the target system. For further information on how to proceed, please refer to the CoD-eSys® V3 on-line help.

Figure 16: Add visualisation

After you have created and uploaded a visualisation, you can use the arrow key to navigate and scrollwithin the display. You can exit the dialog via the "ESC" key, and confirm the control action via the "RET"key.

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 17

1.9. General System Behaviour

1.9.1. Reset Warm ApplicationThis command (category: on-line) is available in the on-line mode. With the exception of the remanent(Retain, Persistent) variables, this command resets all variables to their initialisation value.

If variables were initialised with specific values, they are reset exactly to these values. All other valuesare reset to the default initialisation value (integer values, for instance, are reset to 0).

As a precaution, CoDeSys® again requests a confirmation from the user before overwriting all variables.The situation is similar to a power failure or the disconnection and re-start of the PLC while the applicationis running (warm restart).

A reset deactivates the breakpoints that are currently set in the project. If the command Reset Warm iscalled up while the program stops at a breakpoint, the user is asked whether the current cycle shall bestopped before the reset is finished or whether the task shall be finished and the reset shall be carriedout immediately. However, not all runtime systems are capable of doing a reset without previously fin-ishing the current cycle.

Please use the 'Start' command after the reset in order to restart the application.

1.9.2. Reset Cold ApplicationThis command (category: on-line) is available in the on-line mode. It equals the 'Reset' command (resetwarm); apart from the "normal" variables, the Retain variables(!) are also reset to their initialisationvalues. The situation is the same as when starting an application program which has just been loadedonto the PLC ("cold start")

A reset deactivates the breakpoints that are currently set in the project. If the command Reset Cold iscalled up while the program stops at a breakpoint, the user is asked whether the current cycle shall bestopped before the reset is finished or whether the task shall be finished and the reset shall be carriedout immediately. However, not all runtime systems are capable of doing a reset without previously fin-ishing the current cycle.

1.9.3. Reset Source ApplicationThis command (category: on-line) is available in the on-line mode. It resets the value of all remanentvariables to their initialisation values and deletes the application program on the control.

A reset deactivates the breakpoints that are currently set in the project. If the command ResetSource is called up while the program stops at a breakpoint, the user is asked whether the current cycleshall be stopped before the reset is finished or whether the task shall be finished and the reset shall becarried out immediately. However, not all runtime systems are capable of doing a reset without previouslyfinishing the current cycle.

1.9.4. Create Boot ApplicationThis command (category: on-line) is available for the creation of boot projects both in the on-line and inthe off-line mode. A boot application (boot project) is started automatically during the PLC start. It isgiven the name Applicationname.app. It is generated automatically when a program is downloaded tothe PLC. This, however, is not the case with an on-line change. In this case, the boot application has tobe created manually to make sure that the modified program will be started on the PLC even after areset.

1.10. Remanent Variables - RETAIN, PERSISTENTRemanent variables can keep their value beyond the usual running time of the program. They are re-ferred to as "retain variables", or even as "persistent variables". These variables have their own memoryarea for administration.

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 18

The selected mode of declaration determines the degree of "resistence" of a remanent variable in theevent of resets, downloads or a reboot of the PLC. In everyday's practice, a combination of the twovariable types is usually required (see below: Persistent Variables)

NoteWhen a CoDeSys® V2.3 project is opened, the declarations of retain variables are kept andremain effective without modification; the declarations of persistent variables, however,have to be revised or newly created - see below: it is necessary to create a separate globallist of variables!

1.10.1. Retain Variables

Variables that are declared as "retain variables" are organised target system-dependent, but also, typ-ically, in a separate memory area. In the CoDeSys® project, these variables are marked with thekeyword "RETAIN" in their declaration, in a block or in a global list of variables.

Example:

VAR RETAIN iRem1 : INT; (*1. Retain variable*) END_VAR

Retain variables keep their value after an uncontrolled termination or after the on-line command 'ResetWarm Application', and also after a normal boot/reboot of the PLC. After a program re-start, operationis continued using the stored values. In this case, all the other variables are newly initialised, either withtheir initialised values or with the standard initialisations.

Application example: A batch counter in a production line shall continue counting after a power failure.

Retain variables, however, are re-initialised after a 'Reset (source)' and - as opposed to persistentvariables - in the event of a 'Reset (cold)' and a renewed program download.

The "Retain" property can be combined with the "Persistent" property. For further information, pleaserefer to the synoptical table given below.

NoteIf a local variable is declared as a RETAIN variable in a program, it is exactly this varia-ble that is stored in the Retain area (like a global Retain variable).

If, however, a local variable is declared as RETAIN variable in a function block, the com-plete instance of this function block is stored in the Retain area (all data of the block), butonly the declared Retain variable is actually treated as a Retain variable.

If a local variable in a function is declared as a RETAIN variable, this has no effect what-soever. The variable is not stored in the Retain area! If a local variable in a function isdeclared as PERSISTENT, this has no effect either!

1.10.2. Persistent Variables

Persistent variables are marked with the keyword "PERSISTENT" (VAR_GLOBAL PERSISTENT).They are re-initialised only after a Reset (source) of the PLC. In contrast to Retain variables, Persistentvariables keep their value after a download. Application example for "persistent Retain variables": anelapsed-meter that shall continue metering after a power failure or a download. See also below - syn-optical table.

Persistent variables are treated in the following manner, i.e. different from CoDeSys® V2.3: Persistentvariables can be declared ONLY in a special global list of variables of the object type 'persistent vari-ables' which belongs to an application. There is only ONE such list per application.

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 19

NoteIn CoDeSys® V3.3.0.1 or later, a declaration with "VAR_GLOBAL PERSISTENT" has thesame effect as a declaration with "VAR_GLOBAL PERSISTENT RETAIN" or "VAR_GLOB-AL RETAIN PERSISTENT".

Similar to Retain variables, Persistent variables are organised in a separate memory area.

Example:

VAR GLOBAL PERSISTENT RETAIN diVarPers1 : DINT; (*1. Persistent+Retain Variable APP1*) xVarPers : DINT; (*2. Persistent+Retain Variable APP1*) xVarPers :

NoteIn the future, it will be possible to map the variables of the POUs of an application to thislist, thus converting them into remanent variables; currently, however, only global persis-tent variables are available.

The target system has to provide a separate memory area per application for the list of persistentvariables.

With each upload of the application, the list of persistent variables on the PLC is compared to that of theproject. The list of variables on the PLC is also identified by the application name, amongst others. Ifthere are inconsistencies the user is requested to initialise all persistent variables prior to the download.Inconsistencies occur, for instance, if existing persistent variable delcarations are renamed, deleted orotherwise modified.

New declarations can only be added at the end of the list; they are recognised as "new" during adownload and do not require a re-initialisation of the complete list.

1.10.3. Synoptical Table - Behaviour of Remanent Variablesx = Value is kept

- = Value is re-initialised

following an on-line command VAR VAR RETAIN VAR PERSISTENT VARRETAIN PERSISTENTVAR PERSISTENT RE-TAIN

Reset Warm Application - x xReset Cold Application - - xReset Source Application - - -Load (=download) application - - xOn-line change application x x xReboot PLC - x x

1.11. Network VariablesIf this feature is supported by the target system, it is possible to carry out data exchange within thenetwork by means of network variables.

This kind of cross-communication is supported by the ACOS 750 automation and telecontrol device.

In "rigid" lists of variables, network variables must be defined both in the transmitter and the receiver.Their values are transmitted within the network via broadcasting

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 20

Network variables can be managed by means of...

• Global Variable Lists (GVL) in the transmitting device (Sender), and in one or several corresponding

• Global Network Variable Lists (GNVL) in one or several receiving devices (Receiver).

The GBL and GNVLs belonging together must have the same variable declarations.

A Global Variable List (GVL) that is to define network variables, must have special network properties.These properties are protocol and transmission parameters according to which the variable values shallbe transmitted within the network and which shall enable the reception of the variable values by alldevices with the appropriate GNVL.

Please not that transmission of network variables invariably takes place in one direction only, i.e. fromthe Sender (GVL) to the Receiver (GNVL)! However, due to the fact that each device is capable ofhandling both GVLs and GNVLs, it is possible to use a device both as a Sender and a Receiver.

One condition for the exchange of network variables is the installation of the appropriate network li-braries. This is done automatically for the standard network functionalities, e.g. UDP, once the networkproperties of a GVL have been set.

1.11.1. Definition of Network Properties of a Global Variable List (Sender)

Select "Global Variable List" in the navigation tree and then select the command "Properties" from thecontext menu. After that, you can make the following settings under Network Properties:

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 21

Figure 17: How to define the network properties of a GVL

1.11.2. How to Add a Global Network Variable List (Receiver)

Your require at least two devices in a project for the definition of an GNVL. Begin by adding a seconddevice with all the required objects to the project. Select "Application" in your newly added device. Openthe dialog "Add Object" to add a Global Network Variable List that is the counterpart of the defined GVLof your first device.

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 22

Figure 18: How to add a Global Network Variable List

Enter a name of your choice. The "Sender" box contains a drop-down list of all available GVLs in aproject, together with their network properties. In our example, only the "GVL" is available.

Close the dialog via "OK" in order to insert the object "NVL" under "Application" in your newly addeddevice. This GNVL automatically includes the same variable declarations as the "GVL". GVL and GNVLare shown with a red arrow in the transmission and the receive direction, provided they have beenconfigured as described above. If you have any further queries, please use the CoDeSys® V3 on-linehelp.

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 23

Figure 19: Device view of the Global Network Variable List - Sender and Receiver

Programming of PLCs via CoDeSys® V3

IDS GmbH, 10/2010 24

2. IEC 60870-5 Communication LibraryThe CoDeSys® V3 programming system includes a standard library which has been supplemented withthe communication library from IDS. This IDS communication library provides function blocks whichenable you to directly access information objects of the IEC 60870-5-101/104 standard in the ACOS 750automation and telecontrol system, in order to perform communication tasks in telecontrol systems.

• Information object types

For the use of function blocks, it is irrelevant whether the information objects are

- registered in the local station,

- sent/received in the monitoring direction or

- sent/received in the command direction.

The following information object types of the IEC 60870-5-101/104 standard are supported:

- Single-point information, double-point information, regulating-step position information

- Measured values (normalised, scaled, floating-point measured values)

- Counter values

- Single commands (persistent/pulse commands), double commands (pulse commands), regulat-ing-step commands

- Setpoints (normalised, scaled, floating-point setpoints)

IDS GmbH, 10/2010 25

2.1. Operation Sequence

The following illustration gives a schematic overview of the operation sequence:

Figure 20: Operation Sequence

The meaning of the different index entries is listed in the following table:

Index Meaning Function Blocks1 Reception of event signals, measured val-

ues and counter values in the monitoringdirection.

GET_SPI, GET_DPI, GET_RSPI

GET_MV_NORM, GET_MV_SCALED,GET_MV_REAL

GET_IT

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 26

Index Meaning Function Blocks2 Reception of commands and setpoints in the

command direction.GET_SPI, GET_DPI, GET_RSPI

GET_SPC_NORM, GET_SPC_SCALED,GET_SPC_REAL

3 Transmission of event signals, measuredvalues and counter values in the monitoringdirection.

GET_SPI, GET_DPI, GET_RSPI

GET_MV_NORM, GET_MV_SCALED,GET_MV_REAL

SET_IT4 Transmission of commands and setpoints in

the command direction.GET_SPI, GET_DPI, GET_RSPI

GET_SPC_NORM, GET_SPC_SCALED,GET_SPC_REAL

NoteIn contrast to the data elements of the I/O level, the data elements under index entries 2and 3 are virtual data elements of the PLC. Therefore, they cannot be accessed via variabledeclaration with direct addressing, but only via function blocks from the communication li-brary. Status signals, too, can only be accessed via function blocks. The address ranges ofthese status signals and virtual data elements are listed in the following table:

Information ob-ject

Meaning Information objectrange

Addressingacc. to IEC61131-3

Quantity Data type

Status signals 0001 - 4095 dec0001 - 0FFF hex

only via FBs

Event signals Event signals gener-ated by the PLC pro-gram

4,097 - 8,191 dec1,001 - 1FFF hex

only via FBs BOOL

Measured values Measured values gen-erated by the PLC pro-gram

8,193 - 12,287 dec2,001 - 2FFF hex

only via FBs INT, REAL

Counter value Counter contents gen-erated by the PLC pro-gram

12,289 - 16,383 dec3,001 - 3FFF hex

only via FBs UDINT

Commands Commands from thecontrol centre and otherstations, respectively

24,577 - 28,671 dec6,001 - 6FFF hex

only via FBs BOOL

Setpoints Commands from thecontrol centre and otherstations, respectively

20,481 - 24,575 dec5,001 - 5FFF hex

only via FBs INT, REAL

Basically, the operations sequence is as follows:

• Basic structure

The PLC application in the ACOS 750 automation and telecontrol device is able to access both dataelements from the local station (I/O level, system information) and data elements from stations in thecommand direction, and it supports communication with control systems, operation and monitoringdevices or with stations in the monitoring direction. There are 2 ways of accessing data elements inthe local station:

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 27

• A: IEC 60870-5-101/-104

Access to data elements (I/O level, system information) that are mapped to information objects acc.to the IEC 60870-5-101/104 standard. These data elements can be accessed via function blocksacc. to IEC 61131-3 of the IDS-IEC-60870 library which can be for use with CoDeSys® V3 (seedescription of the library). The advantage of this method is that enables the utilisation of the completeinformation content of a data element (status, quality, cause of transmission etc.) acc. to the IEC60870-5-101/104 standard.

• B: IEC 61131-3

Access to data elements (only I/O level) via variable declaration with direct addressing (AT declara-tion) acc. to IEC 61131-3. Example: PumpeStart AT %QX0.0:; BOOL; (see list of address assign-ments). This is the most performant way of accessing data elements on the I/O level. However, onecan only access the status. For this mode of access, data elements do not necessarily have to bemapped to information objects acc. to. the IEC 60870-5-101/104 standard.

Access to data elements from stations in the command direction is only possible for those data elements(I/O level, system information, data elements of the PLC application for communication with higher-levelcontrol systems, operation and monitoring devices or stations) that are mapped to information objectsacc. to the IEC 60870-5-101/104 standard. In this context, it is irrelevant via which communication ap-plication the stations are connnected (IEC 60870-5-101/104, protocol drivers Modbus, Profibus, etc. withconversion into information objects acc. to IEC 60870-5 ). Additionally, these information objects mustalso be parameterised in the information object model (process image) of the station that shall be ac-cessed from the PLC application.

Communication with control systems, operation and monitoring devices or stations in the monitoringdirection can be done solely via data elements that are mapped to information elements acc. to IEC60870-5-101/104 in the information object model of the local station. These data elements can be ac-cessed via function blocks acc. to IEC 61131-3 of the IDS-IEC-60870 library which can be integratedfor use with CoDeSys® V3.

The following paragraph gives a description of the function blocks from the communication library inalphabetical order:

1. Name of function block with a short description of its communication task

2. Image of the function block

3. Overview table of function block parameters, with IN referring to input parameters and OUT foroutput parameters.

4. Conditions required to enable the function block to perform its communication task(s).

5. Further description, if necessary

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 28

2.2. Reception of Data in Monitoring Direction

2.2.1. GET_SPI - Get Single-Point Information

Figure 21: GET_SPI

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxON OUT BOOL INformation object sta-

tus, bit SPI in SIQuiCOT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in monitoring direction.byQUAL OUT BYTE Information object quali-

ty, QDS in SIQxIV OUT BOOL Invalid Bit IV from information object qualitydtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

xENO OUT BOOL Block enabled (state ofenable)

• Purpose and Polling

Carry out cyclic polling of the corresponding function block in the PLC program to receive single-point information.

• Preconditions

To be able to receive single-point information from a source station, please make sure that the in-formation objects are parameterised in the source station and that they are in-service.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 29

2.2.2. GET_DPI - Get Double-Point Information

Figure 22: GET_DPI

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxOFF OUT BOOL Status Double-point information- Status OFF

(State Bit0)xON OUT BOOL Status Double-point information - Status ON

(State Bit1)uiCOT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in monitoring direction.byQUAL OUT BYTE Information object quali-

ty, QDS in DIQxIV OUT BOOL Invalid Bit IV from information object qualitydtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

xENO OUT BOOL Block enabled (state ofenable)

• Purpose and Polling

Carry out cyclic polling of the corresponding function block in the PLC program to receive double-point information.

• Preconditions

To be able to receive double-point information from a source station, please make sure that theinformation objects are parameterised in the source station and that they are in-service.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 30

2.2.3. GET_RSPI - Get Regulating-Step Position Information

Figure 23: GET_RSPI

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dresssiVALUE OUT SINT Regulating-step position

information (Value withtransient state indication(VTI))

uiCOT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC60870-5-101 in monitoring direction.

byQUAL OUT BYTE Information object quali-ty, QDS, Qualifier ofCommand

xIV OUT BOOL Invalid Bit IV from information object qualitydtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

xENO OUT BOOL Block enabled (state ofenable)

• Purpose and Polling

Carry out cyclic polling of the corresponding function block in the PLC program to receive regulating-step position information.

• Preconditions

To be able to receive regulating-step position information from a source station, please make surethat the information objects are parameterised in the source station and that they are in-service.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 31

2.2.4. GET_IT - Get Counter Value

Figure 24: GET_IT

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressudiVALUE OUT UDINT Counter value in binary

counter reading (BCR)uiCOT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in monitoring direction.byQUAL OUT BYTE Information object quali-

tyxIV OUT BOOL Invalid Bit IV from information object qualitydtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

xENO OUT BOOL Block enabled (state ofenable)

• Purpose and Polling

Carry out cyclic polling of the corresponding function block in the PLC program to receive countervalues.

• Preconditions

To be able to receive counter values from a source station, please make sure that the informationobjects are parameterised in the source station and that they are in-service.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 32

2.2.5. GET_MV_REAL - Get Floating-Point Measured Value

Figure 25: GET_MV_REAL

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressrVALUE OUT REAL Floating-point value

(IEEE)COT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in monitoring direction.byQUAL OUT BYTE Information object quali-

tyxIV OUT BOOL Invalid Bit IV from information object qualitydtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

xENO OUT BOOL Block enabled (state ofenable)

• Purpose and Polling

Carry out cyclic polling of the corresponding function block in the PLC program to receive floating-point measured values.

• Preconditions

To be able to receive floating-point measured values from a source station, please make sure thatthe information objects are parameterised in the source station and that they are in-service.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 33

2.2.6. GET_MV_NORM - Get Normalised Measured Value

Figure 26: GET_MV_NORM

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressiVALUE OUT INT Normalised valueuiCOT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in monitoring direction.byQUAL OUT BYTE Information object quali-

tyxIV OUT BOOL Invalid Bit IV from information object qualitydtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

xENO OUT BOOL Block enabled (state ofenable)

• Purpose and Polling

Carry out cyclic polling of the corresponding function block in the PLC program to receive normalisedmeasured values.

• Preconditions

To be able to receive normalised measured values from a source station, please make sure that theinformation objects are parameterised in the source station and that they are in-service.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 34

2.2.7. GET_MV_SCALED - Get Scaled Measured Value

Figure 27: GET_MV_SCALED

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressiVALUE OUT INT Scaled valueuiCOT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in monitoring direction.byQUAL OUT BYTE Information object quali-

tyxIV OUT BOOL Invalid Bit IV from information object qualitydtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

xENO OUT BOOL Block enabled (state ofenable)

• Purpose and Polling

Carry out cyclic polling of the corresponding function block in the PLC program to receive scaledmeasured values.

• Preconditions

To be able to receive scaled measured values from a source station, please make sure that theinformation objects are parameterised in the source station and that they are in-service.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 35

2.3. Reception of Data in Command Direction

2.3.1. GET_SC - Get Single Command

Figure 28: GET_SC

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxCONF IN BOOL Confirmation <0>:= accepted (default value): Block

outputs are updated, the single per-sistent command is taken over andacknowledged "positive".

<1>:= not accepted: Block outputs arenot updated, the single persistentcommand is not taken over and is ac-knowledged "negative".

xTERMP IN BOOL positive termination <0>:= no termination

<1>:= Evaluation during next pollingof function block, single-pulse com-mand is terminated "positive"

xTERMN IN BOOL negative termination <0>:= no termination

<1>:= Evaluation during next pollingof function block, single-pulse com-mand is terminated "negative"

xON OUT BOOL Status Single command state, Bit 0 (SCS) inSCO

uiCOT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC60870-5-101 in command direction.

usiQOC OUT USINT Qualifier of Command When receiving commands from thecontrol centre, QOC equalises thequalifier of command in SCO.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 36

Parameter Type

Data type Short Description Explanation

xUPDATE OUT BOOL Update qualifier <0>:= no new single persistent com-mand is pending or single persistentcommand is not parameterised

<1>:= new single persistent commandis pending

xUPDATE is pending only for one cy-cle!

xIV OUT BOOL Invalid Error during reception of commanddtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

xENO OUT BOOL Block enabled (state ofenable)

• Purpose and Polling

Carry out cyclic polling of this function block in the PLC program to receive single persistent com-mands from the control centre.

• Preconditions

To be able to receive single persistent commands from the control centre, please make sure that theaddressed information objects are parameterised and that they are in-service.

NoteIf a reset takes place during a persistent command, the command is interrupted becausethe information objects of the process image are reset to their initial value. Therefore pulsecommands are to be preferred.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 37

2.3.2. GET_DC - Double Command

Figure 29: GET_DC

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxCONF IN BOOL Confirmation <0>:= accepted (default value): Block

outputs are updated, the double com-mand is taken over and acknowl-edged "positive".

<1>:= not accepted: Block outputs arenot updated, the double command isnot taken over and is acknowledged"negative".

xTERMP IN BOOL positive termination <0>:= no termination

<1>:= Evaluation during next pollingof function block, double command isterminated "positive"

xTERMN IN BOOL negative termination <0>:= no termination

<1>:= Evaluation during next pollingof function block, double command isterminated "negative"

xOFF OUT BOOL Status Double command status 0 (DCS) inDCO

xON OUT BOOL Status Double command status 1 (DCS) inDCO

uiCOT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC60870-5-101 in command direction.

usiQOC OUT USINT Qualifier of Command When receiving commands from thecontrol centre, QOC equalises thequalifier of command in DCO.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 38

Parameter Type

Data type Short Description Explanation

xUPDATE OUT BOOL Update qualifier <0>:= no new double command ispending or double command is notparameterised

<1>:= new double command is pend-ing

xUPDATE is pending only for one cy-cle!

xIV OUT BOOL Invalid Error during reception of commanddtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

xENO OUT BOOL Block enabled (state ofenable)

• Purpose and Polling

Carry out cyclic polling of this function block in the PLC program to receive double commands fromthe control centre.

• Preconditions

To be able to receive double commands from the control centre, please make sure that the addressedinformation objects are parameterised and that they are in-service.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 39

2.3.3. GET_RSC - Get Regulating-Step Command

Figure 30: GET_RSC

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxCONF IN BOOL Confirmation <0>:= accepted (default value): Block

outputs are updated, the regulating-step command is taken over and ac-knowledged "positive".

<1>:= not accepted: Block outputs arenot updated, the regulating-step com-mand is not taken over and is ac-knowledged "negative".

xTERMP IN BOOL positive termination <0>:= no termination

<1>:= Evaluation during next pollingof function block, regulating-step com-mand is terminated "positive"

xTERMN IN BOOL negative termination <0>:= no termination

<1>:= Evaluation during next pollingof function block, regulating-step com-mand is terminated "negative"

xLOWER OUT BOOL Regulating-step com-mand status: Low (StepLow)

xHIGHER OUT BOOL Regulating-step com-mand status: High (StepHigh)

uiCOT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC60870-5-101 in command direction.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 40

Parameter Type

Data type Short Description Explanation

usiQOC OUT USINT Qualifier of Command When receiving commands from thecontrol centre, QOC equalises thequalifier of command in DCO.

xUPDATE OUT BOOL Update qualifier <0>:= no new regulating-step com-mand is pending or regulating-stepcommand is not parameterised

<1>:= new regulating-step commandis pending

xUPDATE is pending only for one cy-cle!

xIV OUT BOOL Invalid Error during reception of commanddtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

xENO OUT BOOL Block enabled (state ofenable)

• Purpose and Polling

Carry out cyclic polling of this function block in the PLC program to receive regulating-step commandsfrom the control centre.

• Preconditions

To be able to receive regulating-step commands from the control centre, please make sure that theaddressed information objects are parameterised and that they are in-service.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 41

2.3.4. GET_SPC_REAL - Get Floating-Point Setpoint

Figure 31: GET_SPC_REAL

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxCONF IN BOOL Confirmation <0>:= accepted (default value): Block

outputs are updated, the floating-pointsetpoint is taken over and acknowl-edged "positive".

<1>:= not accepted: Block outputs arenot updated, the floating-point set-point is not taken over and is acknowl-edged "negative".

rVALUE OUT REAL Floating-point value(IEEE)

uiCOT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC60870-5-101 in command direction.

usiQOS OUT USINT Setpoint qualifier (Quali-fier of set-point com-mand)

xUPDATE OUT BOOL Update qualifier <0>:= no new floating-point setpoint ispending or floating-point setpoint isnot parameterised

<1>:= new floating-point setpoint ispending

xUPDATE is pending only for one cy-cle!

xIV OUT BOOL Invalid Error during reception of commanddtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 42

Parameter Type

Data type Short Description Explanation

xENO OUT BOOL Block enabled (state ofenable)

• Purpose and Polling

Carry out cyclic polling of this function block in the PLC program to receive floating-point setpointsfrom the control centre.

• Preconditions

To be able to receive floating-point setpoints from the control centre, please make sure that theaddressed information objects are parameterised and that they are in-service.

NoteDuring a system reset, the information object of the process image are reset to their initialvalues and the setpoints received in the command direction are deleted accordingly. There-fore, setpoint variables must be declared in the global persistent variable list. To ensure thatreceived floating-point setpoints are invariably transmitted to persistent variables, the func-tion block GET_SPC_REAL_PERSISTENT was developed.

Figure 32: GET_SPC_REAL_PERSISTENT

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxCONF IN BOOL Confirmation <0>:= accepted (default value): Block

outputs are updated, the single per-sistent command is taken over andacknowledged "positive".

<1>:= not accepted: Block outputs arenot updated, the floating-point set-point is not taken over and is acknowl-edged "negative".

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 43

Parameter Type

Data type Short Description Explanation

rVALUE IN_OUT

REAL Floating-point value(IEEE)

must be connected to persistent vari-able

uiCOT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC60870-5-101 in command direction.

usiQOS OUT USINT Setpoint qualifier (Quali-fier of set-point com-mand)

xUPDATE OUT BOOL Update qualifier <0>:= no new single persistent com-mand is pending or single persistentcommand is not parameterised

<1>:= new single persistent commandis pending

xUPDATE is pending only for one cy-cle!

xIV OUT BOOL Invalid Error during reception of commanddtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

xENO OUT BOOL Block enabled (state ofenable)

• Description

GET_SPC_REAL_PERSISTENT receives a floating-point setpoint in the command direction via theGET_SPC_REAL block. Each time the xUPDATE output is set, this setpoint is written into the variablethat is connected to the IN_OUT variable rVALUE. This variable must be declared as persistentvariable so that the setpoint is available even after a reset.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 44

2.3.5. GET_SPC_NORM - Get Normalised Setpoint

Figure 33: GET_SPC_NORM

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxCONF IN BOOL Confirmation <0>:= accepted (default value): Block

outputs are updated, the setpoint istaken over and acknowledged "posi-tive".

<1>:= not accepted: Block outputs arenot updated, the setpoint is not takenover and is acknowledged "negative".

iVALUE OUT INT Normalised valueuiCOT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in command direction.usiQOS OUT USINT Setpoint qualifier (Quali-

fier of set-point com-mand)

xUPDATE OUT BOOL Update qualifier <0>:= no new single persistent com-mand is pending or single persistentcommand is not parameterised

<1>:= new single persistent commandis pending

xUPDATE is pending only for one cy-cle!

xIV OUT BOOL Invalid Error during reception of commanddtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

xENO OUT BOOL Block enabled (state ofenable)

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 45

• Purpose and Polling

Carry out cyclic polling of this function block in the PLC program to receive normalised setpoints fromthe control centre.

• Preconditions

To be able to receive setpoints from the control centre, please make sure that the addressed infor-mation objects are parameterised and that they are in-service.

NoteDuring a system reset, the information object of the process image are reset to their initialvalues and the normalised setpoints received in the command direction are deleted ac-cordingly. Therefore, setpoint variables must be declared in the global persistent variablelist. To ensure that received setpoints are invariably transmitted to persistent variables, thefunction block GET_SPC_NORM_PERSISTENT was developed.

Figure 34: GET_SPC_NORM_PERSISTENT

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxCONF IN BOOL Confirmation <0>:= accepted (default value): Block

outputs are updated, the setpoint istaken over and acknowledged "posi-tive".

<1>:= not accepted: Block outputs arenot updated, the setpoint is not takenover and is acknowledged "negative".

iVALUE IN_OUT

INT normalised value must be connected to persistent vari-able

uiCOT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC60870-5-101 in command direction.

usiQOS OUT USINT Setpoint qualifier (Quali-fier of set-point com-mand)

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 46

Parameter Type

Data type Short Description Explanation

xUPDATE OUT BOOL Update qualifier <0>:= no new single persistent com-mand is pending or single persistentcommand is not parameterised

<1>:= new single persistent commandis pending

xUPDATE is pending only for one cy-cle!

xIV OUT BOOL Invalid Error during reception of commanddtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

xENO OUT BOOL Block enabled (state ofenable)

• Description

GET_SPC_REAL_PERSISTENT receives a normalised setpoint in the command direction via theGET_SPC_NORM block. Each time the xUPDATE output is set, this setpoint is written into the var-iable that is connected to the IN_OUT variable iVALUE. This variable must be declared as persistentvariable so that the setpoint is available even after a reset.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 47

2.3.6. GET_SPC_SCALED - Get Scaled Setpoint

Figure 35: GET_SPC_SCALED

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxCONF IN BOOL Confirmation <0>:= accepted (default value): Block

outputs are updated, the setpoint istaken over and acknowledged "posi-tive".

<1>:= not accepted: Block outputs arenot updated, the setpoint is not takenover and is acknowledged "negative".

iVALUE OUT INT Scaled valueuiCOT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in command direction.usiQOS OUT USINT Setpoint qualifier (Quali-

fier of set-point com-mand)

xUPDATE OUT BOOL Update qualifier <0>:= no new single persistent com-mand is pending or single persistentcommand is not parameterised

<1>:= new single persistent commandis pending

xUPDATE is pending only for one cy-cle!

xIV OUT BOOL Invalid Error during reception of commanddtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

xENO OUT BOOL Block enabled (state ofenable)

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 48

• Purpose and Polling

Carry out cyclic polling of this function block in the PLC program to receive scaled setpoints from thecontrol centre.

• Preconditions

To be able to receive setpoints from the control centre, please make sure that the addressed infor-mation objects are parameterised and that they are in-service.

NoteDuring a system reset, the information object of the process image are reset to their initialvalues and the scaled setpoints received in the command direction are deleted accordingly.Therefore, setpoint variables must be declared in the global persistent variable list. To en-sure that received setpoints are invariably transmitted to persistent variables, the functionblock GET_SPC_SCALED_PERSISTENT was developed.

Figure 36: GET_SPC_SCALED_PERSISTENT

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxCONF IN BOOL Confirmation <0>:= accepted (default value): Block

outputs are updated, the setpoint istaken over and acknowledged "posi-tive".

<1>:= not accepted: Block outputs arenot updated, the setpoint is not takenover and is acknowledged "negative".

iVALUE IN_OUT

INT scaled value must be connected to persistent vari-able

uiCOT OUT UINT Cause of Transmission Cause of Transmission acc. to IEC60870-5-101 in command direction.

usiQOS OUT USINT Setpoint qualifier (Quali-fier of set-point com-mand)

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 49

Parameter Type

Data type Short Description Explanation

xUPDATE OUT BOOL Update qualifier <0>:= no new single persistent com-mand is pending or single persistentcommand is not parameterised

<1>:= new single persistent commandis pending

xUPDATE is pending only for one cy-cle!

xIV OUT BOOL Invalid Error during reception of commanddtDATETIME OUT DATE_AND_T

IMEDate and time Time stamp acc. to IEC 60870-5 in

format acc. to IEC 61131-3(DATE_AND_TIME)

xENO OUT BOOL Block enabled (state ofenable)

• Description

GET_SPC_SCALED_PERSISTENT receives a scaled setpoint in the command direction via theGET_SPC_SCALED block. Each time the xUPDATE output is set, this setpoint is written into thevariable that is connected to the IN_OUT variable iVALUE. This variable must be declared as per-sistent variable so that the setpoint is available even after a reset.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 50

2.4. Transmission of Data in Monitoring Direction

2.4.1. SET_SPI - Send Single-Point Information

Figure 37: SET_SPI

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable xEN determines whether transmis-sion shall be suppressed or startedagain. Status is transmitted to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxON IN BOOL Single-point signal sta-

tus 0 (SPI) in SIQuiCOT IN UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in monitoring direction.

Default = 3 (spontaneous transmis-sion)

usiQUAL IN USINT Quality (QDS) in SIQsiTIMETAG IN SINT Time tag <0>:= Object is sent without time tag

<1>:= Object is sent with 3- or 7-octettime tag. This depends on the param-eterisation of the device's IEC profilevia ACOS ET.

Default = 1xENO OUT BOOL Block enabled (state of

enable)<0>:= no evaluation, no transmission

<1>:= evaluation is active, i.e.changes of status, of the cause oftransmission and of the qualifier ofcommand are evaluated.

In the event of an xEN status changefrom 0 to 1 (positive edge) the samestatus is transmitted again

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 51

• Purpose and Polling

Carry out cyclic polling of the corresponding function block in the PLC program to send single-pointsignals.

• Preconditions

To be able to send single-point signals to a target station, please make sure that the informationobjects are parameterised in the target station and that they are in-service.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 52

2.4.2. SET_DPI - Send Double-Point Information

Figure 38: SET_DPI

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable xEN determines whether transmis-sion shall be suppressed or startedagain. Status is transmitted to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxOFF OUT BOOL Double-point information

status 0 (DPI) in DIQxON OUT BOOL Double-point information

status 1 (DPI) in DIQuiCOT IN UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in monitoring direction.

Default = 3 (spontaneous transmis-sion)

usiQUAL IN USINT Quality (QDS) in SIQsiTIMETAG IN SINT Time tag <0>:= Object is sent without time tag

<1>:= Object is sent with 3- or 7-octettime tag. This depends on the param-eterisation of the device's IEC profilevia ACOS ET.

Default = 1xENO OUT BOOL Block enabled (state of

enable)<0>:= no evaluation, no transmission

<1>:= evaluation is active, i.e.changes of status, of the cause oftransmission and of the qualifier ofcommand are evaluated.

In the event of an xEN status changefrom 0 to 1 (positive edge) the samestatus is transmitted again

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 53

• Purpose and Polling

Carry out cyclic polling of the function block in the PLC program in order to send a double-pointinformation signal generated by the PLC program to the control centre.

• Preconditions

To be able to send double-point information generated by the PLC program, please make sure thatthe addressed information objects are parameterised and that they are in-service.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 54

2.4.3. SET_RSPI - Send Regulating-Step Position Information

Figure 39: SET_RSPI

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable xEN determines whether transmis-sion shall be suppressed or startedagain. Status is transmitted to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressusiVALUE IN USINT Regulating-step position

information (Value withtransient state indication(VTI))

uiCOT IN UINT Cause of Transmission Cause of Transmission acc. to IEC60870-5-101 in monitoring direction.

Default = 3 (spontaneous transmis-sion)

usiQUAL IN USINT Quality (QDS) in SIQsiTIMETAG IN SINT Time tag <0>:= Object is sent without time tag

<1>:= Object is sent with 3- or 7-octettime tag. This depends on the param-eterisation of the device's IEC profilevia ACOS ET.

Default = 1xENO OUT BOOL Block enabled (state of

enable)<0>:= no evaluation, no transmission

<1>:= evaluation is active, i.e.changes of status, of the cause oftransmission and of the qualifier ofcommand are evaluated.

In the event of an xEN status changefrom 0 to 1 (positive edge) the samestatus is transmitted again

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 55

• Purpose and Polling

Carry out cyclic polling of the function block in the PLC program in order to send a regulating-stepposition information generated by the PLC program to the control centre.

• Preconditions

To be able to regulating-step position information generated by the PLC program, please make surethat the addressed information objects are parameterised and that they are in-service.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 56

2.4.4. SET_IT - Send Counter Value

Figure 40: SET_IT

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressudiVALUE IN UDINT Counter value in binary

counter reading (BCR)uiCOT IN UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in monitoring direction.

Default = 3 (spontaneous transmis-sion)

tCYCLE IN TIME Time pattern for trans-mission of counter val-ues

cyclic transmission of counter value -cycle time is an integer multiple of 1minute

xCA IN BOOL Counter adjustment Counter adjustment status in BCR (bi-nary counting)

xIV IN BOOL Invalid "Invalid" qualifiersiTIMETAG IN SINT Time tag <0>:= Object is sent without time tag

<1>:= Object is sent with 3- or 7-octettime tag. This depends on the param-eterisation of the device's IEC profilevia ACOS ET.

Default = 1usiSQ OUT USINT Sequence number Sequence number in BCR (binary

counting)xCY OUT BOOL Carry status in BCRxENO OUT BOOL Block enabled (state of

enable)

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 57

• Purpose and Polling

Carry out cyclic polling of the function block in the PLC program in order to send a counter valuegenerated by the PLC program to the control centre.

• Preconditions

To be able to send counter values generated by the PLC program, please make sure that the ad-dressed information objects are parameterised and that they are in-service.

• Description

Transmission of counter values takes place at 60-sec. intervals (default). The sequence number isgenerated automatically.

For setting the time pattern, you can only choose integer multiples of 1 minute.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 58

2.4.5. SET_MV_REAL - Send Measured Value

Figure 41: SET_MV_REAL

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable xEN determines whether transmis-sion shall be suppressed or startedagain. Status is transmitted to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressrVALUE IN REAL Floating-point value

(IEEE)

uiCOT IN UINT Cause of Transmission Cause of Transmission acc. to IEC60870-5-101 in monitoring direction.

Default = 3 (spontaneous transmis-sion)

usiQUAL IN USINT IEC quality of the infor-mation object

siTIMETAG IN SINT Time tag <0>:= Object is sent without time tag

<1>:= Object is sent with 3- or 7-octettime tag. This depends on the param-eterisation of the device's IEC profilevia ACOS ET.

Default = 1xENO OUT BOOL Block enabled (state of

enable)<0>:= no evaluation, no transmission

<1>:= evaluation is active, i.e.changes of measured value's statusand of the IEC quality are evaluated.

• Purpose and Polling

Carry out cyclic polling of the function block in the PLC program in order to send a normalised, scaledor floating-point measured value generated by the PLC program to the control centre.

• Preconditions

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 59

To be able to send measured values generated by the PLC program, please make sure that theaddressed information objects are parameterised and that they are in-service.

• Description

Evaluation of function block parameters only takes place if the input parameter for evaluation (xEN= 1) is set.

xEN = 1 with status change from 0 to1 (positive edge). If there is a positive edge, the status of themeasured value MV with IEC quality QUAL and cause of transmission COT is sent to the controlcentre as IEC telegram without further examination.

xEN = 1 without status change. If there is no status change, the appropriate IEC telegram will besent automatically to the control centre upon every status change of a measured value MV and itsIEC quality QUAL. The generated IEC telegram bears the time tag from the time at which the functionblock was polled.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 60

2.4.6. SET_MV_NORM - Send Normalised Measured Value

Figure 42: SET_MV_NORM

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable xEN determines whether transmis-sion shall be suppressed or startedagain. Status is transmitted to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressiVALUE IN INT Normalised value uiCOT IN UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in monitoring direction.

Default = 3 (spontaneous transmis-sion)

usiQUAL IN USINT IEC quality of the infor-mation object

siTIMETAG IN SINT Time tag <0>:= Object is sent without time tag

<1>:= Object is sent with 3- or 7-octettime tag. This depends on the param-eterisation of the device's IEC profilevia ACOS ET.

Default = 1xENO OUT BOOL Block enabled (state of

enable)<0>:= no evaluation, no transmission

<1>:= evaluation is active, i.e.changes of measured value's statusand of the IEC quality are evaluated.

• Purpose and Polling

Carry out cyclic polling of the function block in the PLC program in order to send a normalised, scaledor floating-point measured value generated by the PLC program to the control centre.

• Preconditions

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 61

To be able to send measured values generated by the PLC program, please make sure that theaddressed information objects are parameterised and that they are in-service.

• Description

Evaluation of function block parameters only takes place if the input parameter for evaluation (xEN= 1) is set.

xEN = 1 with status change from 0 to1 (positive edge). If there is a positive edge, the status of themeasured value MV with IEC quality QUAL and cause of transmission COT is sent to the controlcentre as IEC telegram without further examination.

xEN = 1 without status change. If there is no status change, the appropriate IEC telegram will besent automatically to the control centre upon every status change of a measured value MV and itsIEC quality QUAL. The generated IEC telegram bears the time tag from the time at which the functionblock was polled.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 62

2.4.7. SET_MV_SCALED - Send Scaled Measured Value

Figure 43: SET_MV_SCALED

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable xEN determines whether transmis-sion shall be suppressed or startedagain. Status is transmitted to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressiVALUE IN INT Scaled value uiCOT IN UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in monitoring direction.

Default = 3 (spontaneous transmis-sion)

usiQUAL IN USINT IEC quality of the infor-mation object

siTIMETAG IN SINT Time tag <0>:= Object is sent without time tag

<1>:= Object is sent with 3- or 7-octettime tag. This depends on the param-eterisation of the device's IEC profilevia ACOS ET.

Default = 1xENO OUT BOOL Block enabled (state of

enable)<0>:= no evaluation, no transmission

<1>:= evaluation is active, i.e.changes of measured value's statusand of the IEC quality are evaluated.

• Purpose and Polling

Carry out cyclic polling of the function block in the PLC program in order to send a normalised, scaledor floating-point measured value generated by the PLC program to the control centre.

• Preconditions

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 63

To be able to send measured values generated by the PLC program, please make sure that theaddressed information objects are parameterised and that they are in-service.

• Description

Evaluation of function block parameters only takes place if the input parameter for evaluation (xEN= 1) is set.

xEN = 1 with status change from 0 to1 (positive edge). If there is a positive edge, the status of themeasured value MV with IEC quality QUAL and cause of transmission COT is sent to the controlcentre as IEC telegram without further examination.

xEN = 1 without status change. If there is no status change, the appropriate IEC telegram will besent automatically to the control centre upon every status change of a measured value MV and itsIEC quality QUAL. The generated IEC telegram bears the time tag from the time at which the functionblock was polled.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 64

2.5. Transmission of Data in Command Direction

2.5.1. SET_SC - Send Single Command

Figure 44: SET_SC

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable xEN determines whether transmis-sion shall be suppressed or startedagain. Status is transmitted to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxON IN BOOL Single command status

0 (SCS) in SCOuiCOT IN UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in command direction.

Default = 6 (activation)usiQOC IN USINT Qualifier of Command <1> := short command excecution

time, excexution time is set through asystem parameter in the RTU

<2> := long command excecutiontime, excexution time is set through asystem parameter in the RTU

<3> := Persistent command (Default)tTIMEOUT IN TIME Timeout Here, the maximum time span for

transmission can be set - if transmis-sion is not finished before the end ofthis interval, the process is terminatedwith a fault signal.

Default: TIME#30s0mssiTIMETAG IN SINT Time tag <0>:= Object is sent without time tag

<1>:= Object is sent with 7-octet timetag.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 65

Parameter Type

Data type Short Description Explanation

Default = 1uiRES OUT UINT Acknowledgement byte

(result)indicates the status of the transmittedtelegram

xENO OUT BOOL Block enabled (state ofenable)

<0>:= no evaluation, no transmission

<1>:= evaluation is active, i.e.changes of status, of the cause oftransmission and of the qualifier ofcommand are evaluated.

In the event of an xEN status changefrom 0 to 1 (positive edge) the samestatus is transmitted again

• Purpose and Polling

Carry out cyclic polling of the corresponding function block in the PLC program to send single per-sistent commands.

• Preconditions

To be able to send single persistent commands to a target station, please make sure that the infor-mation objects are parameterised in the target station and that they are in-service.

• Description

A time element monitors the arrival of the acknowledgement from the target station:

1. 0x07: positive acknowledgement or

2. 0x47: negative acknowledgement.

The acknowledgement byte (RES) has the following structure:

Bit 0 :=16#1

<1>:= Telegram was generated and sent to target station; it remains active until apositive/negative acknowledgement has been received or until the monitoring time isover.

Bit 1 :=16#2

<1>:= Acknowledgement of the activation from the target station is positive; it re-mains active until a new command is activated or until the function block is blocked forthe new output – xEN = 0

Bit 2 :=16#4

<1>:= Acknowledgement of the activation from the target station is negative; it re-mains active until a new command is activated or until the function block is blocked forthe new output – xEN = 0

Bit 3 :=16#8

<1>:= Termination of the activation from the target station is positive; it remains activeuntil a new command is activated or until the function block is blocked for the newoutput – xEN = 0

Bit 4 :=16#10

<1>:= Termination of the activation from the target station is negative; it remainsactive until a new command is activated or until the function block is blocked for thenew output – xEN = 0

Bit 5 :=16#20

<1>:= Time-out of the acknowledgement of the activation is over; it remains activeuntil a new command is activated or until the function block is blocked for the newoutput – xEN = 0

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 66

Bit 6 unassigned

Bit 7 unassigned

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 67

2.5.2. SET_DC - Send Double Command

Figure 45: SET_DC

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable xEN determines whether transmis-sion shall be suppressed or startedagain. Status is transmitted to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxOFF OUT BOOL Double command status

0 (DCS) in DCOxON OUT BOOL Double-point information

status 1 (DCS) in DCOuiCOT IN UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in command direction.

Default = 6 (activation)usiQOC IN USINT Qualifier of Command <1> := short command excecution

time, excexution time is set through asystem parameter in the RTU

<2> := long command excecutiontime, excexution time is set through asystem parameter in the RTU

<3> := Persistent command (Default)tTIMEOUT IN TIME Timeout Here, the maximum time span for

transmission can be set - if transmis-sion is not finished before the end ofthis interval, the process is terminatedwith a fault signal.

Default: TIME#30s0mssiTIMETAG IN SINT Time tag <0>:= Object is sent without time tag

<1>:= Object is sent with 7-octet timetag.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 68

Parameter Type

Data type Short Description Explanation

Default = 1uiRES OUT UINT Acknowledgement byte

(result)indicates the status of the transmittedtelegram

xENO OUT BOOL Block enabled (state ofenable)

<0>:= no evaluation, no transmission

<1>:= evaluation is active, i.e.changes of status, of the cause oftransmission and of the qualifier ofcommand are evaluated.

In the event of an xEN status changefrom 0 to 1 (positive edge) the samestatus is transmitted again

• Purpose and Polling

Carry out cyclic polling of the corresponding function block in the PLC program to send double com-mands.

• Preconditions

To be able to send double commands to a target station, please make sure that the informationobjects are parameterised in the target station and that they are in-service.

• Description

A time element monitors the arrival of the acknowledgement from the target station:

1. 0x07: positive acknowledgement or

2. 0x47: negative acknowledgement.

The acknowledgement byte (RES) has the following structure:

Bit 0 :=16#1

<1>:= Telegram was generated and sent to target station; it remains active until apositive/negative acknowledgement has been received or until the monitoring time isover.

Bit 1 :=16#2

<1>:= Acknowledgement of the activation from the target station is positive; it re-mains active until a new command is activated or until the function block is blocked forthe new output – xEN = 0

Bit 2 :=16#4

<1>:= Acknowledgement of the activation from the target station is negative; it re-mains active until a new command is activated or until the function block is blocked forthe new output – xEN = 0

Bit 3 :=16#8

<1>:= Termination of the activation from the target station is positive; it remains activeuntil a new command is activated or until the function block is blocked for the newoutput – xEN = 0

Bit 4 :=16#10

<1>:= Termination of the activation from the target station is negative; it remainsactive until a new command is activated or until the function block is blocked for thenew output – xEN = 0

Bit 5 :=16#20

<1>:= Time-out of the acknowledgement of the activation is over; it remains activeuntil a new command is activated or until the function block is blocked for the newoutput – xEN = 0

Bit 6 unassignedBit 7 unassigned

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 69

2.5.3. SET_RSC - Send Regulating-Step Command

Figure 46: SET_RSC

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable xEN determines whether transmis-sion shall be suppressed or startedagain. Status is transmitted to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressxLOWER IN BOOL Regulating-step com-

mand status: Low (StepLow)

Regulating step command state 0(RCS) in RCO

xHIGHER IN BOOL Regulating-step com-mand status: High (StepHigh)

Regulating step command state 1(RCS) in RCO

uiCOT IN UINT Cause of Transmission Cause of Transmission acc. to IEC60870-5-101 in command direction.

Default = 6 (activation)usiQOC IN USINT Qualifier of Command <1> := short command excecution

time, excexution time is set through asystem parameter in the RTU

<2> := long command excecutiontime, excexution time is set through asystem parameter in the RTU

<3> := Persistent command (Default)tTIMEOUT IN TIME Timeout Here, the maximum time span for

transmission can be set - if transmis-sion is not finished before the end ofthis interval, the process is terminatedwith a fault signal.

Default: TIME#30s0mssiTIMETAG IN SINT Time tag <0>:= Object is sent without time tag

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 70

Parameter Type

Data type Short Description Explanation

<1>:= Object is sent with 7-octet timetag.

Default = 1uiRES OUT UINT Acknowledgement byte

(result)indicates the status of the transmittedtelegram

xENO OUT BOOL Block enabled (state ofenable)

<0>:= no evaluation, no transmission

<1>:= evaluation is active, i.e.changes of status, of the cause oftransmission and of the qualifier ofcommand are evaluated.

In the event of an xEN status changefrom 0 to 1 (positive edge) the samestatus is transmitted again

• Purpose and Polling

Carry out cyclic polling of the corresponding function block in the PLC program to send regulating-step commands.

• Preconditions

To be able to send regulating-step commands to a target station, please make sure that the infor-mation objects are parameterised in the target station and that they are in-service.

• Description

A time element monitors the arrival of the acknowledgement from the target station:

1. 0x07: positive acknowledgement or

2. 0x47: negative acknowledgement.

The acknowledgement byte (RES) has the following structure:

Bit 0 :=16#1

<1>:= Telegram was generated and sent to target station; it remains active until apositive/negative acknowledgement has been received or until the monitoring time isover.

Bit 1 :=16#2

<1>:= Acknowledgement of the activation from the target station is positive; it re-mains active until a new command is activated or until the function block is blocked forthe new output – xEN = 0

Bit 2 :=16#4

<1>:= Acknowledgement of the activation from the target station is negative; it re-mains active until a new command is activated or until the function block is blocked forthe new output – xEN = 0

Bit 3 :=16#8

<1>:= Termination of the activation from the target station is positive; it remains activeuntil a new command is activated or until the function block is blocked for the newoutput – xEN = 0

Bit 4 :=16#10

<1>:= Termination of the activation from the target station is negative; it remainsactive until a new command is activated or until the function block is blocked for thenew output – xEN = 0

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 71

Bit 5 :=16#20

<1>:= Time-out of the acknowledgement of the activation is over; it remains activeuntil a new command is activated or until the function block is blocked for the newoutput – xEN = 0

Bit 6 unassignedBit 7 unassigned

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 72

2.5.4. SET_SPC_REAL - Send Setpoint

Figure 47: SET_SPC_REAL

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable xEN determines whether transmis-sion shall be suppressed or startedagain. Status is transmitted to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressrVALUE IN REAL Floating-point value

(IEEE)uiCOT IN UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in command direction.

Default = 6 (activation)usiQOS IN USINT Qualifier of set-point

commandtTIMEOUT IN TIME Timeout Here, the maximum time span for

transmission can be set - if transmis-sion is not finished before the end ofthis interval, the process is terminatedwith a fault signal.

Default: TIME#30s0mssiTIMETAG IN SINT Time tag <0>:= Object is sent without time tag

<1>:= Object is sent with 7-octet timetag.

Default = 1uiRES OUT UINT Acknowledgement byte

(result)indicates the status of the transmittedtelegram

xENO OUT BOOL Block enabled (state ofenable)

<0>:= no evaluation, no transmission

<1>:= evaluation is active, i.e.changes of setpoint 's status and ofthe IEC quality are evaluated.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 73

• Purpose and Polling

Carry out cyclic polling of the corresponding function block in the PLC program to send setpoints.

• Preconditions

To be able to send setpoints to a target station, please make sure that the information objects areparameterised in the target station and that they are in-service.

• Description

A time element monitors the arrival of the acknowledgement from the target station:

1. 0x07: positive acknowledgement or

2. 0x47: negative acknowledgement.

The acknowledgement byte (RES) has the following structure:

Bit 0 :=16#1

<1>:= Telegram was generated and sent to target station; it remains active until apositive/negative acknowledgement has been received or until the monitoring time isover.

Bit 1 :=16#2

<1>:= Acknowledgement of the activation from the target station is positive; it re-mains active until a new command is activated or until the function block is blocked forthe new output – xEN = 0

Bit 2 :=16#4

<1>:= Acknowledgement of the activation from the target station is negative; it re-mains active until a new command is activated or until the function block is blocked forthe new output – xEN = 0

Bit 3 :=16#8

<1>:= Termination of the activation from the target station is positive; it remains activeuntil a new command is activated or until the function block is blocked for the newoutput – xEN = 0

Bit 4 :=16#10

<1>:= Termination of the activation from the target station is negative; it remainsactive until a new command is activated or until the function block is blocked for thenew output – xEN = 0

Bit 5 :=16#20

<1>:= Time-out of the acknowledgement of the activation is over; it remains activeuntil a new command is activated or until the function block is blocked for the newoutput – xEN = 0

Bit 6 unassignedBit 7 unassigned

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 74

2.5.5. SET_SPC_NORM- Send Normalised Setpoint

Figure 48: SET_SPC_NORM

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable xEN determines whether transmis-sion shall be suppressed or startedagain. Status is transmitted to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressiVALUE IN INT Normalised valueuiCOT IN UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in command direction.

Default = 6 (activation)usiQOS IN USINT Qualifier of set-point

commandtTIMEOUT IN TIME Timeout Here, the maximum time span for

transmission can be set - if transmis-sion is not finished before the end ofthis interval, the process is terminatedwith a fault signal.

Default: TIME#30s0mssiTIMETAG IN SINT Time tag <0>:= Object is sent without time tag

<1>:= Object is sent with 7-octet timetag.

Default = 1uiRES OUT UINT Acknowledgement byte

(result)indicates the status of the transmittedtelegram

xENO OUT BOOL Block enabled (state ofenable)

<0>:= no evaluation, no transmission

<1>:= evaluation is active, i.e.changes of setpoint's status and of theIEC quality are evaluated.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 75

• Purpose and Polling

Carry out cyclic polling of the corresponding function block in the PLC program to send setpoints.

• Preconditions

To be able to send setpoints to a target station, please make sure that the information objects areparameterised in the target station and that they are in-service.

• Description

A time element monitors the arrival of the acknowledgement from the target station:

1. 0x07: positive acknowledgement or

2. 0x47: negative acknowledgement.

The acknowledgement byte (RES) has the following structure:

Bit 0 :=16#1

<1>:= Telegram was generated and sent to target station; it remains active until apositive/negative acknowledgement has been received or until the monitoring time isover.

Bit 1 :=16#2

<1>:= Acknowledgement of the activation from the target station is positive; it re-mains active until a new command is activated or until the function block is blocked forthe new output – xEN = 0

Bit 2 :=16#4

<1>:= Acknowledgement of the activation from the target station is negative; it re-mains active until a new command is activated or until the function block is blocked forthe new output – xEN = 0

Bit 3 :=16#8

<1>:= Termination of the activation from the target station is positive; it remains activeuntil a new command is activated or until the function block is blocked for the newoutput – xEN = 0

Bit 4 :=16#10

<1>:= Termination of the activation from the target station is negative; it remainsactive until a new command is activated or until the function block is blocked for thenew output – xEN = 0

Bit 5 :=16#20

<1>:= Time-out of the acknowledgement of the activation is over; it remains activeuntil a new command is activated or until the function block is blocked for the newoutput – xEN = 0

Bit 6 unassignedBit 7 unassigned

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 76

2.5.6. SET_SPC_REAL - Send Setpoint

Figure 49: SET_SPC_SCALED

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable xEN determines whether transmis-sion shall be suppressed or startedagain. Status is transmitted to outputparameter xENO.

Default: TRUEuiCAASDU IN UINT Device address (Com-

mon Address of ASDU)udiIOA IN UDINT Information Object Ad-

dressiVALUE IN INT Scaled valueuiCOT IN UINT Cause of Transmission Cause of Transmission acc. to IEC

60870-5-101 in command direction.

Default = 6 (activation)usiQOS IN USINT Qualifier of set-point

commandtTIMEOUT IN TIME Timeout Here, the maximum time span for

transmission can be set - if transmis-sion is not finished before the end ofthis interval, the process is terminatedwith a fault signal.

Default: TIME#30s0mssiTIMETAG IN SINT Time tag <0>:= Object is sent without time tag

<1>:= Object is sent with 7-octet timetag.

Default = 1uiRES OUT UINT Acknowledgement byte

(result)indicates the status of the transmittedtelegram

xENO OUT BOOL Block enabled (state ofenable)

<0>:= no evaluation, no transmission

<1>:= evaluation is active, i.e.changes of setpoint's status and of theIEC quality are evaluated.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 77

• Purpose and Polling

Carry out cyclic polling of the corresponding function block in the PLC program to send setpoints.

• Preconditions

To be able to send setpoints to a target station, please make sure that the information objects areparameterised in the target station and that they are in-service.

• Description

A time element monitors the arrival of the acknowledgement from the target station:

1. 0x07: positive acknowledgement or

2. 0x47: negative acknowledgement.

The acknowledgement byte (RES) has the following structure:

Bit 0 :=16#1

<1>:= Telegram was generated and sent to target station; it remains active until apositive/negative acknowledgement has been received or until the monitoring time isover.

Bit 1 :=16#2

<1>:= Acknowledgement of the activation from the target station is positive; it re-mains active until a new command is activated or until the function block is blocked forthe new output – xEN = 0

Bit 2 :=16#4

<1>:= Acknowledgement of the activation from the target station is negative; it re-mains active until a new command is activated or until the function block is blocked forthe new output – xEN = 0

Bit 3 :=16#8

<1>:= Termination of the activation from the target station is positive; it remains activeuntil a new command is activated or until the function block is blocked for the newoutput – xEN = 0

Bit 4 :=16#10

<1>:= Termination of the activation from the target station is negative; it remainsactive until a new command is activated or until the function block is blocked for thenew output – xEN = 0

Bit 5 :=16#20

<1>:= Time-out of the acknowledgement of the activation is over; it remains activeuntil a new command is activated or until the function block is blocked for the newoutput – xEN = 0

Bit 6 unassignedBit 7 unassigned

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 78

2.6. System Time

2.6.1. GET_SYSTEMTIME02

Figure 50: GET_SYSTEMTIME02

Parameter Type

Data type Short Description Explanation

xEN IN BOOL State of enable Enables block processing, input pa-rameter xEN is transferred to outputparameter xENO.

usiYEAR OUT USINT Year 0...99usiMONTH OUT USINT Month 0...12usiDAY OUT USINT Day 0...31usiHOUR OUT USINT Hour 0...23usiMINUTE OUT USINT Minute 0...59usiSEC OUT USINT Second 0...59usiWEEKDAY OUT USINT Weekday 1 = Monday... 7 = SundayxSU OUT BOOL Summer time 0 = Standard time, 1 = Summer timexIV OUT BOOL Invalid Error during reception of system timexENO OUT BOOL Block enabled (state of

enable)

• Purpose and Polling

Carry out cyclic polling of the corresponding function block in the PLC program to ascertain thesystem time.

IEC 60870-5 Communication Library

IDS GmbH, 10/2010 79