Example Ac500 Ha Cs3
Example Ac500 Ha Cs3
Example Ac500 Ha Cs3
„Warranty, Liability:
The user shall be solely responsible for the use of this application example described within this file. ABB
shall be under no warranty whatsoever. ABB's liability in connection with this application example or the
files included within this file, irrespective of the legal ground, shall be excluded. The exclusion of liability
shall not apply in the case of intention or gross negligence. The present declaration shall be governed by
and construed in accordance with the laws of Switzerland under exclusion of its conflict of laws rules and of
the Vienna Convention on the International Sale of Goods (CISG)."
The purpose of this document is to explain how to develop an application with High
Availability (HA) functionalities.
There are two examples discussed in this document for the two different HA setups.
In chapter 5 the example for counter application is described using HA setup only with CPU
COM CS31 bus. It also explains about sample redundant Panel Builder program.
In chapter 6 the example is described using HA setup with both CPU COM and CM574
COM CS31 bus.
The necessary preparation of the AC500 is explained at the beginning of each of these
example chapters.
2.3. Compatibility
The example programs explained in this document have been used with the below
engineering system versions. They should also work with other versions; nevertheless
some small adaptations may be necessary, for future versions.
The user must follow all applicable safety instructions and the guidelines mentioned in the
user documents of the ABB products used in the example program.
Read the complete safety instructions for the AC500 before installation and commissioning.
A comprehensive documentation to High Availability system and library can be found in the
online help.
This document is an extended version of the online help chapter: High Availibility – System
Technology - Guidelines for Usage. Engineering and operation of different HA systems are
explained with all detailed steps, using the example project which comes along with this
document (See folder \AutomationBuilder\Examples\HA-CS31)
Each HA application requires few mandatory function blocks and settings to be done in
every project. Following is an overview of the function blocks which are needed for an
extended system with CM574. The detailed explanation for each function block is available
in the online help chapter: High Availibility Library – Control and Diagnosis Function Blocks.
4.1. HA_CS31_CONTROL
Fig 1 :- HA_CS31_CONTROL FB
The HA_CS31_DIAG Function Block handles the control and status bytes of each CI590
Module on the CPU COM CS31 Bus and related diagnostics.
4.3. HA_CS31_DIAG_VIA_CM574
Fig 3 :- HA_CS31_DIAG_VIA_CM574 FB
This HA_CS31_DIAG_VIA_CM574 function block will work only on the CPU and gives the
status of CI590 on the CM574 module. This Function Block works only if a corresponding
HA_CS31_DIAG_ON_CM574 is enabled in CM574-RS program.
4.4. HA_CS31_DIAG_ON_CM574
Fig 4 :- HA_CS31_DIAG_ON_CM574FB.
This HA_CS31_DIAG_ON_CM574 function block will work only on the CM574 RS. This
function block works only if HA_CS31_DIAG_VIA_CM574 is enabled in the CPU program
RECOMMENDED HA CONNECTION
Bridge Connection
PC Ethernet Card 1 PC Ethernet Card 2
CS31 Line 1
CI590 S500 XXX S500 XXX
CS31 Line A
CS31 Line B
UDP Data Exchange
ETH Card 1 ETH Cable
ETH Card 2 ETH Cable
This chapter describes how HA Counter, Ramp and PID Function Block is used for CPU
COM1 CS31 bus example program. The following components are required:
· Two identical PLC setups (PM573 or higher) connected with CI590 and IO modules
using CS31.
· One PLC setup will act as primary setup and other one as secondary, which will be
decided by the HA library itself
· Separate CM577 Ethernet modules can be used for downloading the program.
· Please refer chapter 2.3 for correct Automation Builder version details, Automation
Builder running on a PC which is connected to the AC500 via Ethernet.
· Library: HA_CS31_AC500_V23.lib.
· Example project: “ Example_AC500_HA_CS31_V242.project ”.
Note: - User can skip the following steps by opening the example project directly from
\AutomationBuilder\Examples\HA-CS31path.
5.1.1. Target
Open new Automation Builder Plus and choose your PLC type.
Set a unique address for each CI590 module connected on the same CS31 bus network.
The same must be given on the hardware using the rotary switch.
For addressing more than one CI590 module user has to configure the first CI590 line
completely in Automation Builder and double click on the CI590 module to check the actual
no CS31 modules.In the next CI590 module, the given address should be higher than the
number of CS31 modules in the previous line.
5.1.3. Inputs/Outputs
The WORD variables corresponding to Input and Output channels shall be renamed in a
manner that they are accessible and understood more easily.
For example:
Ethernet è
PLC1: 192.168.0.201
PLC2: 192.168.0.202
Select CM577
ADD Modbus_TCP_IP_Server è
communication.
5.2.1. Overview
Below picture shows the Mandatory Function Blocks for HA system to work. Inside dotted
box are not the mandatory Function Blocks for HA system to work.
5.2.2. Library
In library manager (accessible by Resources menu), right click on library list and select
Additional library.
Right click on POUs manager and select Add Object. Name this object HA_PROGRAM and
choose FBD language and validate this box.
HA_CS31_CONTROL è The function block controls the HA Operation. For more details
about the function block please refer online help file.
HA_CS31_DIAG è The function block reads the status byte and writes control byte of all
CI590 connected on HA-CPU COM1 with relevant diagnostics. For more details about the
function block please refer online help file.
Right click on POUs manager and select Add Object. Name this object PLC_PRG and
choose CFC language and validate this box.
Note:- The user can select any other suitable programming style such as ST or FBD.
Program named PLC_PRG is equivalent to Main for C program. For this example, the
PLC_PRG Program is calling other programs.
The three counters are incremented or decremented with the same clock signal. When the
counter limit is reached, a preload value is loaded and the cycle restarts infinitely.
For HA_CS31_CTUD block, when the increment period (reach of counter limit) is finished,
counter goes to decrement mode until to the low limit.
A general Enable signal is used for the three counters [0, 1].
The clock signal is the same for the entire counter [3, 4, 5, 6].
Reset management and Load Value management are treated just after HA function blocks
took into account their levels.
Limits of counters are tested there, and when a counter reach a limit, according to mode
management, counters restart or change counting mode.
5.2.4.3. EXAMPLE_RAMP_FB
The basis signal is a simple blinking output as a clock signal and the period for reaching
limit is determined by Limit_Ratio numbers of clocks.
RST ratio management enables to redone the test infinitely by re-initializing CTU blocks.
50 x 300ms = 15 seconds
Output of an AX522 module is affected by ramp output and the signal can be check by
oscilloscope.
5.2.4.4. EXAMPLE_PID_FB
HA_CS31_PID_FIXCYCLE: Basic PID controller with fix cycle with inbuilt HA Data
Synchronization.
The both PID are controlled with the same “SET POINT” signal. This signal switches
between -25000 and+25000.
Switching between the limits PID_VAL_H and PID_VAL_L respectively +25000 and -25000.
Read of the actual state directly with the inputs corresponding to PID controlled outputs. A
conversion is needed to affect PID inputs.
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.
This is a sample program for showing the data exchange between PLC and HMI.
Here some variables and output values are incremented in each PLC cycle.
5.2.4.6. EXAMPLE_DIGIVIS
This is a sample program for displaying IP address, PID, RAMP and COUNTER values in
Digivis screen. Digivis program is available in the Example program folder.
Digivis with OPC server is recommended for HA system for writing data to PLC as it will
write data to both the PLC at the same time and read data from the Primary PLC.
OPC Server configuration is explained under chapter 6 and sample configuration files can
be find inside Automation Builder example folder.
Note: Callback Stop Event must be in followed the name patters as below “callback_xxx”.
The usage of prefix ‘callback’ is mandatory.
MAIN: for example, it will be executed cyclically each 30 ms and with a priority of 11.
Note:-
MAIN Task for the application itself: lower priority than the HA task. Cycle time should be
equal to CS31 cycle time (Automation buider indicated) or higher.This also based on PLC
Type and Application.
· Name of task
· Priority as seen before
· Type: cyclic
· Interval: 10ms
Do the same as above for MAIN task and call PLC_PRG program and have the following
screen.
You can download your program now in both PLC and check configuration errors.
The CPU program can be downloaded to PLC using normal TCP/IP gateway.
It is recommended to use dedicated Ethernet port for Program download.If the PLC is not
having more than one onboard ETH port then the user need to use a CM577-ETH slot for
downloading program to both PLC.If the PLC is having more than one onboard ETH port
then the user can use ETH2 for program downlaod, If no CM577-ETH is available, onboard
Ethernet slot can be used for downloading the program.
5.5. Operation
The HA_CS31_CONTROL function block handles the AC500 HA operation such as change
over from primary to secondary CPU in case of fault with related diagnostics and also data
transfer between HA CPUs. This is a mandatory function block for HA to RUN.
The HA_CS31_DIAG function block will be used for getting diagnostic information only from
CPU COM1 CS31 line .Please refer function block online help file for more detailed
information about the block.
The HA Utility function blocks outputs are internally synchronized and can be used directly
without using HA_CS31_SYNC function block.
Note :
· During HA system startup if all CI590 modules are not powered on or having wrong
module address system will not become stable.
· If any CI590 module address changed after HA system startup system will continue
running as it is. Restart is required for the complete system for the new address to
get active.
5.5.1. Panel Builder program and Configuration for HMI with redundant Scripts.
Panel builder program and scripts are available with example program under
“HA_CS31_Example_OnlyCPU_HMI” program node in Automation Builder. Please find
below recommended HA connection diagram for CP6xx HMI.
Note: - Example HMI program can be used with CP6xx having one / two Ethernet ports.
This is a sample program for users who wants to use the CP6xx series HMI with redundant
applications.In Codesys program fG_HA_PRIMARY and fG_HA_CPU_STOP variable
status must be passed to Panel builder program for HMI to identify the Primary PLC.
fG_HA_CPU_STOP variable status must be used under callback stop POU as
below.Please refer chapter 5.2.4.5 for HMI Data exchange program in PLC.
Note :- HMI is recommend only to read the data from PLC as it will always read data from
Primary PLC. It is not recommended to write data from HMI as it will write only to the
Primary PLC.
User can go to HMI protocol tab and change the communication protocol to Modbus TCP if
required.
This chapter describes how HA Counter ,PID and Ramp Function Block is used for CPU
COM1 CS31 bus and CM574 CS31 bus example program. The following components are
required:
· Two identical PLC setups (PM573 or higher) plugged with CM574 and
CM577connected with CI590 and IO modules using CS31. One PLC setup will act
as primary setup and other one as secondary.
· Separate CM577 Ethernet modules can be used for downloading the program.
· Please refer chapter 2.3 for correct Automation Builder version details, Automation
Builder running on a PC which is connected to the AC500 via Ethernet
6.1.1. Target
Open new Automation Builder Plus program => Right click and select Add device =>
choose your PLC type.
Plug CS31 bus under COM1 interface and Add present modules by adding CI590 modules
and their own IO-Bus modules. Set different Module address for each CI590 module
connected on the same CS31 bus network.
For CM574 CS31 lines add CM574 under the respective SLOT no as shown below.
Select CM574-RS from the list as shown below and select Plug Device
Select CS31 bus from the list and Plug Device as shown below
Right click on the CI590 and select Add device again for adding the IO modules as shown
below
For addressing more than one CI590 module user as to configure the first CI590 line
completely in Automation Builder and double click on the CI590 module to check the actual
no CS31 modules and the next CI590 module address should be higher than the number of
CS31 modules in the previous line.
For example as the below picture if the first CI590 and IO modules consuming 7 CS31
modules then the next CI590 address should be 8 or higher than that.
6.1.3. Inputs/Outputs
The WORD variables corresponding to Input and Output channels shall be renamed to be
accessible more easily.
· For outputs of the CPU COM1 first CI590 in the configuration: CI590_Counter1_O
· For outputs of the CM574 COM1 first CI590 in the configuration: CI590_Counter2_O
· For outputs of the CM574 COM2 first CI590 in the configuration: CI590_Counter3_O
· For outputs of the first CM574 second CI590 IO module AX522 configuration is
having Ramp and PID inputs and outputs configuration.
Ethernet è
PLC1: 192.168.0.80
PLC2: 192.168.0.81
Right click on Onboard Ethernet => select add device => Select UDP data exchange
Right click on the slot => select plug device => Select CM577
Note:
It may be observed that in the complete CS31 line each CI590 might take different time to
initialize based on the number of I/O devices connected to it. So it is a good practice to
make the CI 590 initialize and update the input and outputs together. In order to achieve it
the ‘max wait time’ setting must be configured as per the process explained below:
First we need to physically check the time taken CI590 modules to get stable once the
system is powered on. Once the PLC is powered ON, the CI 590 starts initializing. Note the
time taken by the CI590
The above time must be calculated only for the CI590 which takes the maximum time to get
stable among all the CI590 devices in the set up.
Then open the Automation Builder project and click on the com port of the CM574 module
on which the CS31 line is configured, as shown in the screenshot below.
In the Max wait run enter the time as per the calculations done above. For example of the
time taken for all the CI 590s to get stable is 60secs, enter the value slightly higher than
this.
The following pictures explain the effect of having the max wait time value.
6.2.1. Overview
Below picture shows the mandatory function blocks for HA system to work with CM574
CS31 bus connected with IO modules. This is supported by library
HA_CS31_AC500_V23.lib or higher. Inside dotted line box function blocks are not
mandatory for HA system to run.
CM574-RS PM5xx
HA_CS31_CONTROL
HA_CS31_CALLBACK_STOP
HA_CS31_DIAG
CPU COM1
(COM1, SLOT0-CPU)
HA_CS31_DIAG_EXTD
(SLOT0 , COM1-CPU)
CM574-RS (SLOT1)
HA_CS31_DIAG_ON_CM574 HA_CS31_DIAG_VIA_CM574
CM574 SLOT1 COM1 (SLOT1,COM1) (SLOT1,COM1)
HA_CS31_DIAG_EXTD_VIA_CM574
(SLOT1,COM1)
HA_CS31_DIAG_ON_CM574 HA_CS31_DIAG_VIA_CM574
CM574 SLOT1 COM2
(SLOT1,COM2) (SLOT1,COM2)
HA_CS31_DIAG_EXTD_VIA_CM574
(SLOT1,COM2)
CM574-RS (SLOT4)
HA_CS31_DIAG_ON_CM574 HA_CS31_DIAG_VIA_CM574
CM574 SLOT4 COM1 (SLOT4,COM1) (SLOT4,COM1)
HA_CS31_DIAG_EXTD_VIA_CM574
(SLOT4 , COM1)
HA_CS31_DIAG_ON_CM574 HA_CS31_DIAG_VIA_CM574
CM574 SLOT4 COM2
(SLOT4 , COM2) (SLOT4 , COM2)
HA_CS31_DIAG_EXTD_VIA_CM574
(SLOT4 , COM2)
HA_CS31_DATA_SYNC
HA_CS31_TOF
HA_CS31_TON
6.2.2. Library
In library manager (accessible by Resources menu), right click on library list and select
Additional library =>Select HA_CS31_AC500_V23.lib in the right folder => C:\Program
Files\Common Files\CAA-Targets\ABB_AC500\AC500_V12\Library.
Right click on POUs manager => select Add Object. Name this object HA_TASK=> choose
FBD language => Press OK.
HA_CS31_CONTROL è The function block controls the HA Operation. For more details
about the function block please refer the online help file.
HA_CS31_DIAG è The function block reads the status byte and writes control byte of all
CI590 connected on HA-CPU COM1 with relevant diagnostics. For more details about the
function block please refer the online help file.
HA_CS31_DIAG_VIA_CM574 è This function block reads the status byte and writes
control byte of all CI590-CS31-HAconnected on HA - CM574-RS COM with relevant
diagnostics. This is a mandatory function block for CM574-RS CS31 bus to work. For more
details about the function block please refer the online help file.
xEnable_3 & xEnable_4 must be set to true for enabling function block.
bySlot_3 & bySlot_4:=2; this is to represent the SLOT NO in which CM574 is plugged.
byCom_3 & byCom_4:= 1 & 2 respectively to identify the CS31 COM no in CM574.
Right click on POUs manager and select Add Object. Name this object PLC_PRG and
choose CFC language and validate this box. The user can select any other suitable
programming style such as ST or FBD.
Program named PLC_PRG is equivalent to Main for C program. For this example, the
PLC_PRG Program is calling other programs.
The three counters are incremented or decremented with the same clock signal. When the
counter limit is reached, a preload value is loaded and the cycle restarts infinitely.
For HA_CS31_CTUD block, when the increment period (reach of counter limit) is finished,
counter goes to decrement mode until to the low limit.
A general Enable signal is used for the three counters [0, 1].
The clock signal is the same for all the counter [3, 4, 5, 6].
Counter instantiations are linked directly to outputs: count1 (CTU), count2 (CTUD), Count3
(CTD) outputs are respectively connected to CPU COM1 CS31 CI590 first module, SLOT2
CM574 COM1 CI590 first module , SLOT2 CM574 COM2 CI590 first module.
Limits of counters are tested there, and when a counter reach a limit, according to mode
management, counters restart or change counting mode.
Output of the BLINK is used generate clock signal for all the three counters.
6.2.4.2. EXAMPLE_RAMP_FB
The basis signal is a simple blinking output as a clock signal and the period for reaching
limit is determined by Limit_Ratio numbers of clocks.
For this example: clock period is 1 s and Limit_Ratio = 20, for 40 seconds the limit to reach
is eitherIN_VALUE_H or IN_VALUE_L.
These parameters allow the ramp function block to reach the limit in:
50 x 300ms = 15 seconds
Output of an AX522 module is affected by ramp output and the signal can be check by
oscilloscope.
HA_CS31_PID_FIXCYCLE: Basic PID controller with fix cycle with inbuilt HA Data
Synchronization
The both PID are controlled with the same “SET POINT” signal. This signal switches
between -25000 and+25000.
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.
The PID parameters are defined during declaring variables. The both type of PID are
instantiated there.
6.3.1. HA Task
· MAIN: for example, it will be executed cyclically each 30 ms and with a priority of 11.
· HA_Task: it will be executed cyclically each 30 ms and with a priority of 10.
Note :-
· Name of task
· Priority as seen before
· Type: cyclic
· Interval: 10ms
After creating task executed periodically each 10ms, the program HA_PROGRAM must be
called by this task.
6.3.2. MAIN_TASK
Do the same as above for MAIN task and call PLC_PRG program
You can download your program now in both PLC and check configuration errors.
The CPU program can be downloaded to PLC using normal TCP/IP gateway. For more
details please refer Chapter 5.5.After downloading the program create a boot project.
Open new Automationl Builder Plus program => select create a new project => Select
CM574 RS as device
Based on actual hardware setup configure COM1 & COM2 as Shared Interface
6.6.1. Library
In library manager (accessible by Resources menu), right click on library list and select
Additional library =>Select HA_CS31_AC500_V23.lib in the right folder => C:\Program
Files\Common Files\CAA-Targets\ABB_AC500\AC500_V12\Library
6.6.2. PLC_PRG
Go to Project tab and Rebuild the blank project once and again go to Project => Object =>
Convert
Note:- The user can select any other suitable programming style such as ST or FBD.
HA_CS31_DIAG_ON_CM574 è The function block reads the status byte and writes
control byte of all CI590 connected on CM574-RS COM with relevant diagnostics.
For more detailed description about the function block please refer the online help file.
6.7.1. HA_TASK
· Name of task
· Priority as 10
· Type: cyclic
· Interval: 10ms
Note :-
CPU program and configuration should be downloaded to PLC before CM574 Program and
configuration downloading to CM574-RS.
CPU Configuration must be downloaded to CPU before CM574 Configuration and Program
download.
Download the configuration and program to CM574 via Ethernet level 2 root driver.
The following figure shows the setting of a gateway channel for connection via the AC500
CPU with the IP address 192.168.3.10 with routing to the CM574-RS plugged into slot 2
(line 2).
Routing levels - 1
For more programing access to CM574 refer online help file “Programming Access to the
CM574-RS“.
6.9. Operation
For each remote CS31 line there is a pair HA_CS31_DIAG_ON_CM574 on the CM574-RS,
see also figure in the beginning of this chapter 3. Each pair is handling the diagnosis of the
related CS31 line.
Note: - HA visualization can be used only for the monitoring purpose. Customer can view
only the logged in PLC information using visualization. User can use Digivis and OPC
server for read and write data to HA System. For more information about the OPC
configuration please refer chapter 6.
The OPC server V3 and the AEConfigurator must be installed from the PS501 installation
CD. Please refer to the installation description.
Note: The OPC server can generally also be registered as service. This must not be
accomplished in the context of a DigiVis 500 installation since the OPC tunnel itself starts
the OPC server automatically.
By default the OPC Server (WinCoDeSysOPC.exe) runs in the same user account of the
process that launched the OPC Server. Depending on the user account this could lead to
unpredictable behavior. Thus it is required to configure the user account for the OPC
server. These instructions apply to Windows XP with at least SP 2 and Windows 7installed
and those systems where only OPC clients that are installed on the same machine connect
to the OPC server. Remote access via DCOM would require additional configuration that is
not described here.
The procedure to configure the user account has to be repeated every time after:
To configure the user account performs the following procedure as user that is member of
the “Administrators” group:
1. Make sure that the OPC server is not running. If DigiVis500 is installed the OPC Tunnel
service needs to be stopped (via Control panel -> Administrative Tools -> Services).
Use the task manager to verify that there is no process “WinCoDeSysOPC.exe” when
the option “Show processes from all users” is selected.
2. Start “Component Services” by calling “dcomcnfg” from the command prompt or from
“Start ‚ Run”. If Component Services are already running restart them after the OPC
server was installed and registered.
5. Select for “Authentication Level” the value “None” in the tab page “General”.
6. Open the tab page “Identity”
Note:
If the desired user is already entered select the option “The interactive user”, press “Apply”
and continue with step 6. Otherwise it could happen that the displayed settings are not
really used.
After the installation of the OPC Server it should be offered for selection by the OPC client
(e.g. visualization). The name of the OPC Server is CoDeSys.OPC.DA The name of the
Alarms and Events OPC Server is CoDeSys.OPC.AE The OPC Server will be started
automatically by the operating system as soon as a client establishes a connection. The
OPC Server then will terminate automatically as soon as all clients have closed their
connections to the server. There will be no OPC Server icon in the task bar, but it will be
only handled in the Windows Task Manager as a process.
Note: If DigiVis500 is used as OPC client the OPC server remains active (due to the OPC
tunnel) even if all DigiVis clients have been shut down. To stop the OPC server (e.g. after
reconfiguration) the OPC tunnel must be used. It offers a restart of the OPC server from the
tray menu (see DigiVis500 documentation). Unless the service of the OPC tunnel is not
stopped the OPC server will always be restarted after termination.
Symbol includes the items (variables) which exchanges with PLC, this is needed for OPC
communication. After build the project, two symbol files will be generated under the project
(.pro) folder. One is .sdb, another is .sym.
File .sdb is a binary file and is needed by OPC server indeed. File .sym has the same
content but in text, which can be understood by human. It can be used to check if it is
generated correctly.
Please refer to REF5 Online help for how to configure CoDeSys for
symbol file.
Note
Sometimes the symbol file looks different than really configured, e.g. more
symbols than expected. In such case please follow the steps to create a
clean symbol file:
TIP
Uncheck all the options in Symbol file configuration, and confirm with OK
and OK again (2 times OK).
Following option can be chosen to download the .sdb file also to PLC.
When OPC server is started, the .sdb file will be copied from PLC (if available) or from
Gateway folder to “C:\WINNT\Gateway Files\Upload” for Gateway communication.
With the OPC data access configuration it is determined which controllers shall
communicate via OPC. For this, the gateway channel must be determined, the project
name must be entered and the individual parameters (e.g. transmission rate, timeout
values, etc.) must be defined.
Note: The OPC configuration must be saved as <OPCServer.ini>at the OPC server
execution directory.
Note: Each change of the OPC configuration will only come to action if the OPC server is
restarted after saving the configuration as <OPCServer.ini>at the OPC server execution
directory.
To start the configuration start the application ‘OPCConfig.exe’ from the installation
directory.
Basic Update Rate of the OPC-Server in milliseconds. This is the cycle time according to
which all item data are read from the PLC. The Update Rate should match to the client
Update Rate (means to be smaller). The given update rate is the fastest cycle in which the
The OPC server creates a Public Group for each IEC function block and also for the global
variables.
Synchronized initialization: The OPC server reacts at start only if the symbol configuration
was loaded before.
If this function is activated, the actions and occurred errors of the OPC server are logged
and stored in a log file. The file is created in the project directory and given the name
OPCServer.log. The messages of several OPC sessions are assembled in the same log
file.
To configure a specific PLC select “Append PLC” via the “Edit” menue:
Name of the interface used for the communication between programming system and PLC.
Note: If the OPC server is communicating via the same Gateway channel over which the
program has been sent to the PLC, then no project name must be given. If another
Gateway channel is used for the OPC server, then the project name must be given in this
place. A project name must also be provided for Offline configuration (PLC not connected).
Caution: It is important that the individual OPC projects get different project names for
Single PLC’s. For a HA PLC pair the same project is downloaded to both HA PLC’s.
If within this period of time the OPC server does not receive any feedback on a sent
request from the PLC, it will consider the request as failed.
Number of attempts of the OPC server to send a request in case a timeout occurred. The
original request is included in this number, if the value is 3 then the OPC server will retry for
2 times before the connection is considered as broken. Thus the Timeout multiplied by the
Size of the communication buffer on the target system. For all AC500 PLC’s, a buffer size <
5000 must be entered.
Time in seconds, which the OPC server waits for readyness of the individual PLC (
important with autostart of the control system). After the start of the OPC server it is tried to
establish communication with the configured controllers. Then it sends a message to the
client whether a communication exists or not. Within the waiting time, the controllers have
the possibility to register before the status is passed on to the client.
Note: This time must be chosen long enough so that all participants can register. If this
time is set too short, then it can happen that some participants are not registered at the
start. In this case the time should be increased.
The time depends on the number of participants and also on the items defined in the
symbol file.
Note: If the CoDeSys project should be changed and new items be added in the symbol
configuration, then it can happen that the previously set parameters are not correct any
more. In this case the parameters must be adapted (i.e. increasing the waiting time).
Time interval between two tries in which the OPC server attempts to reconnect the
connection to the control system via the gateway after a communication interruption had
occurred.
Note:
The longest configured Reconnect Time of all PLC’s defines the reconnection time for all
PLC’s.
Selection whether the target system of the project does use the Motorola byte order.
Note:
With all AC500 control systems, this function is active. With all AC31 control systems, this
function is not active.
No Login-Service (default not activated): This option must be deactivated with such
target system, where it is necessary to send a login service.
Note:
With all AC500 control systems, no login service must be sent. This function must be
active.
If this function is activated, the actions and occurred errors of the OPC server regarding the
selected PLC are logged and stored in the log file. To activate the logging for one PLC the
general “Log Events” setting must be activated within the previous parameter dialog.
Additional logging information for service personal purpose can be activated by this
parameter.
Additional more detailed logging information for service personal purpose can be activated
by this parameter. Í for the example selected: set deactive
If the entry 'Connection' is selected, the settings for the connection to the PLC can be
defined in the right part of the window.
By pressing the ‘Gateway’ Button the gateway channel over which the OPC server
communicates with the PLC can be selected.
If TCP/IP is selected the ‘Address’ can be selected between “localhost” and an IP address
of the computer where the Gateway is running.
Note:
The connection setting “local” is only working if the OPC user is the same as the interactive
user (refer to DCOM configuration settings as in chapter 3.
Note:
It must be ensured that the required Gateway ports (1210) is not occupied by a different
process. Otherwise the Gateway communication cannot be established.
Ø If there are problems to establish Gateway communication check the usage of ports
1210 and 1211 (via any port scanning tool, e.g. SysInternals or portscanner)
The communication parameters of the PLC’s already configured within CoDeSys are
presented if a PLC is selected.
Note:
The configuration steps of a PLC described in chapter “Settings for the PLC” and chapter
“Settings for the connection to the PLC” must be repeated for each PLC the OPC server
shall have access to.
Ø In this example the settings for the two HA PLC’s must be configured.
Selecting the newly created Redundancy item in the tree list will open a new dialog where it
can be defined which two of the presented PLC’s shall be combined as one HA PLC pair.
This is done by selecting the relevant two PLC’s (one by one) and switching them to the
right window by pressing “ >> “.
After the PLC’s are presented in the right window the both individual PLC’s have to be
selected and the ‘Master Variable’ must be set for both PLC’s to the value
<.fG_HA_PRIMARY>.
This variable is defined in the HA library Global Variables within CoDeSys and is used by
the OPC Server to identify which PLC is the Primary.
The ‘LifeCounter Variable’ must only be set once to the value <.dwG_HA_ServerAlive>.
The ‘Master Variable’ must be set for both PLC’sto the value <.fG_HA_PRIMARY>.
If one setting is missing or misspelled (case sensitive) the OPC server will not work
properly.
This is those PLC of the HA pair which the OPC server will take for client data exchange if
no Primary is indicated by the PLC’s (error state).
Note:
The OPC server exchanges the subscribed read and write data with the PLC’s in the
following way, depending on the availability (network connection) of the Primary (PRIM)
and Secondary (SEC) PLC’s:
PRIM and SEC available: Read from PRIM, Write to PRIM and SEC
Only SEC available: Read from SEC, Write not allowedèWRITE ERROR
The OPC server supports the OPC Alarms and events specification (AE interface).
The alarms are generated by the OPC server itself which means that also the time stamps
of the messages are provided by the OPC server.
For the determination of alarms the OPC server monitors specific OPC items and compares
the values with configured alarm conditions. If the alarm condition is given the OPC server
reports this with an alarm message to the client.
Note:
As for the data access the OPC server takes the values from the Primary PLC also for
alarm determination.
To configure the OPC alarm conditions the AEConfigurator tool will be used.
With the AEConfigurator limit and digital alarms can be defined and assigned to OPC items
from the PLC’s.
It is separated into the configuration part and below to it the error list is located which will
present configuration errors after checking the configuration.
A new alarm can be added via context menu in the list view or via the menu with
<Edit><Append Alarm>.
Limit alarms can be used to monitor analog variables as integer and real types. For the
limit alarm four alarm limits can be defined: Lo, Hi, LoLo, HiHi.
Lo and LoLo limits check against undercut, Hi and HiHi limits check against exceeding,
whereby the alarm is already triggered if the defined limit value is reached.
The configurable ‘Update Rate in Ms’ defines the period in which the OPC server
recalculates the alarm condition again. Typically 500ms is a reasonable value.
Limit value: Limit which will be taken for comparison with PLC variable value
Severity: OPC severity (1..1000), shall be set according to the OPC clients mapping
Acknowledge required: If set the alarm needs an acknowledge from client before leaving
alarm list
Enabled: Enables the alarm check for specific limit. If not set the limit will not be checked
Message texts: Message text that will be reported to the client if the limit is triggered.
As with the limit alarms the digital alarm offers ‘Update Rate in Ms’, ‘Severity’ and ‘Return
to normal’.
Different for digital alarms is the alarm trigger condition. Instead of four limit values only one
trigger condition can be set:
If “true” set then alarm will be triggered if the according boolean variable is “TRUE”
If “false” set then alarm will be triggered if the according boolean variable is “FALSE”
‘Acknowledge required’, ‘Variable enabled’ and ‘Message texts’ have the same
meaning as for limit alarms. (please refer to previous chapter)
New languages for message texts can be added by clicking the <A+> field in the menu.
After this a dialog appears to enter the desired language abbreviation.
Note: It is only possible to add new languages if an entry within the <settings.ini> file at
the AEConfigurator installation directory is set:
[addlangbutton]
enable=true
The language setting is valid for the whole configuration. After saving the configuration the
new language setting is added to the <settings.ini> file. From then the language will
always be offered while opening the AEConfigurator tool.
If language settings shall not appear the specific language setting needs to be removed
from the <settings.ini> file:
[lang]
0=EN-EN <English>
1=DE-DE <German>
2=FR-FR <French>
The actual message text language that shall be presented by the Client can be selected by
the selection list for ‘Current Language’.
A change of the language will only be activated if the OPC server is restarted after saving
the new setting to <OPCServerA.ini>.
The OPC alarm configuration must be saved as <OPCServerA.ini>at the OPC server
execution directory.
Note:
Each change of the OPC alarm configuration will only come to action if the OPC server is
restarted after saving the configuration as <OPCServerA.ini>at the OPC server execution
directory.
The configuration can be checked according correctness. If the configuration check detects
a misconfiguration (e.g. Lo limit greater than Hi limit) an error message will be presented for
each error in the error list of the dialog. Warnings will be presented with yellow indication,
error are presented with red indication.
Before an alarm is generated out of the alarm configuration the limit and digital alarms need
to be assigned to PLC items (variables or FB pins). Only after this assignment the OPC
server can apply the alarm determination rules on the PLC items.
If a connection exists to the OPC server the variables can directly get from there for the
assignment. Therefor the OPC server needs to be connected. This can be done by
<Rightclicking> the “CoDeSys.OPC.DA” entry in the OPC symbol list:
Then the full OPC item name and the alarm name need to be given. Since this is not so
convenient and also fault-prone the way with connected OPC server is recommended.
After the browsing of the OPC server is completed the list of available OPC items is
presented in a tree structure.
To map an alarm to a PLC variable simply the variable has to be selected within the tree
and additionally the desired alarm definition has to be selected.
Only those alarm definitions which fit to the OPC item data type can be assigned to the
OPC items. This means that Digital alarm definitions will only be available for Boolean OPC
items, Limit alarms can be assigned to numeric OPC items.
Only those alarms will be handled by the OPC server which are connected. It is possible to
delete connected alarms from the list by selecting the items to be deleted item and pressing
the cross symbol above the “Connected Alarm Item” list.
Note:
The OPC alarm configuration must be saved as <OPCServerA.ini>at the OPC server
execution directory.
Note:
Each change of the OPC alarm configuration will only come to action if the OPC server is
restarted after saving the configuration as <OPCServerA.ini>at the OPC server execution
directory.
Please regard that the no client is connected while the OPC server is restarted by the OPC
tunnel and that also the OPC AE config tool has no connection open to the OPC server.
Since the alarm generation is provided by the OPC server itself and not by the PLC’s there
are no predefined system alarms for PLC states (START, STOP, Communication abort, …
) available.
Those alarms can be provided by the CoDeSys application if the relevant PLC state
indicators are mapped to variables which then can be accessed from the OPC server.
Mostly digital alarms will then be mapped to those variables to indicate a binary state (e.g.
PLC stopped).
Please refer to the CoDeSys documentation to identify which means are provided for
getting PLC states.
The following example shows the configuration of an alarm to notify a stopped CPU.
For a HA PLC both variables are provided, for a single PLC only <__CommStatePLC1> is
provided.
The following two pictures illustrate the definition and mapping of these alarms:
Since this is not obvious from the DigiVis500 operator console it is recommended to notify
the user about a missing Primary PLC with the configuration of an alarm for this event. This
is possible by monitoring the predefined HA variable <.fG_HA_PRIMARY>. It is true if the
Primary PLC has contact to the OPC server.
After saving as <OPCServerA.ini> file and restarting the OPC server the connection from
both HA PLC’s to the OPC server is monitored and if e.g. the connection to PLC2 is broken
The following picture shows the complete alarm mapping of the example project:
Note : Please refer below link for OPC server Alarm event release note.
http://abblibrary.abb.com/global/scot/scot397.nsf/veritydisplay/1dbdeeda5f253ea8c1257c21
00539d1d/$file/2cdc125027k0201.pdf
abb
ABB Automation Products GmbH
Wallstadter Str. 59
68526 Ladenburg, Germany
Phone: +49 62 21 701 1444
Fax : +49 62 21 701 1382
E-Mail: [email protected]
www.abb.com/plc