Codesys Opc Server V3 Installation and Usage: Document Version 14.0
Codesys Opc Server V3 Installation and Usage: Document Version 14.0
Codesys Opc Server V3 Installation and Usage: Document Version 14.0
CONTENT
1 OVERVIEW ON OPC 4
7.7.2 SIMULATION 34
7.8 Changing directory and name of INI and LOG file 35
9 ERROR DIAGNOSIS 37
9.1 Means of error diagnosis 37
9.2 Brief checklist 37
9.3 Error cases 38
CHANGE HISTORY 39
tech_doc_e.doc / V1.2
1 Overview on OPC
1
OPC is a standardized interface for access on process data. It is based on the Microsoft standard
2
COM/DCOM and enlarged due to the requirements of data access in automation, where the interface
is mainly used to read data from or write data to the controller. Typical OPC clients are visualizations,
programs in purpose to register operating data, etc. Typical providers of OPC Servers are PLC
systems and field bus interface cards.
The OPC Server is an executable program that is started automatically during the establishment of a
connection between client and PLC. Hence, the OPC Server is able to inform the client about changed
variable values or states.
The OPC Server provides all variables (referred to as Items in ) that are available on the PLC (Item
Pool or Address Space). These items are managed within a Data Cache ensuring a fast access to
their values. Also possible is a direct, not cached access on the items of the PLC.
Additionally alarm and event information of items can be considered to be another type of data. For this
purpose items can be linked with digital- and limit alarms or events. For doing this it is highly
recommended to use the AEConfiguration tool. The tool can be found in the program directory of
CODESYS. For a proper use see the also delivered description AeConfigurator_UserGuide.
However, in the OPC Server the items can be organized in so-called Groups ( Private and – only for
V2.3 - Public).
The private groups can be composed in the client arbitrarily from particular items. Initially they do not
effect the groupings in the OPC Server, but if necessary can in case of V2.3 be transformed to Public
Groups. Working with Private Groups for example is useful in order to be able to activate or inactivate
certain groups of variables with just one single command, depending on whether they should be
accessible or not.
Grouped data should be read from the OPC Server consistently, i.e. all variables should be read at the
same time. Regard however that this is not always possible in case of target systems with restricted
communication buffers!
Due to the characteristics of DCOM it is possible to access a running on another computer. It is also
allowed that more than one client accesses the data source at the same time. The applicability of
different languages (C++, Visual Basic, Delphi, Java) is another benefit of employing COM.
tech_doc_e.doc / V1.2
1
OPC = OLE for Process Control; OLE = Object Linking and Embedding
For further information see www.opcfoundation.org and www.opc_europe.org
2
COM = Component Object Model (base for OLE); DCOM = Distributed Component Object Model
Furthermore hierarchical browsing (read of variables available on the PLC) for items is supported.
Communication between OPC Server and PLC can be carried out via one of the following interfaces:
• Gateway V3
• Gateway V2.3
• ARTI
• ARTI3
• SIMULATION3
• SIMULATION
Which interface has to be chosen for the communication depends on the particular PLC and has to be
configured in the INI file of the OPC Server (parameter: interface type). With help of the tool
OPCConfig the INI file can be comfortably configured. See Ch. 6 “CODESYS OPC Server
Configuration by OPCConfig.exe”.
The OPC Server is able to communicate with both, V3 as well as V2.3 PLCs, at the same time.
Furthermore a missing PLC can be simulated. Than a symbol file with all symbols in instead of the plc
provides the OPC server the symbol pool (XML file or SDB file).
Basically a symbol/item list has to be generated in the programming system. There in Symbol
Configuration, variables can be chosen for the symbol list. Depending on the settings in the target
description file, the symbol list is transferred either implicitly within the application or as a separate child
application. After this, the symbols can be browsed by the OPC server independent of the transfer
method. Additionally a symbol file with extension XML is stored in the project path. If the developer of
the visualization (OPC client) has not a PLC, this XML file can be used for simulation purposes.
3S-Smart Software Solutions GmbH Page 5 of 40
CODESYS_OPC_Server_V3_User_Guide.doc
CoDeSys OPC Server V3
The communication between the OPC server and a CODESYS V3 controller is always done via
CODESYS Gateway V3. In contrast to Gateway Server V2.3, this server is not bound any longer to the
Windows operating system and can be positioned at any desired position within the PLC network
except embedded PLCs.
PLC V3 1 shows a so-called stand-alone application. In this PLC the application as well as the symbol
information – we will go into this later – are filed on the PLC. Requests concerning the symbol
information, the values and the status information are handled by the PLC itself.
Things get some more complex considering the PLC system composed by the controllers PLC V3 2
and PLC V3 3.
Let us assume that PLC V3 3 is an embedded PLC, e.g. a small intelligent bus coupler, which due to
the restricted resources is not able to store the symbol information. But nevertheless the values of the
embedded PLC should be accessible for the OPC client.
For this purpose PLC V3 2 implements the Data Server, via which PLC V3 3 provides its item pool
„PLC3.Application“.
The total item pool, consisting of „Application“ and „PLC3.Application“ then can be made available to
the OPC Server via the Symbol Configuration.
Requests concerning the symbol- and status information referring to PLC V3 3, get directly answered
by PLC2. The data get read cyclically from PLC V3 3 via the Data Server and then get transferred to
the OPC Server resp. OPC client.
tech_doc_e.doc / V1.2
A symbol list is generated basing on the variables defined in the Symbol Configuration. Usually the
symbol list is implicitly transferred to the PLC with the download of the PLC application. This, however,
can also be done in an explicit transfer with downloading a separate child application on the plc, which
then can be handled separately.
<Application name>.__Symbols
If the Symbol configuration e.g. has been defined for application Application during downloading the
application, also the symbol information gets loaded to the PLC as Application.__Symbols :
The symbol application must be regarded as „normal“ application, also concerning the maximum
number of applications on a PLC.
Contemporaneously with the application download the symbol list will be exported in a symbol file (XML
format) and stored in the project directory.
If the developer of the visualization (OPC client) has not available a PLC, this symbol file can be used
for simulation purposes.
tech_doc_e.doc / V1.2
Note: The symbol file is the basis for the data exchange via CODESYS Gateway V2.3 .
If a project with symbol configuration is loaded from the CODESYS V2.3 programming system to the
PLC, a symbol file (*.sym or *.sdb) is created at the same time and stored in the Gateway resp. – if
applicable – on the PLC. The symbol file contains so-called „items“. One item (data object)
corresponds exactly with one variable in the control application program. The variables on the
controller can be reached via these items. (See more information on the symbol file in document
“symbolfile_e.pdf”!)
The CODESYS OPC Server requests the Gateway to submit the contents of the symbol files and then
produces an item list using the received information. As the contents of the item list is determined by
the accessibility of variables in the controller, it can not be influenced by the OPC client. In each case
the OPC Server reads the symbol file which was last loaded over the Gateway channel for a project.
Items of different projects, meaning of different application programs, can be reached simultaneously if
the symbol file was provided by the same Gateway channel.
tech_doc_e.doc / V1.2
Note: For using the OPC Server V3 on a Windows Vista system, it is strongly recommended to run the
OPC client in Windows XP SP2 compatibility mode and with extended administrator rights in order to
get a continuous updating of the values.
Note: If a labeled version of CODESYS is used, regard, that not only the product name (in the figure above
“CoDeDysOPC”) is modified but also the vendor name (in the figure above “3S-Smart Software
Solutions GmbH”) and their subordinate entries are adapted.
After the installation, the OPC Server should be offered for selection by the OPC client (e.g.
visualization). The name of the OPC Server is CODESYS.OPC.DA.
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.
For each configured PLC the OPC Server V3 generates the status variables _CommState and
_CommStateOK. _CommState can be interpreted from an OPC Client and the following states can
be requested:
STATE_TERMINATE = -1
STATE_PLC_NOT_CONNECTED = 0
STATE_PLC_CONNECTED = 1
STATE_NO_SYMBOLS = 2
STATE_SYMBOLS_LOADED = 3
STATE_RUNNING = 4
STATE_DISCONNECT = 5
STATE_NO_CONFIGURATION = 6
_CommStateOK is a Boolean variable indicating in state TRUE a communication with the OPC server.
The name of the plc can be taken from the prefix of the Boolean variable. If the variable is FALSE,
currently no communication is possible. This happens for example during download.
In redundant groups the status variables are generated for each plc in the group. Then for
differentiation the name of the status variables follows the syntax:
__CommStateOK<PLCName>
__CommState<PLCName>
Example:
tech_doc_e.doc / V1.2
OPCServer.ini:
[RedGroup:0]
Name=MyGroup
NumPLCs=2
DefaultPLC=0
PLCName0=SPWinV3
3S-Smart Software Solutions GmbH Page 10 of 40
CODESYS_OPC_Server_V3_User_Guide.doc
CoDeSys OPC Server V3
PLCName1=SPWinV3R
5.1 V3 Interface
Step 1: Add Symbol Configuration
Select the Application object in the device tree and add object Symbol configuration (Project-> Add
Object -> Symbol configuration). The symbol configuration editor appears:
The access right for a selected item can be modified in the right window by clicking on the symbol in
column Access Rights. Each mouse-click switches to the next one of the possible symbols and thus to
the respective access right:
read+write (read and write access),
write-only (only write access),
read-only (only read access).
Note: In case of arrays and structures the aggregate variable as well as the particular components will be
generated implicitly
tech_doc_e.doc / V1.2
If the symbol configuration will be modified in online mode, the modified application can be downloaded
via button Download.
Step 3: Login
Note: Instructions for configuring the plc by device description file regarding the behavior of the symbol
configuration can be found in the document “CODESYSControlV3_Manual.pdf” Chapter “6.5.4.1
Symbol configuration”.
If the controller is configured that it downloads the symbols in its own application, the following
happens:
The syntax of the symbol application is:
<Application name>.__Symbols
The application and the child application will be created and downloaded to the PLC. The
symbol file is stored next to the project file as well.
The symbol application has to be regarded as „normal“ application, also concerning the
maximum number of applications on a PLC.
tech_doc_e.doc / V1.2
Note: This version of the OPC Server can only access items of basis data types. For this reason for each object
the options ‘Export structure components’ and ‘Export array entries’ must be activated.
Note: It is recommended to export only those variables/objects for access by OPC, which are really needed.
Step 3: Build
During compilation of the project the symbol file (*.sdb) is generated and stored in the project directory.
Step 4: Login
When the project is transferred to the PLC via command Online -> Login , the symbol file might be
transferred at the same time as well. For this purpose activate option Download symbol file in the
Target Settings.
Note: It is recommended to store the symbol file also on the PLC. This will ensure that the OPC Server always
has access on the symbols, even if the download of the symbol file is done by an other gateway server
than used by the OPC Server.
Note: If the used PLC is an embedded system, the symbol file cannot be transferred! If necessary, please
contact your PLC provider for information. In this case a connection is only possible with the OPC server
over the gateway downloading the program code.
Note: The OPC server doesn’t use a particular file for establishing the connection if it is not registered and
therefore is not the active INI file.
tech_doc_e.doc / V1.2
6.2.1 File
This menu provides commands for loading and saving the configuration files to/from the configuration
tool:
Command Description
Open <Ctrl>+<O> For editing an existing configuration. The default dialog for
tech_doc_e.doc / V1.2
Command Description
show the default settings like after having started the tool.
Save <Ctrl>+<S> Saves the current configuration to the currently loaded INI file.
Regard that modifications of a configuration do not get valid if
the INI file is not the active one.
Save as Saves the current configuration to a file, which you can specify
in the default dialog for storing a file. Regard that modifications
of a configuration do not get valid if the INI file is not the active
one.
<n> recently opened ini-files List of the INI files which had been edited since having started
the tool last time. You can select any of them to get it reloaded
to the configuration tool.
Exit The tool will be terminated. If any changes on the currently
loaded configuration have not yet been stored, you will be asked
whether you want to do that.
6.2.2 Edit
This menu provides the commands for editing the configuration tree in the left part of the configuration.
Command Description
New Redundancygroup A Redundant Group entry will be added below Server. If there
<Ctrl>+<G> are already PLC or Redundant Groups listed in the tree, the new
Redundant Group will be appended at the end. Per default a
new entry is named Redundant<n>, whereby n is a running
number starting with 1. If you want to rename the entry, select it
in the tree and either use command Edit/Rename PLC or
perform a mouse click on the entry to get the string editable.
Append PLC <Ctrl>+<O> A PLC entry will added below Server. A new PLC will always be
appended at the end of the existing tree. Per default a new entry
is named PLC<n>, whereby n is a running number starting with
1. If you want to rename the entry, select it in the tree and either
use command Edit / Rename PLC or perform a mouse click on
the entry to get the string editable.
Delete PLC <Ctrl>+<D> The currently selected PLC entry will be removed from the
configuration tree.
Rename PLC <Ctrl>+<R> The currently selected PLC entry can be renamed.
Reset PLC <Ctrl>+<Z> Not available yet!
The settings of the currently selected PLC entry will be reset to
the default values defined in the PLC Default Settings.
6.2.3 ?
This command opens a message box with information on version, copyright and vendor of the tool.
This dialog is available when the root entry Server is selected in the configuration tree. It provides the
following settings:
- Update Rate (ms): Default: 200
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 data get written into the cash with which the client
communicates with a separately defined update rate. Note: With the status information the
server also provides a parameter Bandwidth Usage giving the ratio of the actual update rate
to the configured update rate in percents.
- Sync Init : Default: not active
If this option is activated, a synchronous connection is initialized.
- Writes produce data change calls: see chap. 7.1, Entry „ReadCyclesAfterWrite“:
- Use Colon as PLC-name separator: see chap. 7.1, Entry „UseColonAsPlcDivider“
- Suppress callbacks on add/remove: see chap. 7.1, Entry „GroupUpdateBehaviour“
Logging
- Enable Logging (Defaultevents): Default: not active
If this option is activated, any actions as well as errors on the OPC server will be recorded in a
LOG file. This file will be stored in the installation directory and will be named OPCServer.log.
After a shutdown of the OPC Server the LOG file can be evaluated. The messages of several
OPC sessions are lined up in one LOG file until it reaches the size of 1 MB. Then the current
date will be added in the file name (OPCServer<date>.log, e.g. OPCServer12.10.2008.log)
and the file will be saved. After that a new LOG file OPCServer.log will be created.
- Log Additional Events: Default: not active
If this option is active, then additional events are written into the LOG file.
- Add Debug Events (slow): Default: not active
If this option is active, then debug events are written into the LOG file.
This dialog is available, if the <PLC> entry is selected in the configuration tree.
- Interface:
Name of the interface used for the communication between programming system and PLC.
3S-Smart Software Solutions GmbH Page 19 of 40
CODESYS_OPC_Server_V3_User_Guide.doc
CoDeSys OPC Server V3
The selection list per default contains the following interface types: ARTI, GATEWAY,
SIMULATION for projects created with CODESYSV2.3; GATEWAY3, SIMULATION3 for V3
projects. Concerning the SIMULATION or SIMULATION3 interface please see chapter 6.3.
- Project name:
Name of the currently concerned symbol file. It has to be used in case of simulation. If there is
no path the file has to be found in the OPC server directory. In CODESYS V3 the symbol file
name follows the syntax:
<project name>.<device>.<application>.xml.
In CODESYS V2.3 :
<project name>.sdb.
Note: This entry is only used if interface SIMULATION or SIMULATION3 is contemporary used too
Here the communication settings as defined for the application in the respective CODESYS V3 project
must be entered. If no communication setting is defined the OPC-Server ends with
STATE_TERMINATE. So have a closer look at the appropriate LOG file, where all sequences the
OPC-Server had done are listed. There you can find the logged and unsuccessful attempts for starting
communication.
For creating a new communication resp. for modifying an existing one, use button Edit to open the
dialog CODESYS address of PLC:
Enter the IP address and port for the gateway and for identifying the PLC specify either the name or
tech_doc_e.doc / V1.2
address (PLC name (recommended) or address), or address and port of the Tcp/Ip blockdriver (Use
Tcp/blockdriver); each the settings must correspond to those defined in Communication Settings tab of
the Device Editor for the concerned CODESYS project. After closing the dialog with OK the settings will
be displayed in the main dialog.
In a CODESYS V2.3 project the valid settings are performed in the dialog Communication Parameters.
From all the channels shown in the tree structure the valid one can be selected for the plc.
Extended configuration is possible via button Expert, in dialog Additional generic parameters:
These settings are described in the programming guide for the PLC Handler; if required, a value can
be edited after a mouse-click in the „value“ column.
6.3.1 SIMULATION3
In the OPC server INI file, a simulation access is configured by selecting the Interface SIMULATION3
and by setting the name of the symbol file in Project name. The symbol file is automatically generated
by a build command of a CODESYS V3 project when a symbol configuration exists and is stored with
the name extension XML next to the project file. If this file is stored in the OPC server directory, then
only the project name has to be specified here. But it can also be copied to any location, then under
Project name also the directory name has to be specified.
Dialog with configuration of a simulated access to the stock of symbols of SimulatedControlWinV3:
6.3.2 SIMULATION
In the OPC server INI file, a simulation access by Gateway V2.3 connection is configured by selecting
the interface SIMULATION and by setting the name of the symbol file in Project name. The symbol file
is automatically generated by a build command of a CODESYS V2.3 project when in Options ->
symbol configuration the corresponding options are set. The symbol file is stored in the same directory
as the project file and has the extension SDB. If the symbol file is stored in the OPC server directory,
then the directory name has not to be specified. But it can also be copied to any location, then under
Project name the directory name has to be specified.
Dialog with configuration of a simulated access to the stock of symbols of SimulatedPLCWinNT:
tech_doc_e.doc / V1.2
connections providing the same set of items. Via a Master Variable it can be controlled from which of
these PLCs primarily will be read.
The needed settings for the OPC server INI file are performed with the tool OPCConfig.exe as follows:
Command Edit/New RedundancyGroup opens the following dialog for configuring a redundant group:
All PLCs currently configured are listed in the Available PLCs window. In order to add a PLC to the
redundancy group, select it here and use the arrow button to add it in the PLCs in this group window.
Regard that all PLCs added to the group must provide identical sets of variables. There, up to
two controls can be selected.
Default PLC: Define the PLC from which the OPC Server should read the items, if the check of the
Master Variable does not provide an unique one.
Select PLC in group to set Master Variable: Select a PLC in the ‘PLCs in this group’ window and enter
an Boolean variable which is used in the application and which should be the “master variable” for this
PLC. The OPC Server will check the master variable of each PLC in the group and will read the values
from that PLC whose master variable is TRUE. If the master variables do not determine uniquely from
which PLC the values should be read, they will be read from the default PLC. The values can only be
written if at least one PLC sets the master variable.
The name of the master variable in CODESYS follows the following syntax:
<Application>.<POU>.<variable>
The name of variables in CODESYS V2.3 contains no application name and global variables contain
no POU name. So the structure looks like:
<POUname>.<variablename>
or
.<NameGlobalVariable>
Note: The CODESYS OPC Server V3 does not work at all with no master variable. If the master
variable of the redundant group is missing, this will be documented in the LOG file.
tech_doc_e.doc / V1.2
LifeCounter Variable (all PLCs in group): Via this variable each PLC can check, whether the OPC
Server is still active. It must be defined for this purpose in all PLCs of the group and the life counter
variable type must be DWORD.
The name of the LifeCounter Variable in CODESYS V3 follows the following syntax:
Application>.<POU>.<variable>
The names of variables in CODESYS V2.3 contain no application name and global variables contain
no POU name. So the structure looks like:
<POUname>.<variablename>
or
.<NameGlobalVariable>
[PLCDefaults]
interface=GATEWAY
active=1
motorola=1
nologin=0
timeout=12
tries=5
buffersize=5000
reconnecttime=13
v3gatewayport=1217
v3gateway=localhost
v3address=1234
tech_doc_e.doc / V1.2
Setting Description
[Config]
vendor=3S-Smart Software Vendor
Solutions GmbH
product=CODESYSOPCDA and Product name
CODESYSOPCAE
[PLCDefaults]
interface=GATEWAY Default interface
active=1
motorola=1
nologin=0
timeout=12
tries=5
buffersize=5000
reconnecttime=13
v3gatewayport=1217 Default settings for connection with CODESYS Gateway V3 .
The settings are used, if a PLC with CODESYS Gateway V3
v3gateway=localhost interface is added.
v3address=0000
tech_doc_e.doc / V1.2
The following table lists the possible options for the logfilter. If multiple entries are to be activated,
these add up and enter the result in ‘logfilter’.
Logfilter Description
15 (16#0000000F) Generate standard log entries.
32 (16#00000020) Generate additional log entries.
48 (16#00000030) Generate debug log entries.
512 (16#00000200) Generate log entries about the memory consumption. The entry
will be created every “memloginterval” seconds.
The most important entry here is the address of the controller. It depends on the interface type, which
settings have to be set.
gatewayport=1217
device=TCP/IP Parameter for the connection to the target device,
parameters=1 where PLC1 is running (dialog Communication
Parameters in the tool OPCConfig):
parameter0=Address
The value to be entered under “value0” is the
value0=050C CODESYS node address and must be identical to
the node address in the programming system.
Thus, after each write request of the client after the writing of a value for this item, a callback is
triggered by the client and after 2 cycles the current value must be updated again.
Eintrag Description
[Server] Settings for the OPC Server
PLCs=2 Connection to two PLCs is intended
PLC0=PLC_A Name of the first PLC: PLC_A
PLC1=PLC_B Name of the first PLC: PLC_B
logevents=1 Switch-On of the log-mechanism
Logfilter=16#ffffffcf Activation of all errors and info, no details
ReadCyclesAfterWrite=2 Please see chap. 7.1 for a description
tech_doc_e.doc / V1.2
Eintrag Description
UseColonAsPlcDivider Here a value can be specified. If it is not zero, the
first “.” (e.g. the one after the PLC-name) is
superseded by a colon.
Updaterate=200 To determine the configurable update rate.
[PLC:PLC_A] Settings for PLC_A
active=1 Active
interfacetype=GATEWAY Thus, a connection will be established via the
GATEWAY with the PLC.
motorola=0 Motorola Byteorder
nologin=1 Login service
timeout=2000 Timeout
tries=3 Number of trials
waittime=10 Waiting time
reconnecttime=5 Reconnect time
buffersize=0 Buffer size: 0 means that the buffer size is got from
the PLC
project=PC.sdb Name and path of the symbol file, which in case of
simulation is concerned. If there is no path, the
symbol file has to be in the OPC server directory.
gateway=Tcp/Ip Settings for the connection to PLC_A ( Connection
client –local gateway via TCP/IP )
gatewayaddress=localhost
gatewayport=1210
device=Tcp/Ip Parameter for the connection to the target device,
where PLC_A is running (Communication
parameters=3
Parameters dialog)
parameter0=Address
value0=127.0.2.1
parameter1=Port
value1=1200
parameter2=Motorola byteorder
value2=No
Parameter3=TargetID
Value3=0 Target ID of the PLC, which serves for routing in a
„routing“ communication driver to with the OPC
Server should connect.
Parameter4=SymbolFilePath Optional entry, via which the PLC Handler
determines, where the recently loaded symbol file
can be stored. First this file will be checked and
tech_doc_e.doc / V1.2
Setting Description
[Server]
PLCs=5
PLC0=ControlWinV3
PLC1=controlWinV3R0
PLC2=controlWinV3R1
PLC3=controlWinV3R2
PLC4=controlWinV3R3
parameters=1
parameter0=Address
value0=ABCD Here you have to specify the node address
of the control as it is defined (in the
Gateway dialog) in CODESYS V3.
3S-Smart Software Solutions GmbH Page 32 of 40
CODESYS_OPC_Server_V3_User_Guide.doc
CoDeSys OPC Server V3
Setting Description
[RedGroup:0]
Name=RedundantGroup Name of the redundant group.
NumPLCs=5 Number of controls in the redundant group.
DefaultPLC=0 Default-plc is PLCName0
PLCName0=ControlWinV3 Name of PLCName0
PLCName1=ControlWinV3R0 Name of PLCName1
PLCName2=ControlWinV3R1 Name of PLCName2
PLCName3=ControlWinV3R2 Name of PLCName3
PLCName4=ControlWinV3R3 Name of PLCName4
tech_doc_e.doc / V1.2
Setting Description
VarMaster3=Application.PLC_PRG.bMaster2 Mastervariable of control PLCName3
VarMaster4=Application.PLC_PRG.bMaster3 Mastervariable of control PLCName4
LifeCounter=Application.GVL.OPCalive Life counter variable of the OPC server.
7.7.1 SIMULATION3
If it is a Gateway V3 connection, which is to be replaced, then under section [<PLCName>] the
interface SIMULATION3 has to be set and in project the directory and the name of the symbol file has
to be set. The directory need not to be set, if the file is stored in the same directory as OPCServer.ini.
Setting Description
[PLC:SimulatedControlWinV3]
interfacetype=SIMULATION3
project=OneSymbol.Device.Application.xml Name of the symbol file (with extension
XML) and eventually the directory name.
These settings can be done with the tool OPCConfig.exe. See chapter 6.3.1 “SIMULATION3”.
7.7.2 SIMULATION
If it is a Gateway V2.3 connection, which is to be replaced, then under section [<PLCName>] the
interface SIMULATION has to be set and in project the directory and the name of the V2.3 symbol file
has to be set. In V2.3, the symbol file is stored in a different format and has the extension SDB. The
tech_doc_e.doc / V1.2
directory need not to be set, if the file is stored in the same directory as OPCServer.ini.
Setting Description
[PLC:SimulatedPLCWinNT]
interfacetype=SIMULATION
project=MyV23Project.sdb Name of the symbol file (with extension SDB) and eventually the
directory name.
hese settings can be done with the tool OPCConfig.exe. See chapter 6.3.2 “SIMULATION”.
In case the entry LOGFileName is invalid, an entry to the Windows Event logger is created.
Example of an error log in the Windows Event Viewer:
tech_doc_e.doc / V1.2
Note: In order to make this connection work, there must be an OPC server running also on the local computer.
Windows 7 64Bit:
tech_doc_e.doc / V1.2
If the operating system Windows 7 64Bit is used, then the above procedure is not possible, because
DCOMCNFG has not registered the component service CODESYSOPCDA . By calling ‘MMC
comexp.msc / 32’ you can register the service and thus a remote connection to an OPC server can be
established.
9 Error Diagnosis
To be checked:
- Is the PLC running?
- Are the communication parameter in the OPC Server OK?
- Is the communication protocol for the PLC valid?
- Is the PLC available on the defined communication channel? (Might be tested with ping via
TCP/IP.)
- Is the cable to the PLC OK?
- If a remote gateway is used, is it started?
Error case: OPC server is connected, but no/incorrect PLCs are listed
If a connection to the OPC server is established but the PLCs are not listed in the way they defined in
the initialization file of the OPCserver, check if the INI-file is in the correct location and has the correct
name as it is defined in the registry („OPCServer.ini“).
Error case: No symbols available (Status NO_CONFIG):
To be checked:
V3.x interface:
- Have symbols been exported? Check this in file
<project name>.<device name>.<application name>.xml
V2.3 interface:
- Is option Dump symbol entries activated in the CODESYS programming system in Project-
>Options, and are variables selected fort his purpose? (Possibly check the SYM file.)
- Is a symbol file (*.sdb) available in the gateway files directory or on the PLC?
- Corresponds the Project-ID of the project in the programming system with that specified in the
symbol file? (Possibly before the restart of the PLC a further download has been done without
creating also a new boot project)
Note:
• The OPC Server will automatically terminated as soon as all clients have closed their
connection to the server.
Change History