InfoPLC Net SoMachine and OPC Server
InfoPLC Net SoMachine and OPC Server
InfoPLC Net SoMachine and OPC Server
1 Overview on OPC
OPC1 is a standardized interface for access on process data. It is based on the Microsoft standard
COM/DCOM2 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.
In the OPC Server the items can be organized in so-called Groups (Private and 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 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 an 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.
Communication between OPC Server and PLC can be carried out via the following interface:
Gateway V3
3 Declare a variable to be used with OPC
Follow the sequence:
• Create a Project (eg: ExampleOPC)
• Add & select a Controller using “Add Device”
• Configure the name of the Application with double click on the name (eg: MyPLCexample)
• Create a Program in your application using “Add Object” when click right on “Application”
• Configure the name of the Program (eg: MyPOUexample)
• Double Click on a task (eg: MAST) & associate the Program (eg: MyPOUexample) to the task
• Make a “Build All” using Build Menu & verify there is no error during Build execution
• Create a Symbol Configuration Object in your application using “Add Object” when click right on
“Application”.
• Select “Symbol Configuration” & click on Open
• Click on “Refresh” link Button
• Expend the “Variables” object”
• Select the variable (eg: VARIABLEEXEMPLE) you want to share with your OPC client from your
Program (eg: MyPOUexample)
• Click on “>”Button to send the variable to shared data base & give access for the OPC Client
• Make a “Build All” using Build Menu & verify there is no error during Build execution
• Close the window “Symbol Configuration”
• You can have a look in the directory where you have stored you Project to see a xml file which
describe the list of the variables which are accessible for OPC client
(eg: ExampleOPC.MyPLCexample.Application.xml)
**************************************************************************************************************
<?xml version="1.0" encoding="utf-8"?>
<Symbolconfiguration xmlns="http://www.3s-
software.com/schemas/Symbolconfiguration.xsd">
<Header>
<Version>3.3.0.0</Version>
<SymbolConfigObject version="3.3.0.0" />
<ProjectInfo name="ExampleOPC" devicename="MyPLCexample"
appname="Application" />
</Header>
<TypeList>
<TypeSimple name="T_UINT" size="2" swapsize="2" typeclass="UInt"
iecname="UINT" />
</TypeList>
<NodeList>
<Node name="Application">
<Node name="MYPOUEXAMPLE">
<Node name="VARIABLEEXAMPLE" type="T_UINT" access="ReadWrite" />
</Node>
</Node>
</NodeList>
</Symbolconfiguration>
**************************************************************************************************************
• Go to the directory:
C:\Program Files\Schneider Electric\SoMachine\CoDeSys OPC Server 3
• Double Click on :
WinCoDeSysOPC.exe
• Go to the directory:
C:\Program Files\Schneider Electric\SoMachine\CoDeSys OPC Server 3
• Double Click on :
OPCConfig.exe
The configuration tool OPCconfig.exe allows to generate an ini-file which is needed to initialize the
OPC Server with the desired parameters for the communication between CoDeSys project and
PLC(s).
The configuration tool contains a menu bar, a tree view for mapping the assignments of one or several
PLCs to the Server, and a configuration dialog always corresponding to the currently selected tree
entry. After having started the tool, primarily it will appear as follows, only containing the default
common settings:
5.1 File menu
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
opening a file will appear, where you can select an already
existing ini-file. The filter is automatically set to „OPCconfg Files
*.ini“. The configuration described in the chosen ini-file will be
loaded to the configuration tool.
New <Ctrl>+<N> For creating a new configuration. If currently already a
configuration is opened you will be asked whether it should be
saved before getting closed. Then the configuration tool will 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 before
having got saved to the respective configuration file.
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 before having got saved to the
respective configuration file.
<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.