You are on page 1of 18

Programming Example AC500

Scalable PLC
for Individual Automation

PID with CI590 Bus Module


(High Availability)

High
Availability
PID

abb
Content
Purpose of the document .......................................................................................................... 2

Requirements ............................................................................................................................. 2

Opening sample file or new file ................................................................................................ 2

Configuration.............................................................................................................................. 2

Target ...................................................................................................................................... 2
Library...................................................................................................................................... 3
Ethernet ................................................................................................................................... 4
CS31........................................................................................................................................ 5
Inputs/Outputs ......................................................................................................................... 7
Program ................................................................................................................................... 8
HA_TASK ........................................................................................................................................... 8
PLC_PRG........................................................................................................................................... 9
CALLBACK_STOP........................................................................................................................... 10
Task ....................................................................................................................................... 10
HA task............................................................................................................................................. 10
CallBack Stop................................................................................................................................... 13

Program contents..................................................................................................................... 14

Example_FBs ........................................................................................................................ 14
Main ....................................................................................................................................... 15

Programming Example 1 High Availability PID AC500/Issue: 04.2009


Purpose of the document
The purpose of this document is to explain how to develop an application with High Availability
functionalities.

Requirements
The PS501 software version must be v1.3.1 or newest with HA_CS31_AC500_V13.lib. This library must
be placed in path:
C:\Program Files\Common Files\CAA-Targets\ABB_AC500\AC500_V12\Library
CI590 config file AC500_CS31_CI590_V13.cfg must be placed in path:
C:\Program Files\Common Files\CAA-Targets\ABB_AC500\AC500_V12\PLCConf
Sample files must be placed in path:
C:\Program Files\3S Software\CoDeSys V2.3\Projects\Examples\High_Availability

Opening sample file or new file


The example file is named:
HA_CS31_PID_V1.pro
This file shows the base of a HA program which the Example_FBs program is developed in CFC
language. This program uses different types of High Availability counters.
It is possible to create a new file with help of the following paragraphs.

Configuration
Target
The convenient target must be configured in target settings window (accessible in Resources menu).

The smallest compliant CPU with HA operating is PM581, due to limit memory capacity

NOTICE

1. Choose your PLC type in Configuration dropdown box.

Programming Example 2 High Availability PID AC500/Issue: 04.2009


Library
HA_CS31_AC500_V13.lib must be added to project in order to have access to HA function block.
1. In library manager (accessible by Resources menu), right click on library list and select Additional
library….

2. Select HA_CS31_AC500_V13.lib in the right folder (see paragraph defined above “Requirements”).
h The following window must appear after selecting the HA library. All accessible function blocks
are listed in the POUs list.

Programming Example 3 High Availability PID AC500/Issue: 04.2009


Ethernet
9 PLCs must be affected with a fix IP address, e.g.:
x PLC1 : 192.168.0.1
x PLC2 : 192.168.0.2
Refer to the specific paragraph to affect your own IP address “SYCON tool using”.
1. Add the internal Ethernet Communication Module in PLC configuration.

2. Add UDP data exchange element.

Programming Example 4 High Availability PID AC500/Issue: 04.2009


CS31
In Resources menu, select the PLC configuration. Add COM1 – CS31-Bus by right clicking on COM1
and selecting Replace element.

1. Select Master, ignore config fault CS31-Bus for Operation mode parameter.

This parameter is compulsory to allow configuration sending to CS31 modules.

NOTICE

2. Add present modules by adding CI590 modules and their own IO-Bus modules

Programming Example 5 High Availability PID AC500/Issue: 04.2009


3. Affect Module address parameter to the address corresponding to module switches.

Programming Example 6 High Availability PID AC500/Issue: 04.2009


Inputs/Outputs
The INT variables corresponding to Input and Output channels shall be renamed to be accessible more
easily.
For example:
x PID_I_1 and PID_O_1 corresponding to first PID
x PID_I_2 and PID_O_2 corresponding to second PID

Programming Example 7 High Availability PID AC500/Issue: 04.2009


Program
HA_TASK
1. Right click on POUs manager and select Add Object. Name this object HA_task and choose FBD
language and validate this box.

2. Add the both HA function blocks (Standard function blocks):


x HA_CS31_DIAG
The function block reads the status byte and writes control byte of all CI590 connected on HA-COM
with relevant diagnostics.
x HA_CS31_CONTROL
The function block controls the HA Operation.

The following variables must be initialized


x HA1_EN1 and HA2_EN must be set to TRUE to enable function block.
x HA1_COM :=1 ; for COM1 (PLC CS31 port)
x AC500_PM1 := 192.168.0.1 ; this address must correspond to address affected in section Ethernet
configuration
x AC500_PM2 := 192.168.0.2 ; this address must correspond to address affected in section Ethernet
configuration

Programming Example 8 High Availability PID AC500/Issue: 04.2009


PLC_PRG
1. Right click on POUs manager and select Add Object. Name this object PLC_PRG and choose CFC
language and validate this box.

2. Let the program empty for the moment. Content will be described later.

Programming Example 9 High Availability PID AC500/Issue: 04.2009


CALLBACK_STOP
This program is used only with HA function blocks.
1. Right click on POUs manager and select Add Object. Name this object CALLBACK_STOP and
choose CFC language and validate this box.

2. Insert box which calls HA_CS31_CALLBACK_STOP program (Standard Programs).

Task
HA task
At least, two tasks must be defined:
x MAIN : for example, it will be executed cyclically each 50 ms and with a priority of 11.
x HATask : it will be executed cyclically each 10 ms and with a priority of 10.

The priority of HA_Task must be lower than the main task priority. HA_task will be
executed in priority.

NOTICE

1. Right click on Task configuration menu and select Append Task.

Programming Example 10 High Availability PID AC500/Issue: 04.2009


2. Fill the following fields:
x name of task
x priority as seen before
x type: cyclic
x Interval: 10ms

After creating task executed periodically each 10ms, the program HA_TASK must be called by this task.
3. Right click on HA_task and select Append Program Call.

Programming Example 11 High Availability PID AC500/Issue: 04.2009


4. Select CALLBACK_STOP program in the list proposed (press F2 button).

5. Do the same for MAIN task and call PLC_PRG program and have the following screen.

Programming Example 12 High Availability PID AC500/Issue: 04.2009


CallBack Stop
1. Add a call program parameter when PLC goes to stop mode.

2. You can download your program now in both PLC and check configuration errors.

Programming Example 13 High Availability PID AC500/Issue: 04.2009


Program contents
Example_FBs
There are 2 different types of counters in HA library:
x HA_CS31_PID: PID controller with HA Data Synchronization
x HA_CS31_PID_FIXCYCLE: PID controller with fix cycle and with HA Data Synchronization
The both PID are controlled with the same “SET POINT” signal. This signal switches between -25000 and
+25000.
Description of the program
Switching between the limits PID_VAL_H and PID_VAL_L respectively +25000 and -25000.

The both PID set points are affected with the same value.

Read of the actual state directly with the inputs corresponding to PID controlled outputs. A conversion is
needed to affect PID inputs.

Programming Example 14 High Availability PID AC500/Issue: 04.2009


The PID parameters are defined during declaring variables. The both type of PID are instantiated there.

The outputs of the PID blocks are converted to be connected directly with outputs.

Main
Program named PLC_PRG is equivalent to Main for C program. For this example, the PLC_PRG
program is calling other programs.
For this example only Example_FBs program is called.

Programming Example 15 High Availability PID AC500/Issue: 04.2009


Programming Example 16 High Availability PID AC500/Issue: 04.2009
Manual No. 2CDC xxx xxx Xxxxx

abb
ABB STOTZ-KONTAKT GmbH
Eppelheimer Straße 82 Postfach 101680
69123 Heidelberg, Germany 69006 Heidelberg, Germany
Telephone (06221) 701-0
Telefax (06221) 701-240
E-Mail automation-helpline.desto@de.abb.com
Internet http://www.abb.de/stotz-kontakt

You might also like