ABB IEC 61131-3 Programming manual

ABB industrial drives
Programming manual
Drive application programming (IEC 61131-3)
Drive application and firmware manuals and guides
Code (English)
Drive (IEC 61131-3) application programming manual
3AUA0000127808
ACS880 primary control program firmware manual Drive composer start-up and maintenance PC tool
user’s manual AC500 Control Builder PS501 Complete English
documentation
3AUA0000085967 3AUA0000094606
3ADR025078M02xx
You can find manuals and other product documents in PDF format on the Internet. See section Document library on the Internet on the inside of the back cover. For manuals not available in the Document library, contact your local ABB representative.
Programming manual
Drive application programming (IEC 61131-3)
3AUA0000127808 Rev C EN EFFECTIVE: 2015-04-03
© 2015 ABB Oy. All Rights Reserved
5
Continuous function chart (CFC) program ..................................................................... 35
Table of contents
List of related manuals ...................................................................................................... 2
Introduction to the manual .............................................................................................. 13
Contents of this chapter ..................................................................................................... 13
Compatibility ....................................................................................................................... 13
Target audience ................................................................................................................. 13
Safety instructions .............................................................................................................. 14
Purpose of the manual ....................................................................................................... 14
Contents of the manual ...................................................................................................... 14
Related documents ............................................................................................................ 14
Terms and abbreviations .................................................................................................... 15
Getting started .................................................................................................................. 17
Contents of this chapter ..................................................................................................... 17
Setting up the programming environment .......................................................................... 17
Overview of drive programming ..................................................................................... 21
Contents of this chapter ..................................................................................................... 21
Drive application programming ........................................................................................... 21
System diagram ................................................................................................................. 22
Programming work cycle .................................................................................................... 23
Special tasks ...................................................................................................................... 23
Programming languages and modules ............................................................................... 24
Libraries.............................................................................................................................. 24
Program execution ............................................................................................................. 24
DriveInterface ..................................................................................................................... 24
ApplicationParametersandEvents ...................................................................................... 25
Creating application program ......................................................................................... 26
Contents of this chapter ..................................................................................................... 26
Creating a new project ....................................................................................................... 27
Updating project information .............................................................................................. 29
Appending a new POU ....................................................................................................... 32
Writing a program code ...................................................................................................... 34
6
Viewing device information ............................................................................................ 57
Upgrading or adding a new device ................................................................................. 59
Changing an existing device .......................................................................................... 60
Viewing software updates .............................................................................................. 61
Adding tasks ................................................................................................................... 68
Monitoring tasks ............................................................................................................. 71
Safe debugging .............................................................................................................. 77
Downloading loading package to a drive ....................................................................... 83
Preparing a project for download ........................................................................................ 43
Establishing online connection to the drive ......................................................................... 43
Downloading the program to the drive ................................................................................ 50
Executing the program ........................................................................................................ 52
Creating a boot project ....................................................................................................... 54
Features ............................................................................................................................. 56
Contents of this chapter ...................................................................................................... 56
Device handling .................................................................................................................. 56
Program organization units (POU) ...................................................................................... 63
Data types ........................................................................................................................... 64
Drive application programming license ............................................................................... 64
Application download options ............................................................................................. 65
Removing the application from the target ........................................................................... 66
Retain variables .................................................................................................................. 67
Task configuration .............................................................................................................. 67
Uploading and downloading source code ........................................................................... 73
Adding symbol configuration ............................................................................................... 75
Debugging and online changes .......................................................................................... 77
Reset options ...................................................................................................................... 78
Memory limits ...................................................................................................................... 79
CPU limitation ..................................................................................................................... 80
Application loading package ............................................................................................... 81
DriveInterface .................................................................................................................... 87
Contents of this chapter ...................................................................................................... 87
Implementing DriveInterface ............................................................................................... 87
Selecting the parameter set ................................................................................................ 89
Viewing parameter mapping report ..................................................................................... 90
7
Mapping example .......................................................................................................... 91
Creating parameter groups .......................................................................................... 103
Creating parameters .................................................................................................... 104
Parameter settings ...................................................................................................... 106
Scaling ......................................................................................................................... 108
Linking parameter to application code ......................................................................... 109
Parameter types .......................................................................................................... 110
Parameter families ....................................................................................................... 113
Selection lists ............................................................................................................... 114
Units ............................................................................................................................ 115
Application events ....................................................................................................... 116
Question: What to do when scan network does not find any drives? .......................... 126
Question: What to do if communication fails while establishing online connection to the
drive? ........................................................................................................................... 127
Question: What to do if communication fails between Automation Builder/Drive composer
pro and drive? .............................................................................................................. 128
Updating drive parameters from installed device ............................................................... 94
Updating drive parameters from parameters file ................................................................ 96
Setting parameter view ....................................................................................................... 98
Application parameter and events ................................................................................ 100
Contents of this chapter ................................................................................................... 100
ApplicationParametersandEvents .................................................................................... 101
ParameterManager .......................................................................................................... 103
Libraries .......................................................................................................................... 117
Contents of this chapter ................................................................................................... 117
Library types ..................................................................................................................... 117
Adding a library to the project ........................................................................................... 118
Creating a new library ...................................................................................................... 121
Installing a new library ...................................................................................................... 123
Managing library versions ................................................................................................ 125
Practical examples and tips .......................................................................................... 126
Contents of this chapter ................................................................................................... 126
Solving communication problems ..................................................................................... 126
Solving other problems ..................................................................................................... 129
8
Question: How to prevent unauthorized access to an application that is running in the
drive? ........................................................................................................................... 129
Question: How to fix an unknown device in a project? ................................................. 129
Question: How to remove a boot application from the flash memory card? ................. 129
Question: What to do when I continuously receive “The project handle 0 is invalid” error
message? ..................................................................................................................... 129
Question: What to do when stack overflow fault 6487 occurs? .................................... 130
Question: How to optimize the memory usage of the drive application? ..................... 130
Question: How to solve the problem causing error message “Creating boot application failed: Adding Application Parameters & Groups to UFF generator :
XmlDeserializationFailed“? .......................................................................................... 130
EVENT ......................................................................................................................... 137
ReadEventLog ............................................................................................................. 138
PAR_UNIT_SEL ........................................................................................................... 140
PAR_SCALE_CHG ...................................................................................................... 141
PAR_LIM_CHG_DINT ................................................................................................. 143
PAR_LIM_CHG_REAL ................................................................................................ 144
PAR_LIM_CHG_UDINT ............................................................................................... 145
PAR_DEF_CHG_DINT ................................................................................................ 146
PAR_DEF_CHG_REAL ............................................................................................... 147
PAR_DEF_CHG_UDINT .............................................................................................. 148
Appendix A: Incompatible features between ACS880 Drive and AC500 PLC IEC
programming ................................................................................................................... 131
Contents of this chapter .................................................................................................... 131
Incompatible features ....................................................................................................... 131
Appendix B: Unsupported features .............................................................................. 133
Appendix C: ABB drives system library ....................................................................... 134
Contents of this chapter .................................................................................................... 134
Introduction to ABB drives system library ......................................................................... 134
Function blocks of the system library ................................................................................ 135
Event function blocks ........................................................................................................ 137
Parameter change function blocks ................................................................................... 140
Parameter limit change ..................................................................................................... 143
Parameter default value change ................................ ....................................................... 146
Parameter decimal display ............................................................................................... 149
9
PAR_DISP_DEC ......................................................................................................... 149
PAR_REFRESH .......................................................................................................... 150
PAR_PROT ................................................................................................................. 151
PAR_GRP_PROT ....................................................................................................... 152
ParReadBit .................................................................................................................. 153
ParRead_DINT ............................................................................................................ 154
ParRead_REAL ........................................................................................................... 155
ParRead_UDINT ......................................................................................................... 156
ParWriteBit .................................................................................................................. 157
ParWrite_DINT ............................................................................................................ 158
ParWrite_REAL ........................................................................................................... 159
ParWrite_UDINT .......................................................................................................... 160
ParRead_BitPTR ......................................................................................................... 161
ParRead_ValPTR_DINT .............................................................................................. 162
ParRead_ValPTR_REAL ............................................................................................. 163
ParRead_ValPTR_UDINT ........................................................................................... 164
ParSet_BitPTR_IEC .................................................................................................... 165
ParSet_ValPTR_IEC_DINT ......................................................................................... 166
ParSet_ValPTR_IEC_REAL ........................................................................................ 167
ParSet_ValPTR_IEC_UDINT ...................................................................................... 168
ParSet_BitPTR_Par ..................................................................................................... 169
ParSet_ValPTR_Par .................................................................................................... 170
UsedTimeLevel ............................................................................................................ 171
Parameter protection ........................................................................................................ 151
Parameter read function blocks ........................................................................................ 153
Parameter write function blocks ....................................................................................... 157
Pointer parameter read function block ............................................................................. 161
Set pointer parameter to IEC variable function blocks ..................................................... 165
Set pointer parameter to parameter function blocks ........................................................ 169
Task time level function block .......................................................................................... 171
Error codes ....................................................................................................................... 172
Appendix D: ABB D2D function blocks ........................................................................ 173
Contents of this chapter ................................................................................................... 173
Introduction to ABB D2D function blocks ......................................................................... 173
D2D function blocks of the system library ........................................................................ 174
10
DS_ReadLocal ............................................................................................................. 175
DS_WriteLocal ............................................................................................................. 176
General ........................................................................................................................ 177
D2D_TRA ..................................................................................................................... 177
D2D_REC .................................................................................................................... 179
D2D_TRA_REC ........................................................................................................... 181
D2D_TRA_MC ............................................................................................................. 183
D2D_Conf .................................................................................................................... 185
D2D_Conf_Token ........................................................................................................ 187
D2D_Master_State ....................................................................................................... 189
Example 1: D2D_TRA / D2D_REC blocks ................................................................... 190
Example 2: Token send configuration blocks ............................................................... 191
BGET ........................................................................................................................... 195
BSET ............................................................................................................................ 196
DEMUX ........................................................................................................................ 197
DEMUXM ..................................................................................................................... 198
MUX ............................................................................................................................. 199
MUXM .......................................................................................................................... 200
PACK ........................................................................................................................... 201
SR_D ............................................................................................................................ 202
SWITCH ................................................................ ....................................................... 203
SWITCHC .................................................................................................................... 204
UNPACK ...................................................................................................................... 205
Data read/write blocks ...................................................................................................... 175
D2D communication blocks .............................................................................................. 177
D2D configuration blocks .................................................................................................. 185
Examples: D2D blocks ................................................................................................ ...... 190
Appendix E: ABB drives standard library .................................................................... 193
Contents of this chapter .................................................................................................... 193
Introduction to ABB drives standard library ...................................................................... 193
Basic functions .................................................................................................................. 195
Special functions ............................................................................................................... 206
11
Drive control ................................................................................................................ 206
Filter ............................................................................................................................. 209
Function generator ...................................................................................................... 211
Integrator ..................................................................................................................... 213
Lead lag ....................................................................................................................... 215
Motor potentiometer .................................................................................................... 217
PID ............................................................................................................................... 219
Ramp ........................................................................................................................... 223
Further information ........................................................................................................ 225
Contact us ....................................................................................................................... 226
12
13
1

Introduction to the manual

Contents of this chapter

This chapter gives basic information on the manual.

Compatibility

This manual applies to the ABB drives equipped with the application programming functionality. For example, ABB ACS880 and DCX880 industrial drives can be ordered with the application programming functionality. The drive must be equipped with N8010 Application programming license on ZMU-02.
This manual is compatible with the following product releases:
ABB Automation Builder 1.1 Drive composer pro 1.5 or later
For more details of compatibility information, refer the corresponding ACS880 or DCX880 drive software release notes or contact your ABB representative.

Target audience

This manual is intended for a personnel performing drive application programming or for understanding the programming environment capabilities. The reader of the manual is expected to have basic knowledge of the drive technology and programmable devices (PLC, drive and PC) and programming methods.
14
WARNING! Ignoring the following instruction can cause physical injury or damage to the equipment.
Do not make changes to drive in the online mode or download programs while the drive is running to avoid damages to the drive.

Safety instructions

Follow all safety instructions delivered with the drive.
Read the complete safety instructions before you load and execute the application program
on the drive or modify the drive parameters. The complete safety instructions are delivered with the drive as either part of the hardware manual, or, in the case of ACS880 multidrives, as a separate document.
Read the firmware function-specific warnings and notes before changing parameter values.
These warnings and notes are included in the parameter descriptions presented in chapter Parameters of the firmware manual.

Purpose of the manual

This manual gives basic instructions on the drive-based application programming using ABB Automation Builder programming tool. The programming tool is the international IEC 61131-3 programming standard. The online help of Automation Builder contains more detailed information of the IEC languages, programming methods, editors and tool commands.

Contents of the manual

The manual consists of the following chapters:
Getting startedOverview of drive programmingCreating application program FeaturesDriveInterface Application parameter and event creation Libraries Practical examples and tips Appendix A: Incompatible features between ACS880 Drive and AC500 PLC IEC
programming
Appendix B: Unsupported features Appendix C: ABB drives system libraryAppendix D: ABB D2D function blocks Appendix E: ABB drives standard library

Related documents

A list of related manuals is printed on the inside of the front cover.
15
Term/ Abbreviation
Description
ACS-AP-x
ACS-AP-I or ACS-AP-S control panel used with ACS880 and DCX880 drives. The control panel has an USB connector enabling a PC tool connection for common architecture drives.
BCU
Type of control unit used in ACS880 and DCX880 drives
AB
ABB Automation Builder programming tool
CFC
Continuous function chart programming language
DI
Digital input
Drive composer pro
ABB Drive composer is a 32-bit Windows application for commissioning and maintaining ABB common architecture drives.
The full version is called Drive composer pro.
DUT
Data type unit
FB
Function block, type of POU
FBD
Function block diagram programming language
FUN
Function, type of POU
IEC 61131-3 programming
Standardized programming language for industrial automation. Established by the International Electro-technical Commission (IEC)
IL
Instruction list programming language
LD
Ladder diagram programming language
OPC server
OPC DA server interface for Drive composer pro that allows other programs, such as Automation Builder, to communicate with the drive.
PIN
IEC variable of the block, which can be connected to other blocks.
PLC
Programmable logic controller
POU
Program organization unit. POU unit is a unit, object or area where you can write the program code. Also called as Block.
PRG
Program, type of POU
RTS
Run-time system
SFC
Sequential function chart programming language
ST
Structured text programming language
ZCU
Type of control unit used in ACS880 and DCX880 drives that consists of a ZCON board built into a plastic housing.
The control unit may be fitted onto the drive/inverter module, or installed separately.

Terms and abbreviations

16
For more detailed descriptions, see Automation Builder online help.
17
2

Getting started

Contents of this chapter

This chapter includes the following information required for programming ACS880 and DCX880 drives using ABB Automation Builder tool:
Quick steps for Setting up the programming environment. Procedure for Upgrading a new device, Changing an existing device and Viewing device
information.

Setting up the programming environment

The following software installations are required for programming ACS880 and DCX880 drives. For details of version, refer the corresponding ACS880 or DCX880 drive software release notes or contact your ABB representative.
ACS880 drive or DCX880 converter with Drive application programming license (N8010) ABB Automation Builder 1.1 ACS-AP-x control panel and micro USB cable Drive composer pro 1.5 or later
The Drive composer pro enables setting and monitoring of the drive parameters and signals. The control panel acts as a USB/RS485 converter between Automation Builder, Drive composer pro and the drive.
18
To setup ACS880 or DCX880 drive programming environment follow the pre-requisites and installation steps listed below.
Pre-requisites:
The ABB Automation Builder supports Windows XP and Windows 7 (32-bit and 64-bit
versions) operating systems.
You must have Administrator user rights to install Automation Builder.
Installation steps:
1. Install Drive composer pro to enable communication with the target drive. For more details, see Drive composer user’s manual (3AUA0000094606 [English]).
2. In the Drive composer pro System info -> Products/Licenses, check that the ACS880 or DCX880 drive has an active IEC programming license and the drive firmware version is correct. For details of version, refer the corresponding ACS880 or DCX880 drive software release notes or contact your ABB representative.
Install ABB Automation Builder version 1.1 according to the instruction guide included in the installation media of Automation Builder. All drive application programming related components are automatically installed as well.
In Automation Builder, select Install Software Packages for -> Programmable Drive.
Figure 1: Automation Builder – Selecting software packages for installation
19
To allow parallel communication with Automation Builder and Drive composer pro, follow these steps:
1. In the main menu of Drive composer pro, click View and then click Settings.
2. In the Settings window, select Share connection with Control Builder Plus check box and click Save.
Figure 2: Drive Composer Pro settings
After configuring the settings, restart Drive composer pro. Drive composer now connects to the drive and allows opening the Automation Builder. Now you can create an application program. See section, Creating application program.
20
21
Note: For using ABB Automation Builder online with the drive, enable the drive application programming license in the target drive. See section, Establishing online connection to the
drive.
3

Overview of drive programming

Contents of this chapter

This chapter provides an overview of ACS880 and DCX880 drive programming environment and a typical work cycle of drive application programming.

Drive application programming

ABB ACS880 and DCX880 industrial drives can be ordered with the application programming functionality. It allows you to add your own program code to the drive using the ABB Automation Builder programming tool (version 1.1). The programming method and languages are based on the IEC 61131-3 programming standard. ABB Automation Builder is also used for configuring and programming the ABB AC500 PLC family devices.
With the drive application programming, you can create application specific features on top of the drive firmware functionality. You can utilize the standard and extension I/O and communication interfaces of the drive along with the appropriate firmware signals. Your program is executed in parallel with the drive control tasks using the same hardware resources.
In addition, you can create your own parameters and events (faults and warnings) that are visible on the ACS-AP-x control panel and in the Drive composer pro/entry commissioning tools.
22

System diagram

The following simplified system diagram shows the application programming environment in the same control unit as the drive firmware.
Figure 3: Application programming environment – System diagram
The following list describes the main components for application programming.
Drive control unit:
Run-time system (RTS) executes the application program. DriveInterface allows input/output mapping between the application program and drive
firmware parameters.
System function library enables access to the drive system services (parameters/ events/
drive-to-drive communication, extension I/O).
User made parameters. User made events (fault, warnings). Drive System info includes version information of the application program. Drive firmware parameters with I/O controls. D2D function blocks enable drive to drive communication, I/O extension modules, and so on
for application programming.
Drive memory unit:
Creates a permanent version of the application program (Boot application). Retains values of the application program variables . Consists of application source code (Note that the size of the memory is limited).
23
Includes symbol and address information of the application program variables for monitoring
purposes.
PC tool programs:
ABB Automation Builder for application program development and online operations. ABB Drive composer pro for drive parameter, signal, event log monitoring and settings. Application program function libraries (for example, ABB standard library). The USB/ACS-AP-x control panel enables communication between the Automation Builder,
Drive composer pro and the drive.

Programming work cycle

The following steps describes a typical work cycle of the drive application programming tasks of performing the module:
1. Creating a new project, adding objects, defining the target and first program module in the Devices tree.
2. Defining the interface to drive firmware parameters (I/O access, drive control) in the DriveInterface object.
3. Defining user parameters and events (ApplicationParametersandEvents) module in the Devices tree.
4. Developing the program structure and coding program units.
5. Defining the program execution task configuration editor.
6. Compiling and loading the code using Build menu.
7. Creating boot applications if new parameters, mappings, events or task configuration are added in the Online menu.
8. Debugging the program code (stepping, forcing variables and breakpoints) in the Online menu.
9. Monitoring program variables in Automation Builder and Drive composer pro from the watch windows of the View menu.
10. Repeating the cycle from step 2 to 8 for testing the program.

Special tasks

The following special tasks are part of the drive application programming tasks:
1. Saving or restoring the source code to the permanent memory of the drive using the Online menu.
2. Saving the drive IEC symbol data to permanent memory of the drive from the Devices tree using the option Add Symbol configuration object to the tree.
3. Naming and versioning the application from the Application properties window or Project information.
4. Removing the application from the target using Reset origin window on the Online menu.
24

Programming languages and modules

The programming environment supports programming languages as specified in the IEC 61131-3 standard with some useful extensions. The following programming languages are supported:
Ladder diagram (LD) Function block diagram (FBD) Structured text (ST) Instruction list (IL) Sequential function chart (SFC) Continuous function chart (CFC), normal and page-oriented CFC editor
A program can be composed of multiple modules like functions, function blocks and programs. Each module can be implemented independently with the above mentioned languages. Each language has its own dedicated editors. For more information of the programming languages, see
Automation Builder online help and chapter Features.

Libraries

Program modules can be implemented in projects or imported into libraries. A library manager is used to install and access the libraries.
The two main types of libraries are:
Local libraries (IEC language source code, for example, AS1LB_Standard_ACS880_V3_5) External libraries (external implementation and source code, for example,
AY1LB_System_ACS880_V3_5)
Local libraries include source code or can be compiled. If the library is compiled, source code is not included in the library.
External libraries include AC500 PLC libraries used with the drive target by opening the library project in Windows as Automation Builder project files (before V3.0).
For more information on compatibility, see chapter Libraries.

Program execution

The program is executed on the same central processing unit (CPU) as the other drive control tasks. In real time applications, programs are typically executed periodically as cyclic tasks. The programmer can define the cyclic task interval. For more information, see chapter Features.

DriveInterface

The DriveInterface object enables input and output mapping between the application program and the drive firmware using the drive firmware parameters used in the application program. This list of parameters may be different for each drive firmware versions. For more details on implementing the DriveInterface and updating parameter list, see section DriveInterface.
25

ApplicationParametersandEvents

The ApplicationParameterandEvents Manager (APEM) object allows creating application parameter groups, parameters, parameter types, parameter families, units and application events for the drive in Automation Builder environment. For more details on how to create parameter related tasks and application events, see section ApplicationParametersandEvents.
26
4

Creating application program

Contents of this chapter

This chapter describes the procedure to create application program. For details of instructions and further development steps see chapters DriveInterface, Application
parameter and event creation, Features and Libraries. For more detailed descriptions, see also the
Automation Builder online help.
27

Creating a new project

After starting ABB Automation Builder programming environment, you can create a new project.
1. In the Start Page, click New Project or in the main menu, click File and then click New Project.
Figure 4: Automation Builder – Create a new project
2. In the New Project dialog box, select ACS880 or DCX880 project and click OK.
Figure 5: Select a project
Note: If required, rename the project in Name field and select the desired Location in the file system.
28
3. In the Standard Project dialog box, select the type of control unit in Device drop-down list.
ACS880_AINF_ZCU12_M_V3_5 for ZCU-xx control unit ACS880_AINF_BCU12_M_V3_5 for BCU-xx control units
Check the control unit type of the target drive either from the unit itself, from the hardware manual of drives or contact your local ABB representative.
4. In the PLC_PRG in drop-down list, select a programming language and click OK. You can later add program modules made with other languages to the project.
Figure 6: Select a programming language
A simple project for an ACS880 target drive is created in the Devices tree.
Figure 7: New project created in the Devices tree
29
The Devices tree includes:
PLC Logic DriveInterface for firmware signal and parameter mapping Application (for example, you can add the following objects under Application)
o Library Manager for installing function libraries o ApplicationParametersandEvents for creating user parameters and events o Program organization units (POUs) o Task Configuration module for defining in which task the POUs are executed o Text list o Symbol configuration o Global variable list o Data type units (DUT)
For changing the device type, see section Changing an existing device.

Updating project information

You can update a Company name and Version number for the application program in the Project Information window. This information is visible in Drive composer tool and ACS-AP-x control panel in the System info display. It also helps to identify the loaded application without the Automation Builder tool. You can also name the application from the application tool.
To update project information in Automation Builder, follow these steps:
1. In the main menu, click Project and then click Project Information.
Figure 8 Updating project information
30
2. In the Project Information window, select Summary tab, update the desired information and click
OK.
Figure 9: Project information
The updated project information is not loaded to the target application. Further steps explain how to copy this information to the application information fields.
3. In the Devices tree, right click Applications and select Properties.
Figure 10 Application properties
Loading...
+ 196 hidden pages