Manual
2 Quick Start
3 Basics of OLE
4 Basics of OPC
5 Structure of the OPC Items for the SIMATIC NET Data Access Interface
14 Glossary
A SIMATIC Computing
6GK1971-0BA00-0AA1 Release 3
We have checked the contents of this manual for The reproduction, transmission or use of this
agreement with the hardware described. Since document or its contents is not permitted without
deviations cannot be precluded entirely, we cannot express written authority. Offenders will be liable for
guarantee full agreement. However, the data in this damages. All rights, including rights created by patent
manual are reviewed regularly and any necessary grant or registration of a utility or design, are reserved.
corrections included in subsequent editions.
Suggestions for improvement are welcome. 6GK1971-0BA00-0AA1
Technical data subject to change. Copyright © Siemens AG 1997
All Rights Reserved
Manual C79000-B8976-C126/3
Note
We would point out that the contents of this product documentation shall not become a part of or modify any prior or
existing agreement, commitment or legal relationship. The Purchase Agreement contains the complete and exclusive
obligations of Siemens. Any statements contained in this documentation do not create new warranties or restrict the
existing warranty.
We would further point out that, for reasons of clarity, these operating instructions cannot deal with every possible problem
arising from the use of this device. Should you require further information or if any special problems arise which are not
sufficiently dealt with in the operating instructions, please contact your local Siemens representative.
General
This device is electrically operated. In operation, certain parts of this device carry a dangerously high
voltage.
WARNING !
Failure to heed warnings may result in serious physical injury and/or material damage.
!
Only appropriately qualified personnel may operate this equipment or work in its vicinity. Personnel
must be thoroughly familiar with all warnings and maintenance measures in accordance with these
operating instructions.
Correct and safe operation of this equipment requires proper transport, storage and assembly as well
as careful operator control and maintenance.
Qualified personnel as referred to in the operating instructions or in the warning notes are defined as persons who are
familiar with the installation, assembly, startup and operation of this product and who possess the relevant qualifications for
their work, e.g.:
− Training in or authorization for connecting up, grounding or labeling circuits and devices or systems in accordance with
current standards in safety technology;
− Training in or authorization for the maintenance and use of suitable safety equipment in accordance with current
standards in safety technology;
Contents
Guide to the The documentation for the OPC Server for SIMATIC NET consists of
Documentation two parts
• "Introduction to the OPC Server for SIMATIC NET" (this manual)
• "OLE for Process Control Standard" - OPC Interface Description
These manuals are available only:
− in English
− as files that are written to the "DOC" folder during installation of
the product. You can read and print these files using a word
processing program capable of opening Word 6.0 compatible
files.
History This manual is valid for product versions V 2.1 and higher.
Descriptions of the following product properties have been added in
this release of the manual:
OPC OPC is an acronym for OLE for Process Control and is used as the
name for a standard interface for communication in automation
engineering. OLE itself means the component model of Microsoft.
Components are the software objects or applications that provide their
functionality to other applications.
OPC Interface The OPC interface is the specification of a uniform and vendor-
independent software interface based on OLE. It was developed as
an industrial standard by leading firms in the field of automation with
the support of Microsoft.
OPC Specification: Apart from the specification for access to process data (data access),
the OPC standard includes further specifications for other areas of
automation engineering:
• Alarms & Events
• Historical Data Access
OPC Server An OPC server is a program that provides the standardized OPC
interface for applications from various manufacturers.
Communication via industrial networks is possible with simple calls.
The, at times, complicated handling of vendor-specific characteristics
on communications networks is disguised by the OPC server.
Regardless of the communications network and protocol being used,
access to the process via the OPC interfaces is always uniform.
An OPC server forms an intermediate layer between the applications
allowing process data, the various network protocols and interfaces for
access to this data to be processed.
OPC Server for The OPC server of SIMATIC NET allows Windows applications access
SIMATIC NET to SIMATIC NET products for industrial communication. The
requirement for connecting your applications with SIMATIC NET
products is the use of the open OPC interface. The interface to the
products of SIMATIC NET is implemented by the OPC server for
SIMATIC NET.
The OPC server for SIMATIC NET supports the interface "OPC Data
Access" for all protocols. The "OPC Alarms & Events" interface is
available for those protocols whose protocol mechanisms support the
sending of events. (For details of the product version, refer to the
section "Notes for the Reader").
Additional To access process variables and receive events via the OPC server
SIMATIC NET for SIMATIC NET, you also require a protocol software belonging to
Components SIMATIC NET and a SIMATIC NET communications processor.
Required
OPC Server for The following diagram illustrates an OPC server for SIMATIC NET
SIMATIC NET with along with an application known as the OPC client.
OPC Client The OPC server for SIMATIC NET provides the OPC client with the
values of process variables or signals events from the partner device.
The OPC server for SIMATIC NET accesses the partner device via the
communications network using the protocol software and the
SIMATIC NET communications processor.
Advantages when If you use the OPC server for SIMATIC NET along with the
Installing a System SIMATIC NET protocols, you have the following benefits:
• You use a protocol-independent interface.
• You obtain simple access to the communications networks of
SIMATIC NET.
• You can connect your programmable controllers to a wide variety of
automation engineering applications via a SIMATIC NET
communications network.
• Communication is also possible with office applications such as
Microsoft Excel, Access etc.
• Using the OLE mechanism “DCOM”, applications installed on other
computers can access the services provided by the OPC server via
a local or global network (Internet).
Benefits for the When you develop an application that accesses process data via the
Developer OPC interface of an OPC server for SIMATIC NET, you have the
following benefits:
• The OPC interface is a heterogeneous (vendor-independent)
interface. This opens up a larger market for your product, increases
the usability of your developments, and makes your investment
more viable.
• The developed applications are not dependent on the
communications system of one manufacturer and with appropriate
programming can communicate unchanged with the OPC servers
of other manufacturers.
• The OPC interface provides applications with a powerful means of
access to OPC servers and the underlying communications
networks.
• OPC has a high-performance interface for the C/C++ programming
language.
• Convenient and simple access to process data is possible with
development environments such as Visual Basic (Microsoft).
• The developer no longer needs to be involved with protocol and
vendor-specific interfaces.
• Troubleshooting is simplified with the option of a trace output.
User Groups The OPC server for SIMATIC NET is used by the following user
groups:
• Developers of client applications (products for automation
engineering)
• Installation personnel
If you are using OPC client applications exclusively, the following
information is unnecessary. The OPC client-server architecture is
transparent for the user.
Background The following table shows the required background knowledge for
Knowledge different user groups.
Who Should Read Not everyone needs to read everything! A programmer naturally
What? requires more information than installation personnel.
The following table recommends what each user group should read.
2 Quick Start
Introduction The OPC server provides uniform access via various industrial
communications systems. To use the OPC server, the underlying
communications system must be installed and configured. The
following sections list the steps necessary for the various protocols.
Requirements Before you can work through the procedures outlined below, you
require the software products as described in the installation
instructions.
Step Procedure
1 Installing the Communications Processor
Insert the communications processor as described in the installation instructions for the
module.
Now start the "Setting the PG/PC Interface“ configuration program and click the "Install"
button.
Select the module you want to install.
2 Creating the Configuration
Along with the software for the DP protocol, the "COM PROFIBUS“ configuration tool was
also installed.
Start this program so that you can create a description of your DP communications system
in a database.
When you have completed your configuration, create a binary database that can be
downloaded to the CP using the "Export => NCM File“ menu item.
3 Assigning an Interface Parameter Set
Start the "Setting the PG/PC Interface“ configuration program.
Select the access point of the application "CP_L2_1:".
Assign the interface parameter set for the DP mode corresponding to your module to this
access point (for example CP5412A2 (PROFIBUS) or CP 5511 (DP master )).
4 Configuring the Communications Processor
Click the "Properties“ button.
Select the tab for configuring the DP protocol and enter the path and name of the loadable
binary database (*.ldb) you have just created in the dialog that is displayed. Some modules
also require explicit activation of the DP protocol ("DP“ check box).
Close the configuration program.
5 Testing the Communications Processor
Start the "Setting the PG/PC Interface“ configuration program again.
Select the access point of the application "CP_L2_1:" and click the "Diagnostics" button.
Check that the module is functioning correctly.
6 Using the OPC Scout
Follow the steps outlined in Section 2.4 for the quick start.
Step Procedure
1 Installing the Communications Processor
Insert the communications processor as described in the installation instructions for the
module.
Now start the "Setting the PG/PC Interface“ configuration program and click the "Install"
button.
Select the module you want to install.
2 Creating the Configuration
Along with the software for the S7 protocol, the "COM S7“ configuration tool was also
installed.
Start this program so that you can create a description of your S7 communications system
in a database.
When possible, use only one VFD for all connections.
When you have completed your configuration, create a binary database that can be
downloaded to the CP using the "File => Generate Binary DB ...“ menu item.
As an alternative, you can also use the NCM configuration tool.
3 Assigning an Interface Parameter Set
Start the "Setting the PG/PC Interface“ configuration program.
Select the access point of the application.
If you communicate via PROFIBUS or MPI, select "CP_L2_1:", If you work with Industrial
Ethernet, select "CP_H1_1:".
Assign the interface parameter set for the S7 mode corresponding to your module to this
access point (for example CP 5412A2(PROFIBUS), CP 1613 or similar).
4 Configuring the Communications Processor
Click the "Properties“ button.
Select the tab for configuring the S7 protocol and enter the path and name of the loadable
binary database (*.ldb) you have just created in the dialog that is displayed.
If required, activate the S7 protocol using the "S7“ check box.
Close the configuration program.
5 Testing the Communications Processor
Start the "Setting the PG/PC Interface“ configuration program again.
Select the access point of the application used previously and click the "Diagnostics" button.
Check that the module is functioning correctly.
6 Configuring the OPC Server
Start the configuration program for the OPC server ("OPC Settings“).
Select the "S7 Protocol" tab.
Select the CP/VFD pairs containing the access points corresponding to your network type.
("CP_L2_1:“ or "CP_H1_1:“).
Close the configuration program.
7 Using the OPC Scout
Follow the steps outlined in Section 2.4 for the quick start.
Step Procedure
1 Installing and starting up the S7 protocol
Install and start up the S7 protocol for access to process variables as described in Section
2.1.2. Close all OPC clients to quit the OPC server.
2 Opening the configuration file
Start the configuration program for the OPC server and open the "S7 Protocol" tab. Click the
"Edit S7 Configuration File" button; the text database for configuring the S7 OPC server is
opened ( default: SscoreS7.txt").
3 Entering the connection configuration
In the section for the connection, enter the following for the connection via which the alarms
and events will be received (for example [MyAlarmCon|MyOPCVFD|CP_L2_1:]:
Events=3 ; Activate Alarm&Event mechanism
InitiateReq=2 ; Maintain connection permanently
4 Severity entry
For each alarm and each scan event, you can select the severity in a range from 1 to 1000
(optional). You can also define a default value for alarms and scans:
DefaultScan=300 ; Severity of the scan events is 300
DefaultAlarm=600 ; Severity of the alarms is 600
Scan123=200 ; The scan with ID 123 has severity 200
Alarm222=900 ; The alarm with ID 222 has severity 900
5 Saving the configuration file
Save the configuration file and start a client for OPC Alarm & Events.
Step Procedure
1 Installing the Communications Processor
Insert the communications processor as described in the installation instructions for the
module.
Now start the "Setting the PG/PC Interface“ configuration program and click the "Install"
button.
Select the module you want to install.
2 Creating the Configuration
The "COM PROFIBUS“ configuration tool was installed along with the software for the FMS
protocol.
Start this program so that you can create a description of your FMS communications
system in a database.
When possible, use only one VFD for all connections.
When you have completed your configuration, create a binary database that can be
downloaded to the CP using the "Export => NCM File“ menu item.
3 Assigning an Interface Parameter Set
Start the "Setting the PG/PC Interface“ configuration program.
Select the access point of the application "CP_L2_1:".
Assign the interface parameter set for the FMS mode corresponding to your module to this
access point (for example "CP5412A2 (PROFIBUS)“ ).
4 Configuring the Communications Processor
Click the "Properties“ button.
Select the tab for configuring the FMS protocol and enter the path and name of the loadable
binary database (*.ldb) you have just created in the dialog that is displayed.
Activate the FMS protocol in the "FMS“ check box.
Close the configuration program.
5 Testing the Communications Processor
Start the "Setting the PG/PC Interface“ configuration program again.
Select the access point of the application "CP_L2_1:" and click the "Diagnostics" button.
Check that the module is functioning correctly.
6 Configuring the OPC Server
Start the configuration program for the OPC server ("OPC Settings“).
Select the "FMS Protocol" tab.
Click the "Select..." button to select the CP/VFD pairs to be used by the OPC server.
By selecting the relevant check boxes in the lower part of the dialog, select the CP/VFD
pairs you require that have the access point "CP_L2_1:".
7 Using the OPC Scout
Follow the steps outlined in Section 2.4 for the quick start.
Requirements The partner devices are configured on the Industrial Ethernet network
and the required handling blocks or function blocks are called.
Step Procedure
1 Installing the Communications Processor
Insert the communications processor as described in the installation instructions for the
module.
Now start the "Setting the PG/PC Interface“ configuration program and click the "Install"
button.
Select the module you want to install.
2 Assigning an Interface Parameter Set
Start the "Setting the PG/PC Interface“ configuration program.
Select the access point of the application (CP_H1_1: ).
Assign the interface parameter set corresponding to your module to this access point (for
example “CP 1613“).
3 Testing the Communications Processor
Start the "Setting the PG/PC Interface“ configuration program again.
Select the access point of the application used previously ("CP_H1_1:") and click the
"Diagnostics" button.
Check that the module is functioning correctly.
4 Configuring the OPC Server
Start the configuration program for the server ("OPC Settings“).
Select the "SR Protocol" tab.
Select the access point "CP_H1_1:“. Close the configuration program in the lower part of
the dialog.
5 Starting the OPC Scout
Carry out steps 1 and 2 in Section 2.4 to start the SR-OPC server for the first time using the
OPC Scout. When it is first started, the SR-OPC server enters default values in the text
database (see Section 8.6) that make subsequent configuration easier.
Close the OPC Scout.
6 Configuring the OPC Server
Start the configuration program for the SR-OPC server and click the "Edit SR Configuration
File". The text database for configuring the SR-OPC server is opened with a text editor.
In the section "[CP_H1_1: (Connections)], enter the definitions for the required connections
using the following notation: (see Section 9.3.2 in this manual)
Connection name=LocalTSAP, HostID, RemoteTSAP, ActiveFlag.
With this information about the connection, the OPC server can access the configured send
or receive buffers on the partner device.
Finally, save the text file.
7 Using the OPC Scout
Follow the steps outlined in Section 2.4 for the quick start.
Requirements The partner devices are configured on the PROFIBUS network and the
required handling blocks or function blocks are called.
Step Procedure
1 Installing the Communications Processor
Insert the communications processor as described in the installation instructions for the
module.
Now start the "Setting the PG/PC Interface“ configuration program and click the "Install"
button.
Select the module you want to install.
2 Assigning an Interface Parameter Set
Start the "Setting the PG/PC Interface“ configuration program.
Select the access point of the application (CP_L2_1: ).
Assign the interface parameter set corresponding to your module to this access point (for
example “CP 5611 (PROFIBUS) “).
3 Testing the Communications Processor
Start the "Setting the PG/PC Interface“ configuration program again.
Select the access point of the application used previously ("CP_L2_1:") and click the
"Diagnostics" button.
Check that the module is functioning correctly.
4 Configuring the OPC Server
Start the configuration program for the server ("OPC Settings“).
Select the "FDL Protocol" tab.
Select the access point "CP_L2_1:“. Close the configuration program in the lower part of
the dialog.
5 Starting the OPC Scout
Carry out steps 1 and 2 in Section 2.4 to start the FDL-OPC server for the first time using
the OPC Scout. When it is first started, the FDL-OPC server enters default values in the text
database (see Section 8.7) that make subsequent configuration easier.
Close the OPC Scout.
6 Continuing OPC Server Configuration
Start the configuration program for the OPC server and click the "Edit FDL Configuration
File" button. The text database for configuring the FDL-OPC server is opened with a text
editor.
In the section "[CP_L2_1: (Connections)], enter the definitions for the required connections
using the following notation: (See Section 8.7 in this manual)
Connection name=LocalTSAP, Station, RemoteSAP.
With this information about the connection, the OPC server can access the configured send
or receive buffers on the partner device.
Finally, save the text file.
7 Using the OPC Scout
Follow the steps outlined in Section 2.4 for the quick start.
Step Procedure
1 Installing the Communications Processor
Insert the communications processor as described in the installation instructions for the
module.
Now start the "Setting the PG/PC Interface“ configuration program and click the "Install"
button.
Select the module you want to install.
2 Assigning an Interface Parameter Set
Start the "Setting the PG/PC Interface“ configuration program.
Select the access point of the application "DPSONLINE".
Assign the interface parameter set for the DP mode corresponding to your module to this
access point (for example "CP 5611 (PROFIBUS DP Slave)“ ).
3 Testing the Communications Processor
Start the "Setting the PG/PC Interface“ configuration program again.
Select the access point of the application "DPSONLINE" and click the "Diagnostics" button.
Check that the module is functioning correctly.
4 Processing the GSD File
The configuration of the DP slave is specified in a GSD file (*.gsd). Along with the software
for the DP slave, a sample file was also installed. If you want to modify the configuration of
the slave, you must adapt this file.
For more information on the structure of a GSD file, refer to the "DP Slave Programming
Interface for CP 5411, CP 5511 and CP 5611" manual.
5 Configuring the OPC Server
Start the configuration program for the server ("OPC Settings“).
Select the "DP Slave" tab. Select the access point "DPSONLINE".
Now click the "Edit DPS Configuration File" button. The text database for configuring the DP
slave OPC server is opened with a text editor.
Enter the path and file name of the GSD file of your slave in the section [DPSONLINE].
Finally, save the text file.
Close the configuration program.
6 Using the OPC Scout
Follow the steps outlined in Section 2.4 for the quick start.
Description The OPC server allows you to use simulated connections for all
protocols. This connection with the fixed name "DEMO" simulates a
connection to a partner device.
Requirements The simulation variant of the OPC server for SIMATIC NET can be
used without a communications processor.
Properties The simulation connection has the name DEMO. The simulated device
provides several variables depending on the particular protocol. You
can configure some of the properties of the simulation connection
yourself. For further information about configuring properties, refer to
Chapter 8
How the Before you can work with the simulation connection, this must be
Connection Works activated (see below). If you have not installed underlying protocol
software, the simulation connection is detected automatically.
In this case, the configuration program cannot be started.
After activating the simulation connection, a virtual partner station with
several variables is available. You can use all the OPC functions with
☞ these slaves.
Activating the Carry out the following steps to activate the simulation connection of
Simulation the OPC server for SIMATIC NET.
Connection
Step Procedure
1 Close the OPC server
If the OPC server for SIMATIC NET is already activated, close this application.
2 Start the Configuration Program
Start the “OPC Settings” program in the Start menu of Windows (taskbar (Start =>
SIMATIC => SIMATIC NET => OPC Server => OPC Settings)
3 Activate the Simulation Connection
Change to the tab for the relevant protocol and activate the "Activate simulation connection"
check box.
When you no longer require the simulation connection, deselect this check box.
Introduction For the quick start, you use the program “OPC Scout” to test the OPC
server for SIMATIC NET. This OPC client is a powerful Visual Basic
application for testing and installing a system.
Range of With the sample program “OPC Scout”, you can do the following:
Functions
• Investigate the process area of your communications network
• Generate OPC groups
• Select and include process variables as items in a group
• Read and write values
Sample Programs Once you have got to know the OPC server with the OPC Scout, you
can get to know the principles of programming the OPC server using
the supplied sample programs for Visual Basic and for C++ in the
"SAMPLES" folder.
The sample programs are described in the file "EXAMPLE" in the
"SAMPLES" folder.
Procedure Follow the steps outlined below to familiarize yourself with the OPC
server for SIMATIC NET using the “OPC Scout” sample program:
Step Procedure
1 Starting the “OPC Scout” Program
Now start the "OPC Scout" program (Start => Programs => SIMATIC NET =>
OPC Server => OPC Scout)
2 Connecting to the OPC Server
Select the OPC server in the left-hand box "Servers and Groups“ using the mouse.
• For SIMATIC NET (OPC.SimaticNet)
Select the "Connect" menu command from the "Server" menu.
Reaction: The selected OPC server is started. This can take several seconds.
3 Creating a Group
In the "Add Group“ dialog, you can enter any name for a group and confirm your
entry with OK.
Reaction: The name of the newly created group is displayed in the "Servers and
Groups“ box below the selected server.
4 Investigating the Process Area
Select the group you created in the "Servers and Groups“ box and click the "Add
Item" command in the "Group“ menu.
Reaction: In the "OPC Navigator" dialog that appears now, you can investigate the
process area of the OPC server. The left column shows the hierarchical structure of
the process area. If you double-click an entry, the next level is displayed. The
middle column lists the variables available at a level.
5 Adding OPC Items
Select the variables displayed in the middle column.
Now click the arrow "=>“. The selected variables are displayed in the right column
and are therefore selected for inclusion in the current group.
Click "OK“ to insert the variables in the current group.
Reaction: The dialog is closed. In the table in the main window, you will see the
selected variables and their attributes (for example value, time stamp).
Step Procedure
6 Writing a Value
If you have selected a writeable variable (W or RW attribute), you can assign a new
value to this process variable.
Click the line containing the variable to be modified and click the "Write Values"
command in the "Item“ menu.
Enter a new value in the dialog and confirm your entry with "OK“.
Reaction: The dialog is closed. The table displays the new value and the result of
the operation (write result).
Getting to Know You should experiment with the functions of the OPC Scout. Try out
the Rest of the the right mouse button when you have selected an object. With many
Program elements, a context-sensitive menu is displayed that illustrates which
operations you can perform with the particular object.
3 Basics of OLE
Introduction With OLE 1, it was possible for the first time under Microsoft Windows
3.1 to combine different and basically independent applications with
each other. This represented a significant step towards modularization
of user software. With the OLE 2 standard used by OPC, Microsoft has
not only extended OLE 1 but has also introduced a new far-reaching
architecture and has changed the thinking behind the development of
software under Microsoft Windows.
COM The basis of all OLE mechanisms is COM, the Component Object
Model from Microsoft.
COM defines a standard that allows objects to be defined as separate
units in Windows and to access these units beyond the limits of a
process.
Objects can be understood as extensions of the operating system.
They are not dependent on programming languages and are available
in principle to all applications. The COM component model is a client-
server architecture.
The server is the object that provides services.
The client is an application that uses the services of an object. Clients
are often also known as container applications.
DCOM With Windows NT, Version 4, the COM specification was extended to
allow objects to be accessed outside a local computer. The objects
used by an application are distributed within a network. This extension
of COM is known as DCOM (Distributed COM).
The Term OLE objects are units in Windows that provide other objects with
OLE Object defined functions via their interfaces. OLE objects provide their
services via defined interfaces. The “content” of the object, data and
code, remains hidden to the object user. OLE objects are defined by
their interfaces.
The term “object” in the sense of OLE is not the same as the object
definition in object-oriented programming languages. OLE objects, for
example, do not support inherit functions.
Structure of an The following diagram illustrates an OLE object with 4 interfaces (as
OLE Object an example). The object is accessed via only one of the interfaces. It is
not possible to access the actual object as a whole, nor the data or
code it contains. The interfaces hide the methods assigned to them.
M1 M2 M3 M4
Method 1
OLE Object
Data and
code
M1 M2 M3 M4
The Term Interface Objects can have more than one interface and are described
completely by their interfaces. The methods (object functions) can only
be executed via the interfaces and object data can only be accessed
via the interfaces.
Objects can be used by more than one application. An interface
consists of a table of pointers to the actual functions.
Caller
Interface pointer
Interface
Representation of The diagram below clearly shows that an object is defined by its
an OLE Object interfaces. The user of an object can only ever obtain access to the
object via the interfaces. A pointer to the object itself does not exist.
IUnknown
Interface A
Interface B
Interface C
Object X
Interface D
Access for Script The interfaces of COM described up to now are less suitable for the
Languages range of functions of development tools based on script languages. By
extending the OLE objects with a distributor interface, the methods of
the objects are accessible for simple script languages. This allows the
simple embedding of an OLE object, for example in development
environments such as Visual Basic, Delphi or Power Builder. The
development tools disguise all details of the object calls.
Programmable access to OLE automation servers is defined by
properties and methods.
4 Basics of OPC
This chapter explains the concept of OPC. You will see the role of OLE in OPC. The
chapter also explains the concept of the OPC interface and the class model on which it
is based. The chapter also provides you with more detailed information about the client-
server architecture of OPC.
OPC Server as Part An OPC server provides a vendor-independent interface. By using the
of the Operating COM component model, the OPC server becomes similar to part of
System the Windows operating system and is therefore independent of file
names, storage locations and versions.
Why OLE? These characteristics and, not least, the widespread use of Microsoft
Windows operating systems prompted the development of a vendor-
independent interface based on COM and therefore also on OLE.
Powerful A further advantage of OLE is the possibility of editing the OLE objects
Development in a powerful development environment (Visual Basic, Delphi and
Environments others).
Data Access The OPC Data Access specification is the fundamental and first
specification of the OPC Foundation. The OPC Data Access
specification offers functions for management of process variables and
various opportunities for access to variables. Variables can be read
and written synchronously and asynchronously. OPC Data Access also
defines the possibility of sending a message to a client if a variable
changes.
To use an OPC variable, a client must first register the variable with
the OPC server. The client therefore defines the values and the points
in time that are of interest to it.
The application gets a "snapshot" of the process values from the point
in time at which the read job was executed. Values between these
points may not be acquired by the application. When monitoring
variables, internal cyclic read jobs are sent.
Alarms & Events OPC Alarms & Events is an additional specification for the transfer of
process alarms and events. It is basically independent of the Data
Access specification.
OLE Interfaces An OLE component provides objects and their methods for other
components or applications. These objects are accessed via the OLE
interfaces. An interface in the sense of OLE is a group of logically
related functions.
Two Types of The OPC server for SIMATIC NET supports two different types of OLE
Interface interface:
• Automation interface
• Custom interface
Both interfaces are used for the communication between objects.
The automation and custom interfaces differ from each other in the
way in which the methods of an interface are called internally. This
means that there are also two different interface specifications for the
OPC server:
• Interface specification of the automation interface
• Interface specification of the custom interface
OPC Specification: Both types of interface are possible in principle for all OPC
specifications. Both interface types are available for the basic
specification "OPC Data Access".
Only the custom interface is available for "OPC Alarms & Events".
Representation of The following schematic shows an example of the types of applications
the OPC Server can by used via which interfaces of the OPC server.
C/C++ application
Custom
interface
OPC server
Specific vendor
Visual Basic hardware
application
Automation
interface
When is Which Client applications based on a script language such as Visual Basic or
Interface Used? VBA must use the automation interface.
Applications in the C/C++ programming language should use the
custom interface for maximum performance.
It is also possible to use the automation interface in C/C++.
Structure The OPC specification for data access groups the interfaces and their
methods into three hierarchical classes. This structure is known as a
class model.
Both the automation and the custom interface of OPC Data Access are
based on this class model. The classes are implemented by OLE
objects simply called objects in the following text.
OPC-Server
1:n
OPC-Group
OPC-Item
“OPC Server” The highest class is the OPC server class. The OPC server class has
Class various attributes that contain information about the status, the version
etc. of an OPC server object. The OPC server class also has methods
with which the client can manage the objects of the OPC group class.
A client application addresses only an object of this class directly using
COM mechanisms. The other objects are created by corresponding
OPC methods.
"OPC Group“ The “OPC Group” class manages the individual process variables, the
Class OPC items. Using these group objects, a client can form semantically
meaningful units of OPC items and execute operations with them.
All the process variables of machine A could, for example, be put in
one group and the process variables of machine B in a second group.
On the other hand, all the process variables of a screen page of an
operator interface system could be put together in one group. When
the page is displayed, the group would be activated.
“OPC Item” Class An object of the class OPC item represents a link to a process
variable, for example to the input module of a programmable
controller. A process variable is data of the process I/Os that can be
written and/or read, for example the temperature of a tank.
An object of the server class can be considered as a container for
objects of the OPC group class.
An object of the OPC group can be considered as a container for
objects of the OPC item class.
Structure To be able to use the OPC Alarms & Events interface for widely
differing sources of events, it has an extremely flexible structure. It can
be used for simple event sources that, for example, provide
information about the failure of a system component or for complex
events requiring status messages and confirmation. Such events are
specified using conditions.
Example of a condition: The temperature in a process exceeds a
defined limit value.
Event Messages An event is the occurrence of a situation that is of interest to the user.
The user is informed of such an event in a message.
The specification for OPC Alarms & Events defines three types of
messages:
• Condition-Related Events
signal the state changes defined in the OPC state model and are
linked to defined conditions
• Tracking Events
signal changes in the process, for example resulting from user
intervention. (Example: The user modifies the setpoint of a
controller)
• Simple Events
Simple events include all other events. These do not have a state.
A typical simple event is the failure of a system component.
OPC Event
Server
1 1
1:n 0:n
"OPC Event A client application accesses the objects of the "OPC Event Server"
Server" Class class using COM mechanisms. This means that the application can
receive events supplied by the OPC Event server. The most important
task of the OPC Event server is to manage the logging on of various
clients for events. The OPC Event server also provides information
about the supported event categories and parameters.
"OPC Event Using the OPC Event server, a client creates one or more OPC
Subscription" Subscription objects. A subscription can be understood as the client
Class subscribing to a group of events. Using the subscriptions, filters and
other attributes are managed for the specific client.
"OPC Event Area OPC Alarms & Events provides the option of structuring large systems
Browser" Class into areas. Areas can be used to filter events. The use of the optional
object "OPC Event Area Browser" allows the areas to be investigated.
111
1 OPC Event Server
Client
2 OPC Event
Subscription
3 Connection Point
Container
On Event 4 Connection Point
Definition The OPC specification supports group operations with various methods
for objects of the OPC group class. A group operation means that
more than one object can be addressed with a single method call.
Benefits for the It is, for example, possible to read all OPC item objects of a group with
OPC User a single command by calling the OPC Data Access method “Read”. In
the OPC Alarms & Events specification, all events are transferred by
calling the "OnEvent" function.
Types of OLE Depending on the way in which the server is linked, an OLE server can
Servers be divided into three types:
• In-Process Server
• Local Server
• Remote Server
The calling application does not need to distinguish the type of server it
addresses. The syntax of the method calls is the same for all.
In-Process Server An In-Process Server is in the same process area as the client and is
only available for this process. Normally In-Process Servers are
implemented as DLLs. Only the OPC automation interface of the OPC
server for SIMATIC NET is implemented an In-Process Server that
implements the automation interface. The In-Process Server accesses
the local server via the OPC custom interface.
Local Server A Local Server runs on the same computer as the client. Like every
independent application, it has its own process and address area. The
OPC server for SIMATIC NET is a local server and is implemented as
an EXE file.
Access to The following diagram shows which components of the OPC server for
Components SIMATIC NET are accessed by various types of clients:
OPC
Visual In-Proc server
Basic client
Automation
interface OPC local Protocol
(as DLL) server software
and
hardware
Custom linking
interface
(as EXE)
C/C++
client
This chapter explains certain terms used in the description of the interfaces. For a
complete description of the OPC terminology, refer to the OPC specifications located as
files in the “DOC” directory of the OPC server for SIMATIC NET.
Where this is useful, special features of the OPC server for SIMATIC NET are pointed
out in this chapter.
Structure of the The terms are sorted alphabetically. For each turn, you can also see
List which environment the turn belongs to: OLE, OPC Data Access, OPC
Alarms & Events (A&E) or Windows (see Figure Page 13).
Special Features of Notes relating to the characteristics of the OPC server for
the OPC Server SIMATIC NET are enclosed in a box like this and should be read
from SIMATIC NET carefully.
Active State Apart from the possibility of reading or writing the values of a process
(OPC Data Access) variable, an OPC server also allows process variables to be monitored.
Monitoring means that the server checks whether the value of the
process variable has changed after a time interval (see monitoring
interval) has elapsed. If the value has changed, the new value is sent
automatically to the client. The client can control the monitoring of a
process variable by setting the active state. Each group and each OPC
item object has the active state attribute.
If a client wants to monitor a process variable, it sets the active state of
the OPC item that represents the link to this process variable to TRUE.
The active status of the group must also have the value TRUE .
If a group is not active, there is no monitoring of the process variables
in this group.
The OPC Event server for SIMATIC NET does not support the
concept of areas.
Cache The cache is a buffer for all variables that are referenced via OPC
(OPC Data Access) items. The cache is global for all users. This means that if more than
one user references the same variable, this is stored only once in the
cache.
Read operations (read or refresh) can read the data from the server
cache with the option OPC_DS_CACHE.
Categories Using categories, the events supported by an OPC Event server can
(OPC A&E) be grouped and therefore selected. The definition of the categories is
left up to the vendor of an OPC Event server; the OPC specification
defines a list of recommended event categories.
Condition A condition is a defined state of the OPC Event server. Conditions can
(OPC A&E) include subconditions. Example: A condition of the "Level" variable is
the level alarm with the subconditions HighAlarm, HighHighAlarm,
LowAlarm and LowLowAlarm.
The OPC Event server for SIMATIC NET does not support
conditions and subconditions.
The value of the OPC item ID for the OPC server for SIMATIC NET
depends on the protocol. Section 5 describes the structure of the
OPC item ID for the OPC server for SIMATIC NET.
LCID Abbreviation for Local ID. The LCID provides information about the
(Windows) regional setting selected by the user for the Windows operating
system.
This information affects the way in which certain regional information is
displayed. You can query the LCID using a Windows API call.
The OPC server for SIMATIC NET displays error texts either in
German or in English.
OPCHANDLE OPCHANDLEs are used for groups and OPC items. They allow fast
(OPC) access to the various objects both for clients and for the server.
The value of a handle depends on the particular implementation.
Clients cannot make any assumptions about the range of values. In the
same way, servers cannot make assumptions regarding client handles.
Server OPCHANDLEs are only valid during the existence of an OPC
server object. It is therefore not possible to save them and use them
again after starting a client. A server group handle is always unique
within a server. An OPC item group handle is unique within a group.
Client handles must be used for asynchronous operations since they
are returned in the callback as an OPC item identification.
Requested Data By specifying the requested data type, a user can determine the data
Type type of a variable. If the data type is not specified explicitly by the user,
(OPC Data Access) the variable has the canonical data type. The OPC specification
specifies the conversion only for scalar types. The OPC server for
SIMATIC NET can also convert all data types (including arrays) to
VT_BSTR.
Time Bias Time bias specifies the difference between the UTC time and the local
(OPC) time zone. This takes into account the possibility that an OPC server
and OPC client can be distributed in a world-wide network.
Canonical Data The canonical data type means the original data type of a variable, as
Type represented internally and supplied by the OPC server.
(OPC Data Access)
Access Path The access path contains optional information for objects of the OPC
(OPC Data Access) Item class. The need for an access path and its interpretation depends
on the particular server. When it is required, the access path indicates
the path to be used by the server when reading or writing the data of a
process variable.
The access path can, for example be a path or connection name.
The value for the access path for the OPC Server for SIMATIC NET
depends on the protocol. Chapter 5 describes the structure of the
access path for the OPC server for SIMATIC NET.
The OPC Server for SIMATIC NET provides standardized access to the SIMATIC NET
industrial communications networks via the OPC interface. This provides the OPC user
with an open, comprehensive, and coordinated system for communication in automation
engineering.
This chapter explains how the vendor-specific characteristics of SIMATIC NET
communication networks are put to good use due to the structure of the names of OPC
variables.
OPC Item The only class in OPC that creates a reference to a real variable from
Represents the process is the OPC Item class. An object of the OPC Item class
Process Variable represents a process variable. The properties of an OPC item that are
transferred to the created object with the “AddItem” call describe which
variable is to be addressed.
The OPC specification contains no information about how the
parameters should be structured. This information depends on the
server and the connected communication system.
“ItemID” Parameter The “ItemID” parameter contains all the information necessary to
identify a process variable. This involves a string with the following
structure:
<Protocol ID>:[<Connection name>]<Variable name>
Example 1: DP:[CP_L2_1:]Slave005M00AW00
Example 2: S7:[S7-OPC_1|VFD1_OPC|CP_L2_1:]EB0
Example 3: FMS:[FMS_CON|VFD_OPC|CP_L2_1:]&vfdstate()
Example 4: SR:[SROPC_1||CP_H1_1:]Motor
Example 5: FDL:[SROPC_1||CP_H1_1:]Motor
Example 6: DPS:[DPSONLINE]Motor
Protocol ID The protocol ID specifies the protocol to be used when accessing the
process variable. This information is absolutely necessary. The
protocol ID can be specified as an alternative with the connection
name in the “AccessPath” parameter.
Variable Name The variable name specifies the variable to be addressed and must be
unique for the specified connection. The format of this parameter also
depends on the protocol. If the protocol ID and connection name are
specified in the “AccessPath” parameter, the “ItemID” parameter only
contains the variable name.
Please note that in this case the information specified above must not
be part of the "ItemID" parameter.
5.2 DP Protocol
Master and Slaves The DP for PROFIBUS protocol also specifies multi-master operation.
Generally (to improve performance) it is used in single-master
systems. For the OPC server for SIMATIC NET, the DP master is a
PC with the appropriate communications processor, for example
CP 5412 (A2). A master addresses slaves cyclically via the fieldbus.
Slaves are generally input/output modules located in a distributed
configuration and equipped with a passive communications module.
Properties of the The DP-OPC server from SIMATIC NET has the following
DP-OPC Server characteristics:
• Variable services access and monitoring of DP
inputs and outputs
• DPC1 services acyclic transfer of data
fields
• Diagnostic evaluation automatic evaluation of
static diagnostics
Connection Name For the DP protocol, the connection name specifies the communication
access by specifying the communications processor that
communicates with the slaves as the DP master.
The connection name for the DP protocol is as follows:
CP_L2_x: x = 1, 2, 3 or 4
Example: CP_L2_1:
Overview The variable name identifies the input or output area in the module of
a slave. Status information of the slaves and the DP master is also
available using variable names.
Syntax The syntax of the slave inputs and outputs is defined as follows (upper
and lower case irrelevant):
• Inputs:
Slave<address>M<number>E<format><element>{.bit}{,quantity}
• Outputs:
Slave<address>M<number>A<format><element>{.bit}{,quantity}
{format} The "format" element specifies the format in which the data are
supplied. Specifying the format also specifies the data type.
In principle, all specified OLE data types can be read via the
automation interface of OPC. However, certain development tools (for
example Visual Basic) only offer a restricted number of data types.
The following table therefore lists the corresponding Visual Basic type
in which the variable value can be represented.
<element{.bit}> Number of the element to be accessed (not possible for BK and WK).
The byte address of an element is decided by the data type.
Example:
B2 supplies a byte starting at byte address 2, W2 ,on the other hand,
supplies a word starting at word address 2, corresponding to byte
address 4!
{,quantity} Number of elements (not possible for BK, WK and X). The data type of
the variable is an array with elements (data type VT_ARRAY) of the
specified format. If this part of the name is omitted, the quantity 1 is
assumed and the data type of the variable is not an array.
Syntax Examples Several examples of syntax are listed below to illustrate the above
definition.
Do not forget, that you must always precede the variable with the
protocol ID and the module identifier (for example "DP:[CP_L2_1:]" )!
General The DPC1 protocol allows access to memory areas of the DPC1 slave.
The meaning of this memory area is specified by the vendor of the
slave. Memory areas can, for example, be used for configuration data.
When a DPC1 variable is logged on, the OPC server only check the
correctness of the syntax but not whether the variable is valid on the
partner device based on the configuration of the DPC1 slave.
Syntax With access to DPC1 variables, the variable names are formed with
the following syntax:
Slave<address>M<slot>
DPC1,{format}<index>{,quantity}
{format} The "format" element specifies the format in which the data are
supplied. If no format is specified, the "byte" format is used.
{,quantity} Number of elements. The data type of the variable is an array with
elements (data type VT_ARRAY) of the specified format. If this part of
the name is omitted, the quantity 1 is assumed and the data type of the
variable is not an array.
Syntax Examples
It is assumed that the slave supports DPC1 data with a length of 4
bytes in slot 3 with index 7.
Example 1:
Slave005M003DPC1,DWORD7 1 double word = 4
bytes
Example 2:
Slave005M003DPC1,B7,4 4 bytes
Introduction In DP, the OPC server for SIMATIC NET has variables available for
diagnostic purposes with which information about the DP master and
the connected DP slaves can be queried. The name of the information
variable must be specified in the parameter ItemID of an OPC item.
The following information can be obtained:
• DP master mode
• Event messages of the DP master
• Sign of life monitoring of the CP
• Mode of a DP slave
• DP slave type
• Other information
DP Master Mode Using the MasterState information variable, you can query and set the
current mode of the DP master.
It is only possible to set the mode dependent on the DP application
environment.
The following table describes the possible values (data type VT_BSTR,
in Visual Basic: String):
Sign of Life Using the WatchdogTimeout information variable, the sign of life
Monitoring of the monitoring can be set on the CP:
CP
The following table describes the possible values (data type VT_UI4, in
Visual Basic: Double):
DP Slave Type With the SlaveXXXMiscSlvType information variable, the type of the
DP slave with number XXX can be queried.
The following table describes the possible values (data type VT_BSTR,
in Visual Basic: String):
SlaveXXXAllInputs The AllInputs variable supplies all input bytes of a slave as an array of
bytes (data type VT_ARRAY of VT_UI1), in Visual Basic: Byte() ). The
inputs of non-standard slaves can be read using this variable.
SlaveXXXAllOutputs The AllOutputs variable supplies all output bytes of a slave as an array
of bytes (data type VT_ARRAY of VT_UI1), in Visual Basic: Byte() ).
The outputs of non-standard slaves can be set using this variable.
Other Information The following information variables are not intended for productive
operation. If problems occur, it may, nevertheless, be useful to
evaluate the variables listed below. All variables are generally
assigned directly to low level DP services. These variables are read in
the same way as other information variables. The result of the call is
the byte dump of the particular low level DP service. For more
information about evaluating the result, refer to the manual describing
the DP interface.
The following variables are supported by the OPC server for
SIMATIC NET for DP:
5.3 S7 Protocol
Communication The S7 for PROFIBUS and Industrial Ethernet protocol was specially
with S7 developed for communication between S7 system components and
Components of between S7 system components and programming devices and PCs.
SIMATIC This is a layer 7 communication protocol according to the ISO/OSI
reference model.
The OPC server for SIMATIC NET requires underlying S7 protocol
software from SIMATIC NET and a suitable communications
processor.
Before starting S7 communication, an S7 database must be created.
Suitable configuration tools are shipped with the protocol software.
Properties of the The S7-OPC server from SIMATIC NET has the following
S7-OPC Server characteristics:
• Variable services access and monitoring of S7
variables
• Field-oriented services program-controlled transfer
of larger fields of data
• S7 messages processing of S7 messages (S7
scans)
• Server functionality In field-oriented services, the
PC can also be used as
server.
• Domain services Transfer of a loadable data
area from and to S7
• S7 password functions Setting a password to access
protected domains
• Events Processing of S7 messages
(S7 scans, S7 alarms) as OPC
Alarms & Events
Syntax The syntax is defined as follows (upper and lower case irrelevant):
• DB<no>,<type><byte address>{,<quantity>} or
• DI<no>,<type><byte address>{,<quantity>} or
• <object><type><byte address>{,<quantity>}
Parameter Description
DB or DI Data or instance data block
<no> Number of the data or instance data block
<object> The following objects exist:
Object Description
A Outputs
Z Counters
E Inputs
M Memory bits
PA Peripheral outputs
PE Peripheral inputs
T Timers
{type} If you specify "type" the S7 data type is specified. This is converted to the
corresponding OLE data type in the OPC server for SIMATIC NET.
<byte address> <Byte number>, for example MD5 or <byte number>.<bit> for example,
EX1.1 or <byte number>.<string length>, for example DB10,STRING4.20
{quantity} Number of variables of a type to be addressed starting at the address
specified in the "byte address" parameter. It is not possible to specify a
quantity for data type X.
Syntax Examples Several examples of syntax are listed below to illustrate the above
definition.
Do not forget that you must always precede the variable with the
protocol ID and the connection!
Overview With the field-oriented services for the S7 protocol, the OPC server
provides the following advantages:
• Transfer of larger amounts of data
• The transfer can be triggered by the SIMATIC S7 PLC
Syntax The syntax for variables that can receive fields of data is defined as
Block Receive follows: (the part in braces is optional)
BRCV,<RID>{,<type><byte address>{,<quantity>}}
Syntax The syntax for variables with which data fields can be transferred from
Block Send the PG/PC to the partner is as follows:
BSEND<length>,<RID>{,<type><byte
address>{,<quantity>}}
BRCV A BRCV variable contains the last data field received from the partner.
The structure and length of the received data are specified by the
sending partner. For this reason, the data field is transferred as default
in the data type "VT_ARRAY | VT_UI1" (byte array). The variable can
only be read.
There is no practical value in monitoring this variable. The reception of
a data field by the OPC server is reported to a client application.
BSEND A BSEND variable contains a field of data to be sent to a partner
device. The buffer is only transferred to the partner when the variable
itself or a subvariable is written. The value of the send variable that is
read is the last value entered in the send buffer. The data are not read
from the partner device. By default, the variable has the data type
"VT_ARRAY | VT_UI1" (byte array) with the specified length.
Length Appending the length information to the variable name "BSEND"
specifies the length of the send buffer.
Addressing The addressing parameter R_ID is fixed for a block pair (BSEND/
Parameter RID BRCV) and is specified uniquely within a connection. This means that
several BSEND blocks can send on one connection but always with
their own R_ID. The same R_IDs can be used on other connections.
Structured Access To support the structuring of the received data field, one or more
sections of the data field can be selected and assigned to individual
variables.
When accessing data blocks, a defined notation can be used. Since
the length of a received field is unknown, it is also permissible to
define variables outside the received field. If variables are not filled out
or are filled out only partly by the received data field, the quality of the
item changes to "BAD".
If a subvariable is written, the complete buffer is always transferred to
the partner device. When writing with structured access, subvariables
should always be created on a send field in an OPC group. To prevent
the transfer of uninitialized areas, the subvariables should always
cover the entire send field and all items of a group should be written at
the same time.
{type} If you specify "type" the S7 data type is specified. This is converted to the
corresponding OLE data type in the OPC server for SIMATIC NET.
<byte address> Address in bytes within the send or receive data field, <byte number>, for
example DWORD5 or <byte number>,<bit>, for example X1.1. The address
starts at 0.
{quantity} Number of variables of a type to be addressed starting at the address
specified in the <byte address> parameter. It is not possible to specify a
quantity for data type X.
Syntax Examples Several examples of syntax are listed below to illustrate the above
definition.
Do not forget that you must always precede the variable with the
protocol ID and the connection!
Overview S7-400 controllers allow automatic monitoring of bits and the transfer
of a message to a communications partner if the monitored data
change. Along with the event message, up to 10 associated values can
be transferred depending on the S7-CPU.
The OPC server provides the received message information and the
associated values as variables. With the possibility of monitoring
variables, user programs can be informed of the occurrence of
messages.
The use of messages has the following advantages:
• No bus load from cyclic polling of variables; load only when a
change has really occurred
• Transfer of additional information with the message
• Event state
• Acknowledgment state
• Number of additional values
• Associated values (0 to 10)
For each associated value, information about the data type and the
length of the data record is also available.
Syntax of The message data can be accessed via the following OPC items:
Message Variables
Syntax Description
scan,<EvID>,eventstate State of the bit to be monitored. Data type
VT_UI2, VB type long
Bit Description
Current state of the event
1 to 15 irrelevant
Syntax of Access is possible to the associated values via the following OPC
Associated Values items:
Syntax Description
scan,<EvID>,data<N>,datatype Data type of the nth associated value.
Data type VT_UI2, (VB type long)
Possible values are as follows:
Value Meaning
0 Error in associated value
acquisition
3 Boolean
4 Bit string
5 Integer
6 Octet string
scan,<EvID>,data<N>,value Value of the nth associated value. Data
type VT_Array with the possible types
VT_BOOL, VT_I2, VT_I4, VT_UI1,
VT_ERROR (VB types Boolean, integer,
long, byte, error). If a single value is
transferred, the array has only one entry.
scan,<EvID>,data<N>,valuelen Length of the nth additional value in
bytes. Data type VT_UI2, (VB type long)
scan,<EvID>,data<N>{,S7 Value of the nth additional value in a
syntax} preset data type. Alternate access is also
possible. The S7 syntax is described, for
example in Section 7.3.3.
<N> The name part <N> specifies the associated value to be accessed.
The permitted range is from 0-9. When a message is received, only
the associated values are updated that were actually transferred with
the message. The "quality" of the associated values not supplied with
the message is set to "bad".
The number of associated values supplied with a message is provided
by the variable "scan,<EvID>, noaddvalue".
Syntax Examples Several examples of syntax are listed below to illustrate the above
definition for messages.
Do not forget that you must always precede the variable with the
protocol ID and the connection!
Introduction For monitoring purposes, the OPC server for SIMATIC NET provides
variables for S7 with which information about the S7 communication
and the established connections can be queried. The name of the
information variable must be specified in the parameter ItemID of an
OPC item.
The following information can be obtained:
• Attributes of a virtual device (VMD/VFD)
• Status of an S7 connection
• Status of a virtual device
• Status of the logon for messages
Attributes of a A virtual device (VFD - virtual field device) is the model of a real
Virtual Device device. The &Identify() information variable provides information
about the vendor attributes of a device.
The type of the information variable &Identify() is a VT_ARRAY of
VT_BSTR (VB type string) and contains 3 components:
<vendor>
<model>
<revision>
Example
The item "S7:[S7-OPC_1|VFD1_OPC|CP_L2_1:]&identify()"
supplies the following information as an array with 3 VT_BSTR via
"VFD1_OPC":
{"SIEMENS AG"|„GES7413-1AE0-0AB0"|"V1.0"}
Status of a Virtual The “&vfdstate()” information variable is used to query the status of a
Device device.
The status value (type VT_ARRAY of VT_VARIANT, VB type string
with 3 components) consists of a
• logical status (type VT_BSTR)
• physical status (type VT_BSTR) and
• detailed information about the local VFD status (type VT_ARRAY
of VT_BSTR).
The parts of the &vfdstate() information variables can have the
following values:
Logical Status
The logical status indicates which services are supported:
Physical Status
The physical status indicates the operating status of the real device.
Example
The item "S7:[S7-OPC_1|VFD1_OPC|CP_L2_1:]&vfdstate()",
represented as VT_BSTR, returns the following value:
{"S7_STATE_CHANGES_ALLOWED"|"S7_OPERATIONAL"|"02.00.00
"}
UP 2 Connection is established
Example
The Item "S7:[S7-OPC_1|VFD1_OPC|CP_L2_1:] &statepath()"
could, for example, provide the following:
"RECOVERY"
State of the Logon The "&stateevent() information variable provides the status of the
for Messages logon for the message services. While the variable &stateevent
represents the result as a string, &stateeventval returns a number (type
VT_UI1, VB type byte).
Example
The Item "S7:[OPC_1|VFD1_OPC|CP_L2_1:]&stateevent()"
could, for example, provide the following:
"SCAN"
Available Services Using special variables of the S7-OPC server, the following services
are available for handling loadable areas:
Application The domain services allow the transfer and retransfer of data and
program elements between the PC and programmable controller. On
the PC, the loadable areas are saved in files.
To allow a program element to be transferred to the programmable
controller, it must first be downloaded from the programmable
controller to the PC. It is only possible to create blocks with STEP 7.
Password Services Write and read access to the CPU can be made dependent on the
knowledge of a password. The priority of the password is higher than
that of the keyswitch of the CPU. With the – password – service, a
password can be transferred to a programmable controller as
legitimization.
Read block With the special variable &blockread(), a block can be transferred
from a programmable controller to a file on the PC.
This variable can only be written. Writing a value triggers the transfer
service.
The written value contains the parameter assignment of the service. It
is represented as an array of variant with the following elements:
• Flags
• Block
• File
Example
To read the OB1 block in a file "c:\temp\ob1.blk", the item
"S7:[S7-OPC_1|VFD1_OPC|CP_L2_1:]&blockread()"
must be written with the following value:
{0x0040|OB1|c:\temp\ob1.blk}
(To be able to specify the value as in this example, the type "string"
must be requested as the "requested data type". This string is
converted to the canonical data type by the OPC server.)
Write block With the special variable &blockwrite(), a block can be transferred
from a PC to a programmable controller. This variable can only be
written. Writing a value triggers the transfer service.
The written value contains the parameter assignment of the service. It
is represented as an array of variant with the following elements:
• Flags
• File
Example
To send the block in file "c:\temp\ob1.blk" to the programmable
controller, the item
"S7:[S7-OPC_1|VFD1_OPC|CP_L2_1:]&blockwrite()"
must be written with the following value:
{0x0000|c:\temp\ob1.blk}
(To be able to specify the value as in this example, the type "string"
must be requested as the "requested data type". This string is
converted to the canonical data type by the OPC server.)
Note After transfer to the programmable controller, the block is not yet
active. It must first be linked into the list of active blocks by using the
special variable &blocklinkin().
Link in block Using the special variable &blocklinkin(), a block can be linked in
from the passive state into the active program of the programmable
controller. The block is then available for the active program.
Remember that by linking in a block, an existing active block is
overwritten without an error message.
This variable can only be written. Writing a value triggers the service.
The value written specifies the block to be linked as the parameter for
this service.
Example
To link block DB1 in the program execution of the programmable
controller, the item
"S7:[S7-OPC_1|VFD1_OPC|CP_L2_1:]&blocklinkin()"
must be written with the following value:
DB1
Delete block Using the special variable &blockdelete(), a block can be deleted on
the programmable controller. Both the passive blocks and those linked
into the program can be removed.
This variable can only be written. Writing a value triggers the service.
The written value contains the parameter assignment of the service. It
is represented as an array of variant with the following elements:
• Flags
• Block
Example
To delete the linked block DB1, the item
"S7:[S7-OPC_1|VFD1_OPC|CP_L2_1:]&blockdelete()"
must be written with the following value:
{0x0040|DB1}
This variable can only be written. Writing an empty string triggers the
service.
Example
To compress memory, the item
"S7:[S7-OPC_1|VFD1_OPC|CP_L2_1:]&blockcompress()"
must be written with an empty string ("").
Transfer password Using the special variable &password(), the password for a
connection can be sent to legitimize and cancel the level of protection.
For an S7 programmable controller, three levels protection can be
activated for the domain services using the configuration tool STEP 7:
Protection due to setting of the keyswitch
Write protection
Write and read protection
By transferring the correct password, all the protection levels listed
above are canceled for the connection on which the password was
sent. By sending an empty string as password, the protection function
is activated again on the connection.
OPC Error Codes If the following error codes occur in conjunction with passwords, they
have the following significance:
The OPC server returns the error code OPC_E_BADRIGHTS when an
invalid password was sent. Otherwise, the error code
OPC_E_COMMUNICATION is returned.
Further error codes are also possible.
Example
To send the password "SetMeFre" to a programmable controller, the
variable
"S7:[S7-OPC_1|VFD1_OPC|CP_L2_1:]&password()"
must be written with the following value:
&SetMeFre
Characteristics of The FMS-OPC server from SIMATIC NET has the following
the FMS-OPC characteristics:
Server
• Automatic analysis of the configuration
• Reading and writing of FMS variables
• FMS server functionality
• Support of arrays and structures, including alternate access
• Support of connections via which no object dictionary (OD), a short
OD or long OD can be downloaded.
• Support of the FMS services Identify and VfdState
• Support of the SAPI service Lifelist
• Display and monitoring of the connection state
• Browsing of the local variables and variables on the server
Syntax of the The syntax of a variable is defined as follows, upper and lower case
Variable Names characters are irrelevant:
<index> or
<symbolic name>
Syntax Examples Several examples of syntax with the connection component are listed
below to illustrate the above definition.
FMS Types The following table describes the FMS data types and the
corresponding VARIANT data types.
Introduction The OPC server for FMS provides variables for with which information
about the FMS communication system and the connection states can
be queried. The name of the information variable must be specified in
the parameter ItemID of an OPC item.
The following information can be obtained:
• Attributes of a virtual device (VMD/VFD)
• Status of a virtual device
• Status of an FMS connection
• Station addresses of the obtainable nodes (LifeList)
Attributes of a A virtual device (VFD - virtual field device) is the model of a real
Virtual Device device. The &Identify() information variable provides information
about the vendor attributes of a device.
Type of the information variable &Identify() is a VT_ARRAY of
VT_BSTR (VB type: string array ) and contains 3 components:
<Hersteller>
<Modell>
<Revision>
Example
The item "FMS:[FMS_CON|VFD1_OPC|CP_L2_1:]&identify()"
supplies the following information as an array with 3 VT_BSTR via
"VFD1_OPC":
"SIEMENS AG"
"ET 200U-DP/FMS"
"V1.0"
Status of a Virtual The “&vfdstate()” information variable is used to query the status of a
Device device.
The status value (type VT_ARRAY of VT_VARIANT, VB type: array
with 3 string elements) consists of a
• logical status (type VT_BSTR)
• physical status (type VT_BSTR) and
• detailed information about the local VFD status (type VT_BSTR,
formatted).
The parts of the &vfdstate() information variables can have the
following values:
Logical Status
The logical status indicates which services are supported:
Physical Status
The physical status indicates the operating status of the real device.
Example
The item "FMS:[FMS_CON|VFD1_OPC|CP_L2_1:]&vfdstate()",
represented as VT_BSTR, returns the following value:
{"FMS_STATE_CHANGES_ALLOWED"|"FMS_OPERATIONAL"|"00.00
.00"}
UP 2 Connection is established
Example 1
The item "FMS:[FMS_CON|VFD1_OPC|CP_L2_1:]&statepath()“
could, for example, provide the following:
"UP"
Example 2
The item
"FMS:[FMS_CON|VFD1_OPC|CP_L2_1:]&statepathval()“ could,
for example, provide the following:
2 (corresponds to "UP"):
Example
The item "FMS:[FMS_CON|VFD1_OPC|CP_L2_1:]&lifelist()",
represented as VT_BSTR, might return the following value:
{0|1|0|0|1|0|0|1|0|2|1|0|1|0|1|0|3|0|0|0|0|0|1|0|0|0|0|0|0|0|0|0|0|0|0|0|2|0|
1|2|0|0|0|0|0|0|0|1|1|1|0|1|1|0|1|0|1|0|1|0|1|0|1|0|0|0|0|0|0|0|0|0|0|0|0|0|3
|0|0|0|0|0|0|0|0|0|1|0|1|0|1|0|1|0|1|0|0|1|0|0|1|0|0|1|0|0|1|0|1|3|0|3|0|1|0|
3|1|0|0|3|0|3|0|3|0|0|0|0|0|0|0|0|0}
Introduction The FMS-OPC server can itself operate as a server in the sense of the
FMS protocol. As an FMS server, it provides variables and an object
dictionary that other FMS partner devices can access. In this way,
FMS communication between PCs can be established.
Uses A server connection is implicitly assigned to every CP/VFD pair of an
FMS configuration. The variables of this server connection that can
access other FMS partner devices must be described in a
configuration file. For details of configuring a server connection, refer
to Section 8.5.5.
Please note the following: So that an FMS server is available, the OPC
☞ server on this computer must be started by using an OPC clients (for
example OPC Scout).
The variable stipulated in the server connection are available via the
OPC interface as OPC items in the same way as the variables of
another device. If a server variable is written via the OPC interface,
the value of the variable is only changed locally. This new value is
transferred to the querying device the next time an FMS client queries
the value. Reading a server variable via OPC returns the current, local
value. This value can be modified by write access from an FMS client.
Changes to values made by an FMS client are reported to an OPC
client using the OPC mechanisms for reporting value changes.
Diagram The following diagram illustrates how an FMS partner device can
access variables defined on the OPC server.
Access to FMS
variables
Local
access
PC with
OPC
server Partner
device
Text
data OD
base
PROFIBUS network
Characteristics of The SR-OPC server of SIMATIC NET has the following characteristics:
the SR-OPC Server
• Communication via SIMATIC S5 handling blocks and S7 function
blocks
• Support of the services "SEND with WRITE function" and "FETCH“
(S5 only)
• Support of the "Expedited Data“ service (S5 only)
• Fast access to large data packets
• Definition of variables within a data packet
• Display and monitoring of the connection state
• Functionality for browsing defined variables
Protocol ID The protocol ID for the Send/Receive protocol is always "SR“.
Connection Name The connection configuration for the Send/Receive protocol is not
created as with the other protocols in a database assigned to the CP
and written with special configuration tools, but must be created
specifically for each user program.
The SR-OPC server uses a text file for connection configuration in
which the connections and variables to be used by the OPC server are
entered by the user.
A symbolic name is declared for each connection that must also be
used in the designations of the OPC items. For further information
about the structure of the text file, refer to Section 8.6.
The connection name consists of the following parts:
• The symbolic name of the connection as specified in the text file
• The connection parameters for this connection
• The name of the communications processor or the access point of
the application
These parts are separated by the “|” character. The symbolic name or
the connection parameters are used as alternatives. The pipe
character to separate them must always be specified.
RemoteTSAP TSAP of the partner station. The notation is the same as for the
LocalTSAP parameter
Access Point The name of the communications processor or the access point of the
application is specified by the configuration tools of the protocol
software. Typical names are:
• "CP_H1_1:"
• "CP_H1_2:“
• "S7ONLINE“
Examples of Examples of connection names are listed below:
Connection Names
• |&PC4711,142.011.045.197,&RECVS5,0|CP_H1_1:
(Passive connection establishment, TCP/IP via access CP_H1_1:)
• |65.ff.43.ff,08.00.06.01.26.70,&SENDSEEX,1|S7ONLINE
Active connection establishment, ISO protocol via S7ONLINE
access, alternative notation of the TSAP
• MyConnection||CP_H1_1:
Use of a symbolic name "MyConnection“ from the text file via
access point CP_H1_1:
Variable Names The following variable names are specified for each connection:
• RECEIVE
• receiveexp
• send
• sendexp
receive / The complete syntax for the variables for reading out the receive
receiveexp buffer is as follows:
receive{,validvariablesyntax}
receivexp{, validvariablesyntax}
The "receive“ variable contains the last data buffer received from the
partner. The structure and length of the data buffer is not fixed. The
buffer is therefore always supplied as an array of bytes (data type
VT_ARRAY|VT_UI1, VB type: array with elements of the type byte).
The "receiveexp“ variable contains the last, high priority data buffer
received from the partner. Analogous to the "receive“ function, the
buffer is an array of bytes, its length is, however, restricted to 16 bytes.
High-priority data buffers are not supported by all partner devices!
Valid Variable To support the user when structuring the data to be received, specific
Syntax sections of the buffer can be selected. The following syntax is
mandatory for describing the variables:
• Receive{,}<type><byte address>{,quantity}
• Receiveexp{,}<type><byte address>{,quantity}
<type> With "type", you specify the data type. This is converted to the
corresponding OLE data type in the OPC server for SIMATIC NET.
Data Types Description OLE Data VB Type
Type
X Bit (Boolean) VT_BOOL Boolean
Only for objects I,Q,M,P and
OY (read only) and Send /
Receive!
B or BYTE Byte (unsigned 8) VT_UI1 Byte
CHAR Byte (signed8) VT_I1 Integer
W or WORD Word (unsigned 16) VT_UI2 Long
INT Word (signed16) VT_I2 Integer
D or DWORD Double word (unsigned 32) VT_UI4 Double
DINT Double word (signed32) VT_I4 Long
REAL Floating-point, IEEE VT_R4 Single
representation
S5REAL Floating-point, S5 VT_R4 Single
representation
<byte address> Byte address of the variables in the range: <byte number>, e.g. 5
For the bit data type, the requested bit is addressed by
<byte number>.<bit number>. (e.g.: 3.3)
{quantity} Number of variables of a type to be addressed starting at the address
specified in the "byte address" parameter.
Bit arrays are not supported. For the data type X (Boolean), the
specification of a number is omitted or it must be 1.
Syntax Examples Several examples of syntax are listed below to illustrate the above
definition:
Send / The complete syntax for the variables for writing the send buffer is as
sendexp follows:
send{n}{,validvariablesyntax}
sendexp{n}{, validvariablesyntax}
The value of the send variable that is read is the last value entered in
the send buffer. The data are not read from the partner device.
Write access to these and derived variables cause the send buffer to
☞ be transferred to the partner.
Valid Variable To support the user when structuring the data to be sent, specific
Syntax sections of the buffer can be selected. The following syntax is
mandatory for describing the variables:
• send{n}{,}<type><byte address>{,quantity}
• sendexp{n}{,}<type><byte address>{,quantity}
The notation of the variable syntax corresponds to the syntax for the
receive buffer.
Syntax Examples Several examples of syntax are listed below to illustrate the above
definition.
Direct Access Apart from communication using fixed send and receive buffers, the
(S5 only) SR-OPC server also supports direct access to the address area of the
CPU of the partner device. The sender transfers the required address
information to the receiver and this then returns the requested data.
The notation of the variable names for direct access is as follows:
• <area>{,}<type><byte address>{,quantity}
<area> The area specifies which object will be accessed. Possible values are
as follows:
Obtainable Description
Objects
DBnn Data block no. nn
A Outputs
E Inputs
M Memory bits
PAE Peripheral inputs
Z Counters
T Timers
BS System area
AS Absolute start address
DXnn Extended data block
Denn Data block in the external memory
QB Extended I/Os
<type> The notation for the type corresponds to the syntax or the receive
buffer.
<address> The address of the variables in the range.
Syntax Examples Several examples of syntax are listed below to illustrate the above
definition:
Introduction The OPC server for Send/Receive provides variables for with which
information the connection states can be queried. The name of the
information variable must be specified in the parameter ItemID of an
OPC item.
The following information can be obtained:
• Status of a connection
• Versions of the Protocol Software
UP 2 Connection is established
Example 1
The item "SR:[SR_CONNECTION||CP_H1_1:]&statepath()"
supplies for example the following:
"UP"
Example 2
The item "SR:[SR_CONNECTION||CP_H1_1:]&statepathval()"
could, for example, supply the following:
2 (corresponds to "UP"):
FDL is used Although the Send/Receive OPC server for PROFIBUS is called the
FDL-OPC server below, it uses only the services of the FDL protocol
for convenient access to communication data. Please note that the
entire functionality of the FDL layer cannot be mapped to the OPC
server.
Principle of The FDL protocol communicates with handling or function blocks that
Communication are running on a programmable controller. The following block types or
job types are available:
• SEND (without WRITE function)
• RECEIVE
With SEND and RECEIVE, the data exchange is between the SEND
block and the RECEIVE block. The SEND block always initiates
communication. For bi-directional communication, both a SEND and a
RECEIVE block must be called at both ends.
For more detailed information about the Send/Receive interface, refer
to the manual "FDL Programming Interface“ and the documentation of
the programmable controller.
Properties of the The FDL-OPC server of SIMATIC NET has the following
FDL-OPC Server characteristics:
• Communication via SIMATIC S5 handling blocks and S7 function
blocks
• Fast access to large data packets
• Definition of variables within a data packet
• Display and monitoring of the connection state
• Functionality for browsing defined variables
Connection Name The FDL-OPC server uses a text file for connection configuration in
which the connections and variables to be used by the OPC server are
entered by the user.
A symbolic name is declared for each connection that must also be
used in the designations of the OPC items. For further information
about the structure of the text file, refer to Section 8.7.
The connection name consists of the following parts:
• The symbolic name of the connection as specified in the text file
• The connection parameters for this connection
• The name of the communications processor or the access point of
the application
These parts are separated by the “|” character. The symbolic name or
the connection parameters are used as alternatives. The pipe
character to separate them must always be specified.
Decimal number in the range from 0 to 62 and 255 (for default SAP).
RemoteSAP Name of the SAP of the partner station to which the frames are sent:
Access Point The name of the communications processor or the access point of the
application is specified by the configuration tools of the protocol
software. Typical names are:
• "CP_L2_1:“
• "CP_L2_2:“
Variable Names The following variable names are specified for each connection:
Receive The complete syntax for the variables for reading out the receive
buffer is as follows:
receive{,validvariablesyntax}
The "receive“ variable contains the last data buffer received from the
partner. The structure and length of the data buffer is not fixed. The
buffer is therefore always supplied as an array of bytes (data type
VT_ARRAY|VT_UI1, VB type: array with elements of the type byte).
Valid Variable To support the user when structuring the data to be received, specific
Syntax sections of the buffer can be selected. The following syntax is
mandatory for describing the variables:
• Receive{,}<type><byte address>{,quantity}
<type> With "type", you specify the data type. This is converted to the
corresponding OLE data type in the OPC server for SIMATIC NET.
Data Types Description OLE Data VB Type
Type
X Bit (Boolean) VT_BOOL Boolean
B or BYTE Byte (unsigned 8) VT_UI1 Byte
CHAR Byte (signed8) VT_I1 Integer
W or WORD Word (unsigned 16) VT_UI2 Long
INT Word (signed16) VT_I2 Integer
D or DWORD Double word (unsigned 32) VT_UI4 Double
DINT Double word (signed32) VT_I4 Long
REAL Floating-point, IEEE VT_R4 Single
representation
S5REAL Floating-point, S5 VT_R4 Single
representation
<byte address> Byte address of the variables in the range: <byte number>, e.g. B5
For the bit data type, the requested bit is addressed by
<byte number>.<bit number>. (e.g.: AX3.3)
Syntax Examples Several examples of syntax are listed below to illustrate the above
definition:
Send The complete syntax for the variables for writing the send buffer is as
follows:
send{n}{,validvariablesyntax}
The "send“ variable contains a permanently available send buffer that
can be transferred to the connection partner. A default value is
specified for the size of the send buffer by the "LenSendSDA" or
"LenSendSDN"“ entry in the configuration file. The buffer is always
supplied as an array of bytes (data type VT_ARRAY|VT_UI1, VB type:
array with elements of the type byte). Alternatively, the size can also
be set using the n parameter in the variable name.
Write access to these and derived variables cause the send buffer to
be transferred to the partner. The value of the send variable that is
read is the last value entered in the send buffer. The data are not read
from the partner device.
Send Services Depending on the combination of the station address and the SAPs
Used specified in the connection part, a special FDL service is used when
writing a send item:
Valid Variable To support the user when structuring the data to be sent, specific
Syntax sections of the buffer can be selected. The following syntax is
mandatory for describing the variables:
• send{n}{,}<type><byte address>{,quantity}
The notation of the variable syntax corresponds to the syntax for the
receive buffer.
SendSDA In special situations, it may be desirable that the service used is not
SendSDN dependent on the combination of the address of the partner station and
the SAPs. By using the names "SendSDA" and "SendSDN", an OPC
client can specify that only the relevant services SDA or SDN are used
for sending. The syntax corresponds to the syntax of "Send". These
special names are not displayed in the OPC Browser.
Syntax Examples Several examples of syntax are listed below to illustrate the above
definition:
Introduction The OPC server for Send/Receive via PROFIBUS (FDL) provides
variables for with which information about the connection states can be
queried. The name of the information variable must be specified in the
parameter ItemID of an OPC item.
The following information can be obtained:
• Status/Configuration of the Communication Network
• Versions of the Protocol Software
Example: FDL:[MyConnection||CP_L2_1:]&identify()
Master and Slaves The DPS protocol for PROFIBUS basically specifies a single master
system. For the OPC server for SIMATIC NET, the DP master is a PC
with the appropriate communications processor, for example
CP 5412 (A2). A master addresses slaves cyclically via the fieldbus.
Slaves are generally input/output modules located in a distributed
configuration and equipped with a passive communications module.
The OPC server represents the inputs and outputs of a slave.
Properties of the The DP-OPC server from SIMATIC NET has the following
DP-OPC Server characteristics:
• Variable services access and monitoring of DP inputs
and outputs
• Diagnostic evaluation automatic evaluation of static
diagnostics
Connection Name For the DPS protocol, the connection name specifies the
communication access by specifying the communications processor
that communicates with the slaves as the DP master.
The connection name for the DP protocol is DPSONLINE
Access to DP The inputs and outputs of the slave are accessed by specifying the
Variables module number and the I/O area.
Overview The variable name identifies the input or output area in the module of
a slave. Status information of the slaves and the DP master is also
available using variable names.
Syntax The syntax of the slave inputs and outputs is defined as follows (upper
and lower case irrelevant):
• Inputs:
SlaveM<number>E<format><element>{.bit}{,quantity}
• Outputs:
SlaveM<number>A<format><element>{.bit}{,quantity}
{format} The "format" element specifies the format in which the data are
supplied. Specifying the format also specifies the data type.
In principle, all specified OLE data types can be read via the
automation interface of OPC. However, certain development tools (for
example Visual Basic) only offer a restricted number of data types.
The following table therefore lists the corresponding Visual Basic type
in which the variable value can be represented.
<element{.bit}> Number of the element to be accessed (not possible for BK and WK).
The byte address of an element is decided by the data type.
Example:
B2 supplies a byte starting at byte address 2, W2 ,on the other hand,
supplies a word starting at word address 2, corresponding to byte
address 4!
Example:
X2.3 means the 3rd bit of the 2nd byte.
{,quantity} Number of elements (not possible for BK, WK and X). The data type of
the variable is an array with elements (data type VT_ARRAY) of the
specified format. If this part of the name is omitted, the quantity 1 is
assumed and the data type of the variable is not an array.
Syntax Examples Several examples of syntax are listed below to illustrate the above
definition.
Do not forget, that you must always precede the variable with the
protocol ID and the module identifier (for example
"DPS:[DPSONLINE]" )!
Predefined DPS The following predefined DPS item is used to query and control the
Item of the Module status of the module:
Item Description
DPS:[ DPSONLINE]&devicestate Status of the module hosting the
slave.
Data type: VT_BSTR with the values
"ONLINE" and "OFFLINE".
By writing these values, the module
can be set to the corresponding
status.
Item Description
DPS:[DPSONLINE]SlaveSlvState Current status of the DPS slave. The
data type is VT_BSTR with the
possible values
"DATA_EXCHANGE" and
"NO_DATA_EXCHANGE".
DPS:[DPSONLINE]SlaveAllInputs All input bytes of all input modules
of the slave. The data type is
VT_ARRAY|VT_UI1.
DPS:[DPSONLINE]SlaveAllOutputs All outputs bytes of all output
modules of the slave. The data type
is VT_ARRAY|VT_UI1.
DPS:[DPSONLINE]SlaveMiscReadSl Configuration data of the slave. The
vParCfgData data type is VT_ARRAY|VT_UI1.
Introduction The SIMATIC NET OPC servers allow the definition and use of
symbolic variable names. This means that OPC applications can be
developed without specific reference to a system configuration and can
be adapted to the variable names and connections of a system.
The symbols are defined within a connection. To specify an item
completely, the connection information must also be provided.
Examples • AccessPath=""
ItemID = "FMS:[Pump_1]voltage"
Pump_1 is configured in the FMS database, voltage is a symbolic
name for an FMS index. Since the VFD and communications
processor are unique, they can be omitted.
• AccessPath = “FMS:[ FMS_CON|VFD1_OPC|CP_L2_1:] “
ItemID1 = “Flow“
ItemID2 = “Fill“
The AccessPath contains the complete connection information and
is used for all items.
Definition Symbolic definitions (aliases) can be defined in a text file before the
OPC server is started. For further details about defining aliases using a
text file, refer to Section 8.
The OPC Event specification gives the vendor of an OPC Event server a great deal of
freedom to map the properties of the programmable controllers on the OPC interfaces
for alarms and events.
This chapter describes the options provided by the OPC specification for Alarm & Events
used by the OPC server for SIMATIC NET, which events are provided by the OPC
server and which additional information is available as attributes.
Simple Event The OPC Event server for SIMATIC NET does not have any
Server configuration information relating to alarm/event handling in an
operator control and monitoring system.
Operator
station 2
Log
Operator printer
station 2
Alarm/Event
Management Server
Restrictions As a Simple Alarm/Events Server, the OPC Event server for SIMATIC
NET has the following restrictions:
• No conditions
• No state-related events
• No confirmation
• No areas
• No area browsing
6.2 S7 Protocol
Services Used The S7 protocol provides two protocol mechanisms for transferring
events.
Both message types are used by the OPC Event server for the S7
protocol.
Supported Alarm In keeping with the message types, the OPC Event server provides the
Categories following alarm categories:
• S7_PROCESS_SCAN
• S7_PROCESS_ALARM.
Parameter By calling the "OnEvent" callback function of the client, the client
obtains a list of events. The OPC Event server for S7 supplies server-
specific parameters that are explained in this section.
"szSource" As the source of the message, the OPC Event server for S7 specifies
Parameter the connection information of the reporting S7 device. This
corresponds to the connection portion of an S7 variable for OPC Data
Access:
The connection information is made up of three parts:
• The configured name of the S7 connection
• The configured local VFD, at which the OPC server will be logged
on
• The name of the communications processor or the access point of
the application
These parts are separated by the “|” character.
You specify the names of the S7 connections and VFDs during
configuration.
Example: S7:\AG1|VFD_OPC|CP_L2_1:
Examples: SCAN83
ALARM55
"dwSeverity" The return value provides information about the importance of the
Parameter event. This return value can be modified in the configuration file for
individual message numbers of a communication partner (see Section
8.4).
"dwNumEventAttrs The number of attributes supplied with the message depends on the
" Parameter number of supplied associated values.
"pEventAttributes" This structure contains the attributes supplied with the event. The
Parameter attributes also include the associated values of the message supplied
by the partner device. The structure is described in the OPC
specification.
Other Parameters The other parameters contain information relevant to the condition-
related events or tracking events. Since these event types are not
supported by the OPC Event server for SIMATIC NET, the remaining
parameters are irrelevant.
The OPC server for SIMATIC NET must be configured before it can use the underlying
communication systems. This chapter explains the basic configuration using the
configuration program.
Introduction The way in which the OPC server for SIMATIC NET operates can be
adapted to the requirements of the area of application.
After installing the OPC server for SIMATIC NET, the configuration
parameters have default values.
To install and start up the OPC server without problems, the
configuration program should be started, the default parameters
checked and necessary parameters must be set.
Configuration Files For more detailed information about the settings, refer to the
configuration files described in Chapter 9.
Call The configuration program of the OPC server for SIMATIC NET can
be called via the Control Panel or from the Start menu in two different
ways:
First Possibility
Double-click the “SIMATIC NET OPC Server” icon in the Control
Panel.
Second Possibility
Start the “OPC Settings” program in the taskbar of Windows (taskbar
Start => SIMATIC => SIMATIC NET => OPC Server => OPC
Settings).
After starting the configuration program, you can make general and
protocol-specific settings in various tab pages.
Entering Changes The settings of the configuration program are updated when you click
the “OK” button or the “Apply” button. The settings (apart from the
trace settings) only become active when you restart the OPC server.
Close all clients to quit the OPC server and then start an OPC client.
Overview In the "OPC Parameters“ tab, you can set general parameters for
operating the OPC server for all protocols.
Active Protocols The OPC server for SIMATIC NET supports simultaneous operation of
more than one protocol. By marking the check boxes "DP Protocol",
"S7 Protocol", "SR Protocol" or "FMS Protocol" you specify the
protocols to be used by the OPC server for communication. If the
underlying communication system does not exist or is incorrectly
configured, this is indicated by error messages when the OPC server
starts up. In this case, eliminate the problem or deactivate the protocol.
Symbol File With the OPC server, apart from the connection-specific alias, a
protocol-independent symbol file can be used. If you intend to use a
symbol file, you must activate the "Symbol File" check box and enter
the path and name of the file in the input box. For detailed information
on creating the symbol file, refer to Section 7.11.
Licenses To operate a protocol, you require the license for the corresponding
SIMATIC NET OPC product. The simulated connections can,
however, be operated without a license.
Activating Trace To activate the trace output of the OPC-specific actions for Data
Output Access, activate the "Activate OPC Data Access Trace" check box.
Trace File
☞ Enter the path and name of the file in which the trace log will be written
in the “Trace file” text box.
Number of Entries To avoid overtaxing your system with an ever-growing trace file, the
in the File size of the trace file is limited. With the “Number of entries in file”
parameter, you decide how many entries the trace file can hold. If the
trace file is full, it is renamed by changing the file name extension and
a new file is created. This allows you to see the last trace entries in the
renamed file after reaching the maximum number of entries.
Overview In the “DP Protocol” tab page, you can set parameters for operating
the DP protocol.
"Request Cycle" The "request cycle" parameter specifies the smallest possible interval
Parameter for querying the values of OPC items. Only active items in active
groups are checked. When this time has elapsed, the server checks
whether the value of the OPC items has changed. Changed active
OPC items are then updated in the cache and notified to the user.
The user can set an update rate for each group. If the selected rate is
not supported, the server reports back with an alternative rate
(RevisedUpdateRate) that represents the closest permitted value. The
value 0 requests the fastest permitted “UpdateRate”. The value of the
request cycle set is returned as the minimum update rate.
The value of the minimum update rate must match the timing of the
underlying communications system. It must not be significantly lower
than the time required by the communication system to acquire new
process data.
"Activate The DP OPC server can be operated for tests, presentations and
Simulation development without an underlying communications processor. For
Connection" such situations, there is a configurable simulation module. This
simulation module always has the name DEMO.
This connection can be activated and deactivated with the "Activate
Simulation Module" check box.
For details of configuring the simulation module, refer to Section 8.3.5.
Activating "Access With the OPC server, you can specify the access rights of individual
Rights variables or variable groups. By specifying access rights, you can, for
Configuration" example, prevent variables used for internal calculation from being
overwritten. You configure access rights either in the Tag File
Configurator for symbolic variables or in a protocol-specific text file.
Setting the "Activate Access Rights Configuration" check box means
that the configuration file for access rights is evaluated when the OPC
server starts up. The configuration file for access rights is then opened
along with the general configuration file when you click the "Edit DP
Configuration File" button. For details of the structure of the
configuration file, refer to Section 8.2.
"Edit DP Clicking this button opens a text editor with the active configuration
Configuration File" file. In this file, you can now make changes to the configuration.
Saving and The configuration program also makes changes to the configuration
Activating file that can be overwritten by your changes.
Recommendation:
☞ Click the "Edit DP Configuration File" button only when you have
applied the changes made by the configuration program with the
"Apply" button.
You select the access point to be used by the OPC server by activating
the check box of the relevant line in the list of available access points.
Entering your Remember that a selected access point is only entered after you
Selections confirm the properties page with "Apply" or "OK". These modifications
only take effect after you restart the OPC server for SIMATIC NET.
Overview In the “S7 Protocol” tab page, you can set general parameters for
operating the S7 protocol.
"Request Cycle" The "request cycle" parameter specifies the smallest possible interval
Parameter for querying the values of OPC items. Only active items in active
groups are checked. When this time has elapsed, the server checks
whether the value of the OPC items has changed. Changed active
OPC items are then updated in the cache and notified to the user.
The user can set an update rate for each group. If the selected rate is
not supported, the server reports back with an alternative rate
(RevisedUpdateRate) that represents the closest permitted value. The
value 0 requests the fastest permitted “UpdateRate”. The value of the
request cycle set is returned as the minimum update rate.
The value of the minimum update rate must match the timing of the
underlying communications system. It must not be significantly lower
than the time required by the communication system to acquire new
process data.
Activate the The S7 OPC server can be operated for tests, presentations and
Simulation development without an underlying communications processor. For
Connection such situations, there is a configurable simulation connection. This
simulation connection always has the name DEMO.
This connection can be activated and deactivated with the "Activate
simulation connection" check box.
Activate "Access With the OPC server, you can specify the access rights of individual
Rights variables or variable groups. By specifying access rights, you can, for
Configuration" example, prevent variables used for internal calculation from being
overwritten. You configure access rights either in the Tag File
Configurator for symbolic variables or in a protocol-specific text file.
Setting the "Activate Access Rights Configuration" check box means
that the configuration file for access rights is evaluated when the OPC
server starts up. The configuration file for access rights is then opened
along with the general configuration file when you click the "Edit S7
Configuration File" button. For details of the structure of the
configuration file, refer to Section 8.2.
"Edit S7 Clicking this button opens a text editor with the active configuration
Configuration File" file. In this file, you can make changes to the configuration.
Saving and The configuration program also makes changes to the configuration
Activating file that can be overwritten by your changes.
Recommendation:
☞ Click the "Edit S7 Configuration File" button only when you have
applied the changes made by the configuration program with the
"Apply" button.
Selecting CP/VFD A VFD is a "Virtual Field Device". It is a simulation of one or more real
Pairs field devices and is used to provide a uniform view of the real plant. Its
function is to provide a unique assignment of real devices to an
application.
The number of available VFDs is specified by the configuration of the
communications system. A VFD contains the connections configured
for this VFD. A separate set of VFDs can be configured for each
communications processor.
An application can log on at one or more VFDs and at one or more
communications processors (CPs). A CP/VFD pair must be assigned to
exactly one application. By selecting a CP/VFD pair, you specify which
module and which VFD (and consequently which connections) are
used in an application for communication.
The FMS OPC server for SIMATIC NET uses all the VFDs configured
on a computer for communication without previous configuration.
Querying and obtaining the existing configuration can take some time.
Since a communications processor can be accessed using several
names, VFDs occur more than once in the list of CP/VFD pairs.
Before you install and start up the S7 OPC server, you should
☞ always select the CP/VFD pairs that are really necessary.
When VFDs are listed in more than one CP/VFD pair, it is advisable to
select the pairs that include an access point (for example CP_L2_1:) .
This means that you can switch over to other CPs without changing the
OPC configuration.
If other applications on this computer use the S7 protocol at the same
time, these programs require their own VFD not used by the OPC
server.
Entering your Remember that the selected CP/VFD pairs become valid only after
Selections you confirm the Properties page with “Apply” or “OK”. These
modifications only take effect after you restart the OPC server for
SIMATIC NET.
Modifying the If the configuration is modified or you enter a different database for the
Configuration S7 protocol, remember that the selected CP/VFD pairs may no longer
be valid. When you restart the OPC server, you will then receive error
messages.
After modifying the S7 configuration in a way that affects the VFDs or
the CPs being used, check the selected CP/VFD pairs.
Overview In the “FMS Protocol” tab page, you can set general parameters for
operating the FMS OPC server.
"Repetitions of FMS sequential services are handled by the FMS OPC server. If an
Sequential error occurs in a single job, it is repeated several times. With the
Services" "Repetitions of sequential services“ parameter, the number of
Parameter repetitions can be set in the range from '0' to '65535'. The default value
is 20.
"Request Cycle" The "request cycle" parameter specifies the smallest possible interval
Parameter for querying the values of OPC items. Only active items in active
groups are checked. When this time has elapsed, the server checks
whether the value of the OPC items has changed. Changed active
OPC items are then updated in the cache and notified to the user.
The user can set an update rate for each group. If the selected rate is
not supported, the server reports back with an alternative rate
(RevisedUpdateRate) that represents the closest permitted value. The
value 0 requests the fastest permitted “UpdateRate”. The value of the
request cycle set is returned as the minimum update rate.
The value of the minimum update rate must match the timing of the
underlying communications system. It must not be significantly lower
than the time required by the communication system to acquire new
process data.
"Activate The FMS-OPC server can be operated for tests, presentations and
Simulation development without an underlying communications processor. For
Connection" such situations, there is a configurable simulation connection. This
simulation connection always has the name DEMO.
This connection can be activated and deactivated with the "Activate
simulation connection" check box.
For details of configuring the simulation connection, refer to Section
8.5.6
Activating "Access With the OPC server, you can specify the access rights of individual
Rights variables or variable groups. By specifying access rights, you can, for
Configuration" example, prevent variables used for internal calculation from being
overwritten. You configure access rights either in the Tag File
Configurator for symbolic variables or in a protocol-specific text file.
Setting the "Activate Access Rights Configuration" check box means
that the configuration file for access rights is evaluated when the OPC
server starts up. The configuration file for access rights is then opened
along with the general configuration file when you click the "Edit FMS
Configuration File" button. For details of the structure of the
configuration file, refer to Section 8.2.
"Edit FMS Clicking this button opens a text editor with the active configuration
Configuration File" file. In this file, you can make changes to the configuration.
Saving and The configuration program also makes changes to the configuration
Activating file that can be overwritten by your changes.
Recommendation:
☞ Click the "Edit FMS Configuration File" button only when you
have applied the changes made by the configuration program
with the "Apply" button.
Selecting CP/VFD A VFD is a "Virtual Field Device". It is a simulation of one or more real
Pairs field devices and is used to provide a uniform view of the real plant. Its
function is to provide a unique assignment of real devices to an
application.
The number of available VFDs is specified by the configuration of the
communications system. A VFD contains the connections configured
for this VFD. A separate set of VFDs can be configured for each
communications processor.
An application can log on at one or more VFDs and at one or more
communications processors (CPs). A CP/VFD pair must be assigned to
exactly one application. By selecting a CP/VFD pair, you specify which
module and which VFD (and consequently which connections) are
used in an application for communication.
The FMS OPC server for SIMATIC NET uses all the VFDs configured
on a computer for communication without previous configuration.
Querying and obtaining the existing configuration can take some time.
Since a communications processor can be accessed using several
names, VFDs occur more than once in the list of CP/VFD pairs.
Before you install and start up the FMS-OPC server, you should
☞ select the CP/VFD pairs that are really necessary.
When VFDs are listed in more than one CP/VFD pair, it is advisable to
select the pairs that include an access point (for example CP_L2_1:) .
This means that you can switch over to other CPs without changing the
OPC configuration.
If other applications on this computer use the FMS protocol at the
same time, these programs require their own VFD not supported by the
OPC server.
Entering your Remember that the selected CP/VFD pairs become valid only after
Selections you confirm the Properties page with “Apply” or “OK”. These
modifications only take effect after you restart the OPC server for
SIMATIC NET.
Modifying the If the configuration is modified or you enter a different database for the
Configuration FMS protocol, remember that the selected CP/VFD pairs may no
longer be valid. When you restart the OPC server, you will then
receive error messages.
After modifying the FMS configuration in a way that affects the VFDs
or the CPs being used, check the selected CP/VFD pairs.
Overview In the “SR Protocol” tab page, you can set general parameters for
operating the SR-OPC server.
"Request Cycle" The "request cycle" parameter specifies the smallest possible interval
Parameter for querying the values of OPC items. Only active items in active
groups are checked. When this time has elapsed, the server checks
whether the value of the OPC items has changed. Changed active
OPC items are then updated in the cache and notified to the user.
The user can set an update rate for each group. If the selected rate is
not supported, the server reports back with an alternative rate
(RevisedUpdateRate) that represents the closest permitted value. The
value 0 requests the fastest permitted “UpdateRate”.
The value of the minimum update rate should be selected to suit the
time involved in the underlying communication system. It should not
be significantly lower than the time required by the communication
system to acquire new process data.
“Activate the The SR-OPC server can be operated for tests, presentations and
Simulation development without an underlying communications processor. For
Connection” such situations, there is a configurable simulation connection. This
simulation connection always has the name DEMO.
This connection can be activated and deactivated with the "Activate
simulation connection" check box.
For details of configuring the simulation connection, refer to Section
8.6.4
Activating "Access With the OPC server, you can specify the access rights of individual
Rights variables or variable groups. By specifying access rights, you can, for
Configuration" example, prevent variables used for internal calculation from being
overwritten. You configure access rights either in the Tag File
Configurator for symbolic variables or in a protocol-specific text file.
Setting the "Activate Access Rights Configuration" check box means
that the configuration file for access rights is evaluated when the OPC
server starts up. The configuration file for access rights is then opened
along with the general configuration file when you click the "Edit SR
Configuration File" button. For details of the structure of the
configuration file, refer to Section 8.2.
"Edit SR Clicking this button opens a text editor with the active configuration
Configuration File" file. In this file, you can now make changes to the configuration.
Saving and The configuration program also makes changes to the configuration
Activating file that can be overwritten by your changes.
Recommendation:
☞ Click the "Edit SR Configuration File" button only when you have
applied the changes made by the configuration program with the
"Apply" button.
Selecting Access An access point is a name that refers to a communication module. The
Points names of the access points are specified by the configuration program
of the underlying protocol software. A particular module is linked with
this access point. A typical access point set up by installing the
protocol software is CP_H1_1:.
Prior to installing and starting the SR-OPC server, you must specify
which access points are used.
☞ If access points are not specified, the SR-OPC server cannot be
started up.
You select the access point to be used by the OPC server by activating
the check box of the relevant line in the list of available access points.
Entering your Remember that a selected access point is only entered after you
Selections confirm the properties page with "Apply" or "OK". These modifications
only take effect after you restart the OPC server for SIMATIC NET.
Overview In the “FDL Protocol” tab, you can set general parameters for operating
the FDL-OPC server.
"Request Cycle" The "Request Cycle" parameter specifies the shortest possible interval
Parameter for checking the values of the active OPC items of an active OPC
group. When this time has elapsed, the server checks whether the
value of the OPC items has changed. All changed OPC items are then
updated in the cache and signaled to the user.
The user can set an update rate for each group. If the selected rate is
not supported, the server reports back with an alternative rate
(RevisedUpdateRate) that represents the closest permitted value. The
value 0 requests the fastest permitted “UpdateRate”.
The value of the minimum update rate should be selected to suit the
time involved in the underlying communication system. It should not
be significantly lower than the time required by the communication
system to acquire new process data.
Activate the The FDL-OPC server can be operated for tests, presentations and
Simulation development without an underlying communications processor. For
Connection such situations, there is a configurable simulation connection. This
simulation connection always has the name DEMO.
This connection can be activated and deactivated with the "Activate
simulation connection" check box.
For more detailed information in the simulation connection, refer to
Section 8.7.4.
Activating "Access With the OPC server, you can specify the access rights of individual
Rights variables or variable groups. By specifying access rights, you can, for
Configuration" example, prevent variables used for internal calculation from being
overwritten. You configure access rights either in the Tag File
Configurator for symbolic variables or in a protocol-specific text file.
Setting the "Activate Access Rights Configuration" check box means
that the configuration file for access rights is evaluated when the OPC
server starts up. The configuration file for access rights is then opened
along with the general configuration file when you click the "Edit FDL
Configuration File" button. For details of the structure of the
configuration file, refer to Section 8.2.
"Edit FDL Clicking this button opens a text editor with the active configuration
Configuration File" file. In this file, you can now make changes to the configuration.
Saving and The configuration program also makes changes to the configuration
Activating file that can be overwritten by your changes.
Recommendation:
☞ Click the "Edit FDL Configuration File" button only when you
have applied the changes made by the configuration program
with the "Apply" button.
Selecting Access An access point is a name that refers to a communication module. The
Points names of the access points are specified by the configuration program
of the underlying protocol software. A particular module is linked with
this access point. A typical access point set up by installing the
protocol software is CP_H1_1:.
Prior to installing and starting the FDL-OPC server, you must specify
which access points are used.
☞ If access points are not specified, the FDL-OPC server cannot be
started up.
You select the access point to be used by the OPC server by activating
the check box of the relevant line in the list of available access points.
Entering your Remember that a selected access point is only entered after you
Selections confirm the properties page with "Apply" or "OK". These modifications
only take effect after you restart the OPC server for SIMATIC NET.
Overview In the “DPS Protocol” tab, you can set general parameters for
operating the DPS-OPC server.
"Request Cycle" The "Request Cycle" parameter specifies the shortest possible interval
Parameter for checking the values of the active OPC items of an active OPC
group. When this time has elapsed, the server checks whether the
value of the OPC items has changed. All changed OPC items are then
updated in the cache and signaled to the user.
The user can set an update rate for each group. If the selected rate is
not supported, the server reports back with an alternative rate
(RevisedUpdateRate) that represents the closest permitted value. The
value 0 requests the fastest permitted “UpdateRate”.
The value of the minimum update rate should be selected to suit the
time involved in the underlying communication system. It should not
be significantly lower than the time required by the communication
system to acquire new process data.
Activate the The DPS-OPC server can be operated for tests, presentations and
Simulation development without an underlying communications processor. For
Connection such situations, there is a configurable simulation connection. This
simulation connection always has the name DEMO.
This connection can be activated and deactivated with the "Activate
simulation connection" check box.
For more detailed information in the simulation connection, refer to
Section 8.8.3.
Activating "Access With the OPC server, you can specify the access rights of individual
Rights variables or variable groups. By specifying access rights, you can, for
Configuration" example, prevent variables used for internal calculation from being
overwritten. You configure access rights either in the Tag File
Configurator for symbolic variables or in a protocol-specific text file.
Setting the "Activate Access Rights Configuration" check box means
that the configuration file for access rights is evaluated when the OPC
server starts up. The configuration file for access rights is then opened
along with the general configuration file when you click the "Edit DPS
Configuration File" button. For details of the structure of the
configuration file, refer to Section 8.2.
"Edit DPS Clicking this button opens a text editor with the active configuration
Configuration File" file. In this file, you can now make changes to the configuration.
Saving and The configuration program also makes changes to the configuration
Activating file that can be overwritten by your changes.
Recommendation:
☞ Click the "Edit DPS Configuration File" button only when you
have applied the changes made by the configuration program
with the "Apply" button.
Selecting Access An access point is a name that refers to a communication module. The
Points names of the access points are specified by the configuration program
of the underlying protocol software. A particular module is linked with
this access point. A typical access point set up by installing the
protocol software is CP_H1_1:.
Prior to installing and starting the DPS-OPC server, you must specify
which access points are used.
☞ If access points are not specified, the DPS-OPC server cannot be
started up.
You select the access point to be used by the OPC server by activating
the check box of the relevant line in the list of available access points.
Entering your Remember that a selected access point is only entered after you
Selections confirm the properties page with "Apply" or "OK". These modifications
only take effect after you restart the OPC server for SIMATIC NET.
Activating Trace To activate trace output, select the "Activate OPC trace" check box.
Output
The activation of trace outputs slows down program execution
considerably.
☞
Trace File Enter the path and name of the file in which the trace log will be written
in the “Trace file” text box. Different files must be specified for the
OPC trace and the protocol-specific trace.
Create new file... If you select the option "create new file", an existing trace file is
overwritten when you start the OPC server. If you select the alternative
option "append to existing file", the existing trace file has new entries
added to it.
Closing the File By closing the protocol-specific trace file following each entry, there is
Following Each a physical transfer of the data to hard disk. This means that trace
Entry information is retained even if a program crashes.
Activating this option slows down program execution
significantly.
Maximum Number To avoid overtaxing your system with an ever-growing trace file, the
of Entries size of the trace file is limited. With the “Number of entries in file”
parameter, you decide how many entries the trace file can hold. If the
trace file is full, it is renamed by changing the file name extension and
a new file is created. This allows you to see the last trace entries in the
renamed file after reaching the maximum number of entries.
Trace Depth The amount of information to be recorded can be specified for the
protocol-specific trace.
Introduction The OPC server for SIMATIC NET is started automatically by the
operating system when a client wants to use it. The OPC server
includes reference counters to be able to recognize when the last client
is closed. The OPC server then closes itself. This is, however, only
possible when the clients increment and decrement the reference
counters correctly. If a client terminates abnormally, so that the
reference counter cannot be reset, the OPC server does not close
even when no further client is active. The server then continues to
maintain the communications connections.
Quitting the OPC If you click the “Quit OPC Server” button in the “OPC Reset” tab page,
Server you reset the OPC server to a defined status without having to restart
the system. The OPC server terminates all communications
connections and closes itself. Both an active OPC Data Access server
and an OPC Alarms & Events server is closed.
You should first close all the OPC clients that work with the server
☞ otherwise any OPC calls from the clients will be rejected with RPC
errors.
Reason In the "Reason" text box, a reason can be specified that can be
evaluated by a client. Evaluating this information is interesting
particularly in DCOM operation.
Delay The OPC server is closed only after the time specified in the "Delay"
box has expired.
Introduction The ItemIDs of the OPC servers for SIMATIC NET contain information
about the communication path of the variables. The syntax of the
variables specifies the protocol, the connection and possibly also the
service with which the data will be delivered.
It is, however, often useful to select names of variables that are not
dependent on the configuration of the communication system but
rather reflect the structure of a plant.
With the OPC Event server for SIMATIC NET, it is possible to enter a
symbolic name that is valid for all protocols.
The OPC server for the S7 protocol can also use the symbols created
with the STEP 7 configuration tool in the symbol table and in the
blocks.
Assembly.Drive.Controller.Setpoint
S7300(1)_CPU416.Motor.Limitswitch
STEP 7 Symbols A symbol file is used to store the symbolic names. This file contains
information about the internal assignment of symbolic names to valid
S7 variable names.
Note:
When using symbols with the OPC server, the symbols are read out
once when the "AddItem" method is called. In subsequent calls, the
client uses the handle generated by the server and can therefore
access the variable directly.
Note:
The Files "*.wsd" The symbolic names of several S7 programs created with STEP 7 can
and "*.ssd" be entered in the symbol file (*.wsd). The symbol file contains the
symbols of the global symbol table of an S7 program and the symbolic
information stored in blocks.
Along with the file with the extension *.wsd, a file with the extension
*.ssd is also created when the symbol information is stored. While the
wsd file contains all symbols (including the entries marked as
invisible), the ssd file only contains the symbols to be used. Invisible
symbols are not entered in the ssd file. The wsd file is used as the
basis for editing the symbols with the tag file configuration program.
The ssd file is used by the OPC server and is entered in the
configuration program for the OPC server.
Requirements The Tag File Configurator must run on the computer on which the
"STEP 7" configuration tool is installed. If necessary, install the "OPC
Server" product on the configuration computer with STEP 7.
Starting the Tag Start the Tag File Configurator and create a new project:
File Configurator
Step Procedure
1 Starting the Tag File Configurator
Select the following menu command in the start menu of the Windows taskbar:
(Start => SIMATIC => SIMATIC NET => OPC Server => Tag File Configurator)
2 Creating a new Symbol File
Click the "New" button or select the menu command "File => New".
You can open an existing project by clicking the "Open" button or selecting the menu
command "File => Open".
Step Procedure
1 Select a STEP 7 project
Select the menu command "Insert => Program" .
A browser is displayed in which you can select the STEP 7 project and program.
2 Navigate through the projects
In the left-hand box, click the "+" character to open the next level.
The schematic below describes the meaning of the levels in the program hierarchy.
3 Select one or more programs
Æ
Select one or more S7 programs and click the " " to enter the symbols of the selected
program in the symbol file.
STEP 7 projects
PC station in project
SIMATIC stations
networked with PC station
Applications of PC station, if
more than one application is
defined for a PC station:
As a result, the Tag File Configurator enters the symbols in the right-
hand list box (see following page).
A symbol file is always created for one Simatic PC station and must
later be initialized on this PC station. If a STEP 7 project does not
contain a PC station, no symbol file can be created for the project.
Note The symbol file contains the connection information created with STEP
7/NetPro. This connection information must also be adopted on the PC
as the configuration. See also Section 7.11.4.
Step Procedure
1 Select the variable
Select the list of variables in the left window. Click the row containing the required variable
in the right-hand window.
2 Open the selection dialog
Click the arrow button in the cell containing the connection information to display the
possible connections in a combo box.
3 Select a connection
Select the required connection in the dialog box.
Introduction Apart from the symbols imported from STEP 7, you can also create
new symbols for existing variables using the Tag File Configurator. To
structure your symbols, you can create blocks. A block, in turn, can
contain lower-level variables or further blocks.
Note Fields and symbols cannot be entered in the CPUs and programs
extracted from STEP 7. It is only possible to create new symbols and
blocks at the lowest level within blocks that have already been created.
Creating blocks In the name space, you can now create blocks for structuring the name
space.
Step Procedure
1 Select the insertion position
Click the lowest level in the tree or click an existing block.
2 Open the input dialog
Click the right mouse button to open the context-sensitive menu. Select the "New Block"
menu command. If you select an insertion position incorrectly within a STEP 7 project, this
menu command cannot be activated.
As an alternative, you can select the "New Block" menu command from the "Insert" menu.
3 Enter the block name
Enter a unique name for the block at this position in the dialog box.
Entering Symbols You can now enter symbols in the block you have created. Follow the
steps outline below:
Step Procedure
1 Select the insertion position
Click the block in the tree in which you want to insert a symbol.
2 Open the input dialog
Click the right mouse button to open the context-sensitive menu. Select the menu command
"New Symbol".
As an alternative, you can select the "New Symbol" menu command from the "Insert" menu.
3 Entering or Selecting the Runtime Names
Enter the runtime names for the specific protocol in the "Runtime Name" column (as
described in Section 5). You can enter the names directly in this table or by clicking the
"Browse" button you can start a browser to search through the names on the OPC server. In
the "Browse" dialog, you can also select several items.
4 Specifying the Symbol Names
Enter a unique name for the symbol in the "Symboli Name" column for each runtime name.
Entering a Symbol In the steps described below, you configure the OPC server for the use
File of a symbol file:
Step Procedure
1 Transfer the Symbol File
Transfer the previously created symbol file to the PC station, for example by copying the
symbol file to diskette.
2 Open the OPC configuration program
Start the program "OPC Settings" from the Windows taskbar (taskbar Start => SIMATIC =>
SIMATIC NET => OPC Server => OPC Settings).
3 Activating Symbols
Activate the "Symbol File" check box in the "OPC Parameters" tab.
Enter the path and name of the symbol file transferred to this PC station in the input box
below.
Inclusion in the In STEP 7, when you compile the network configuration with NetPro,
Network databases for the PC stations are created. These databases contain
Configuration configuration information that describes the access path of the PC
station to an S7 station. The databases have the extension "XDB".
Note This functionality is only available from STEP 7 V5.0 and higher.
Entering the XDB The steps outlined below explain how to specify an XDB file for a PC
File station:
Step Procedure
1 Identify and copy the XDB file
Start STEP 7 and open the project from which you created the symbol file.
Select the PC station that will use the symbol file.
Display the object properties of the PC station and the "Configuration" tab.
Here, you can see the location of the configuration file.
Transfer the file to the PC station, for example by copying the configuration file to diskette.
2 Open the configuration program
Start the "Set PG/PC Interface" configuration program on the PC station, for example from
the taskbar Start => Simatic => SIMATIC NET => Set PG/PC Interface).
3 Enter the configuration file
Select "STEP 7 Configuration" in the configuration program.
Enter the path and name of the configuration file transferred to this PC station in the input
box "Name of the Configuration File".
Name Space The symbolic variables are visible beside the protocol-specific
variables in the name space of the OPC server.
Structure of the The ItemID of the symbolic name consists of the name of the control
ItemIDs engine, the name of the blocks and the name of the symbol. The
individual elements are separated by a period.
Factory1.ConveyorBelt. Setpoint
Further settings for the OPC server for SIMATIC NET to allow optimum use must be
entered in configuration files. For the send/receive protocol and the Alarms & Events
interface, the configuration file must be edited to define the connections.
This chapter explains the structure and meaning of the entries in the configuration files
for specific protocols.
Overview Along with the OPC server for SIMATIC NET, configuration files are
installed for specific protocols. The configuration files must be
processed to allow optimum use of the products.
Structure of the The text files for configuring the OPC server are structured based on
Files the principle of the ini files of Windows. These are divided into sections
indicated by section names set in [ ]. Following the section name, there
are two assignments of the type "parameter=value". Comments within
the file are preceded by a semicolon.
File Location When you install the OPC server, two configuration files are entered in
the protocol-specific binary folder.
Content of the .txt The configuration files with the extension txt contain a section for
Files general protocol definition. This is followed by sections for assigning
parameters for access points or connections and for specifying
symbolic names (aliases). A simulation connection can also be
configured with which access is possible when no communications
processor is installed.
Content of the .sec The configuration files with the extension sec allow the access rights
files to individual variables or variable groups to be influenced.
Overview In operator control and monitoring systems, it must not be possible for
any user to be able to monitor and manipulate variables that can be
accessed via the protocol. The unintentional writing of internal flag
variables of a programmable controller could have fatal consequences.
With the OPC server for SIMATIC NET, it is possible to restrict the
access rights of the variables that can be accessed using the OPC
server.
Structure The structure of the sec files for configuring access rights to variables
is the same for all protocols. On the one hand, the global settings for
controlling access rights for a protocol are specified in the sec files.
The sec files also contain the definition of rights for variables and
variable groups.
Entry Meaning
Section [Security] General settings are made in this section.
SecurityLevel 0 No restriction of access rights
1 Access rights are restricted for all users as
specified in the following section.
Default 0
Definition of The global access rights for OPC variables are defined in the section
Access Rights "GlobalSecurityItems". To define areas for variables (all variables of a
connection or a block), you can use placeholders. Areas can be
specified in greater detail using the following definitions.
Entry Meaning
Section [GlobalSecurityItems] Definitions of global rights are defined in this section.
DefaultAccessRights Standard specification of the access rights for all
variables of the protocol not covered in the following
definitions.
Default RW
<OPCItem>=<special rights> New definition of the access rights for a variable. All
previously defined rights are ignored; in other words,
it is also possible to restrict existing rights.
<OPCItem> Specification of one or more OPC items according to
the syntax defined in Chapter 5. This must also
include the connection information. The use of aliases
is possible.
The following placeholders can be used:
* any number of characters are irrelevant
? exactly one character is irrelevant
<special rights> (Empty) No access to the OPC item
R Read-only access to the OPC item
W Write-only access to the OPC item
RW Full access to the OPC item
8.3 DP Protocol
Overview Editing the configuration file for the DP protocol becomes necessary in
the following situations:
File Location The file location for the configuration file for the DP protocol set during
installation is as follows:
General Protocol The following table shows the parameters for configuring the general
Configuration properties of the DP protocol.
Entry Meaning
Section [PROTOCOL] The general protocol settings are made in this
section.
CycleTime This value specifies how quickly the job waiting list is
checked through for pending jobs.
Default 100 ms
(is set as "Request Cycle" by the configuration
program)
UseOnlyThisBoard Number of the module at which the DP OPC server
logs on. Several numbers are separated by commas.
A logged on module has the name CP_L2_n, where n
corresponds to the module number.
Caution: The last module number must be
terminated by a comma.
Example:
UseOnlyThisBoard =1,2,
Default: 1,2,3,4,
(set by the configuration program)
UseDemoBoard 1 The DP OPC server generates a simulation
connection with which slave access can be
simulated without a functioning protocol.
0 No simulation connection is provided.
Default 0
(set by the configuration program)
CycleNet reserved
Overview Each module has up to 3 sections in the configuration file. In the first
section, module-specific parameters are configured, in the second
section special slave settings can be made and in the third section
aliases can be defined for variables.
The configuration is evaluated when the OPC server starts up.
Entry Meaning
1st module section Configuration parameters for this module
[module name]
e.g.
[CP_L2_1:]
ReferenceAccess Setting for the DP application type and the DP
application environment.
The permitted values correspond to the DP
structure element reference.access (see DP
documentation).
0x50 (DPN_SYS_NOT_CENTRAL |
DPN_ROLE_NOT_CENTRAL)
Several equal ranking DP applications are
possible, The OPC server changes
automatically to the "OPERATE" mode.
0xA0 (DPN_SYS_CENTRAL |
DPN_ROLE_CENTRAL)
The OPC server is a master application and
must set the mode explicitly. The OPC server
variable "Masterstate" must have suitable
value set.
0x60 (DPN_SYS_CENTRAL |
DPN_ROLE_NOT_CENTRAL)
There is another master application and this
must set the mode explicitly. The OPC server
is a subordinate application.
Access to slaves is possible only in the
"OPERATE" mode.
Default 0x50
WatchdogTimeout Configuration of the watchdog of the module. If
the OPC server no longer accesses the DP
programming interface (due to a problem), the
module reacts automatically as described in the
documentation of the module. (For example the
CP 5412 (A2): data with the value 0 is sent to all
Entry Meaning
slaves assigned to the OPC server).
0 The watchdog is off.
n The watchdog responds after n milliseconds
without any access to the programming
interface.
For example, the OPC server accesses
programming interface periodically when DP
variables are monitored.
The watchdog can be modified during operation
with the variable
DP:[CP_L2_n:]WatchdogTimeout.
Default 6000 ms
Timeout Error monitoring time: If a pending DPC1 job
cannot be processed within this monitoring time,
the job is acknowledged with an error.
Default 15000 ms
AutoDiag 0 The diagnostic monitoring and evaluation is
off.
N Lock time for error diagnostics. The OPC
server monitors the diagnostic flag
automatically when the slave inputs/outputs
are accessed and evaluates the diagnostic
data of the standard slaves. If errors or
problems are detected in the diagnostic data,
access to the slave inputs/outputs is locked
for n ms; in other words, read/write jobs are
acknowledged with errors.
Default 500 ms
Overview
The entries in the 2nd section specify the access rights of the slaves in
the database.
Entry Meaning
2nd module section Settings for access rights
[module name(slaves)]
e.g.
[CP_L2_1:(slaves)]
AccessSlaveDefault If there are other DP applications on the same
module, access to individual DP slaves must be
e.g. specified. If access to the individual slaves by
the DP applications is inconsistent (for example
AccessSlaveDefault=1 2 applications have write access to the same
slave), the logon of the entire module fails and
none of the slaves are available.
This entry defines how the default access to
slaves is set when you log on. Access can be
adapted for individual slaves (see below). The
following values are possible:
1 As default, only read access to all slaves is
possible
2 As default, read and write access to all
slaves is possible
Default 2
AccessSlave<no> Normally, all available slaves of the module are
set for read/write access when the module logs
e.g. on. A different default can be set for each slave,
as follows:
AccessSlave003=0
0 No access to slave
AccessSlave063=1
AccessSlave107=2 1 Read-only access to slave
2 Read/write access to slave
The slave number is always 3 digits, and must be
padded with leading zeros. The OPC server does
not enter any values in this section. If there is no
entry, the default is used.
Default 2
Defining Aliases The third section of the configuration file allows the definition of
symbolic names for a valid DP variable. An alias is a purely textual
substitute for an otherwise valid DP variable name.
Entry Meaning
3rd module section Predefined aliases for this module. The section
[module name (aliases)] name is made up of the module name and
e.g. "(Aliases)".
[CP_L2_1:(Aliases)]
Alias=DPVariable This section contains any number of alias
e.g. definitions.
The symbolic name "Motor" references the 3rd
Motor=Slave012M002EX0.3
input bit of slave 12. The name "Heatingpower"
Heatingpower=Slave23M003AW3
references an output word of slave 23.
Alias The alias can be used just like a normal DP
variable on the OPC interface.
Range of values: Length maximum 32
characters
permitted characters: a-z A-Z 0-9 $ _
(underscore) . (period) & (), ANSI > 127
DPVariable Internally, the OPC server replaces the variable
name of the alias with this DP variable.
Entry Meaning
1st section of the demonstration module Connection-specific parameters. No parameters
[DEMO] are defined within this section.
Entry Meaning
2nd connection section Configuration of the simulated slaves
[DEMO(Slaves)]
Slave003=|R|unsigned8[2]|{00|19}
(corresponds to ET200B 32DI}
Slave004=|R|unsigned8[2]|{35|00}
(corresponds to ET200B 32DO}
Entry Meaning
3rd connection section Predefined aliases for the simulated module.
[DEMO(Aliases)]
Alias=DPVariable This section contains any number of alias
e.g. definitions.
8.4 S7 Protocol
Overview Editing the configuration file for the S7 protocol becomes necessary in
the following situations:
File Location The file location for the configuration file for the OPC server for the S7
protocol set during installation is as follows:
General Protocol The following table shows the parameters for configuring the general
Configuration properties of the S7 OPC server.
Entry Meaning
Section [PROTOCOL] The general protocol settings are made in this
section. You can also make parameter settings for the
trace of the underlying protocol software (SAPI-S7).
S7_MINI_DB_PERSISTENCE_COUNT For selectable SAPI-S7 mini-dB parameters, see
SAPI documentation
Default 5
S7_MINI_DB_ABORT_TIMEOUT For selectable SAPI-S7 mini-dB parameters, see
SAPI documentation
Default 300
ConfigProtocolTrace SAPI-S7 trace parameters are set
Default 0
S7_MINI_DB_TRACE_TARGET Selectable SAPI-S7 trace parameter, see SAPI
S7_MINI_DB_TRACE_SELECT documentation
S7_MINI_DB_TRACE_DEPTH
S7_MINI_DB_TRACE_FILENAME
CycleTime This value specifies how quickly the job waiting list is
checked through for pending jobs.
Default 100 ms
(is set as "Request Cycle" by the configuration
program)
UseAllAvailableVFD 1 The S7-OPC server logs on at all available
VFD|CP pairs. Since the search for VFD|CP pairs
in particular can take some time, the VFD|CP pairs
that are actually required should be set using the
configuration program.
0 The S7-OPC server logs on only at the VFD|CP
pairs specified in the UseOnlyThisVFD parameter.
Default: 1
(set by the configuration program)
Entry Meaning
UseOnlyThisVFD VFD|CP pairs at which the S7-OPC server logs on.
Several pairs are separated by commas.
Caution: The last VFD|CP pair must be terminated
by a comma.
Example:
UseOnlyThisVFD=VFD1|CP_L2_1:,VFD2|CP_L2_2:,
(set by the configuration program)
UseDemoConn 1 The S7-OPC server generates a simulation
connection with which variable access can be
simulated without a functioning protocol.
0 No simulation connection is provided.
Default 0
(set by the configuration program)
StoreEventsTime Time after which a pending protocol alarm is removed
from the internal waiting list if it cannot be passed on
to an OPC Alarms & Events client.
Default 60000 ms
StoreEventsCount Maximum number of waiting protocol alarms in the
internal waiting list, that cannot be passed on to an
OPC Alarms & Events client immediately after the
protocol alarm occurred.
Default 500
1. Connection section
Entry Meaning
[Connection|VFD|CP] Connection-specific parameters, the section
e.g. names correspond to the connection names.
[AG1|VFD1|CP_L2_1:]
S7_MINI_DB_INIT_REQ_AMQ_CALLING SAPI-S7 parameters that are set by the client
S7_MINI_DB_INIT_REQ_AMQ_CALLED during connection establishment, refer to the
S7_MINI_DB_INIT_REQ_AMQ_SIZE SAPI documentation.
S7_MINI_DB_INIT_REQ_RSP_CALLING
S7_MINI_DB_INIT_REQ_RSP_CALLED
S7_MINI_DB_INIT_REQ_RSP_SIZE
Entry Meaning
Passive 0 The OPC server actively establishes the
connection to the partner device
1 The partner device establishes the
connection. The InitiateReq parameter is
ignored in this case.
Default 0
AbortConnectionAfter 0 The OPC server only terminates a connection
to a partner when the OPC server is closed
down. During operation of the OPC server,
once a connection has been established it
remains even when it is no longer used.
n>0
The OPC server terminates a connection
automatically n milliseconds after the last use
of the connection. This property must not be
used if the parameter Passive=1 is set.
Default 0
Timeout Error monitoring time: If a pending job cannot be
processed within this monitoring time, the
connection is reset and the job is acknowledged
with an error.
Default 15000 ms
Events Administrating Messages (logon)
0 Never
1 SCAN messages as soon as appropriate
OPC items are used
2 SCAN messages always after connection
establishment
3 ALARM messages always after
connection establishment
Default 1
OptimizeS7Write 0 No optimization of S7 write access
1 Optimization of S7 write access
Entry Meaning
about a reduction in load on the network and on
the partner. If the conditions SIMULTANEOUSLY
and WITHOUT GAPS are not met, the
performance of the core server may deteriorate.
Default 0
OptimizeS7Read 0 No optimization of S7 read access
n Optimization of S7 read access with gap
area n-1
e.g. n = 3 -> 2 bytes gap area permitted.
Default 11
AutoPasswordReset 0 No automatic resetting of the S7
domain password
1 Automatic resetting of the S7 domain
password after connection establishment
Default 0
Defining Aliases The second section of the configuration file allows the definition of
symbolic names for a valid S7 variable. An alias is a purely textual
substitute for an otherwise valid S7 variable name.
2. Connection section
Entry Meaning
[Connection|VFD|CP(Aliases)] Predefined aliases for this connection. The
e.g. section name is made up of the connection name
[AG1|VFD1|CP_L2_1:(Aliases)] and the additional "(Aliases)".
Alias=S7Variable This section contains any number of alias
e.g. definitions.
The symbolic name "Motor" references output
Motor=AB0
byte 0; the name "Heatingpower" references data
Heatingpower=DB10,W0
word 0 in data block 10.
Alias The alias can be used just like a normal S7
variable on the OPC interface.
Range of values: Length maximum 32
characters
permitted characters: a-z A-Z 0-9 $ _
(underscore) & (), ANSI > 127
S7Variable Internally, the OPC server replaces the variable
name of the alias with this S7 variable.
To pass on S7 messages to the OPC Alarms & Events clients, the severity of the event is
required as the event parameter. This information is, however, not supported by the protocol
and is not contained in the S7 messages themselves.
The following table describes the section for settings for S7 messages expected via an S7
connection.
Entry Meaning
3rd connection section S7 message severities specified for this
[Connection|VFD|CP(Severities)] connection
e.g. The section name is made up of the
[AG1|VFD1|CP_L2_1:(Severities)] Connection name and "(Severities)".
Default 300
Entry Meaning
[DEMO(Aliases)] Aliases predefined for the demo connection.
Overview Editing the configuration file for the FMS protocol becomes necessary
in the following situations:
• when you want to change the handling of the object dictionary for a
connection. As default, a short object dictionary is loaded.
• when you want to change connection parameters
• when you want to change variable definitions or create aliases,
• when you want to configure the server connection or
• when you want to configure the demo connection
File Location The file location for the configuration file of the FMS-OPC server set
during installation is as follows:
General Protocol The following table shows the parameters for configuring the general
Configuration properties of the FMS-OPC server.
Entry Meaning
Section [PROTOCOL] The general protocol settings are made in this
section. You can also make parameter settings for the
trace of the underlying protocol software (SAPI-FMS).
FMS_MINI_DB_SEQ_REPEAT_CNT Selectable SAPI-FMS Mini-DB parameter, see SAPI
documentation
Default 20
(set by the configuration program)
FMS_MINI_DB_OD_NAME_LENGTH Selectable SAPI-FMS Mini-DB parameter, see SAPI
documentation
Default 32
ConfigProtocolTrace SAPI-FMS trace parameters are set
Default 0
FMS_MINI_DB_TRACE_TARGET Selectable SAPI-FMS trace parameter, see SAPI
FMS_MINI_DB_TRACE_SELECT documentation. The numeric values corresponding to
FMS_MINI_DB_TRACE_DEPTH the constants in the SAPI header files must be
FMS_MINI_DB_TRACE_FILENAME entered.
CycleTime This value specifies how quickly the job waiting list is
checked through for pending jobs.
Default 100 ms
(is set as "Request Cycle" by the configuration
program)
UseAllAvailableVFD 1 The FMS-OPC server logs on at all available
VFD|CP pairs. Since the search for VFD|CP pairs
in particular can take some time, the VFD|CP pairs
that are actually required should be set using the
configuration program.
0 The FMS-OPC server logs on only at the VFD|CP
pairs specified in the UseOnlyThisVFD parameter.
Default: 1
(set by the configuration program)
Entry Meaning
UseOnlyThisVFD VFD|CP pairs at which the FMS-OPC server logs on.
Several pairs are separated by commas.
Caution: The last VFD|CP pair must be terminated
by a comma.
Example:
UseOnlyThisVFD=VFD1|CP_L2_1:,VFD2|CP_L2_2:,
(set by the configuration program)
UseDemoConn 1 The FMS-OPC server generates a simulation
connection with which variable access can be
simulated without a functioning protocol.
0 No simulation connection is provided.
Default 0
(set by the configuration program)
CycleNet >0 The FMS-OPC server sends an fms_receive() call
to the protocol cyclically. This is intended to
eliminate protocol bottlenecks.
0 The FMS-OPC server only sends an fms_receive()
call to the protocol when it receives a WM_SINEC
message from the driver.
Default 1000 ms
WaitMultipleOD 0 A timeout error is generated if the read OD job
cannot be executed in the timeout time.
1 If a job for reading the OD cannot be executed
because there is another OD job pending on
another connection, the job is delayed until it can
be executed. This does not cause a timeout error.
Default 1
Entry Meaning
1st connection section Connection-specific parameters, the section
[Connection|VFD|CP] names correspond to the connection names.
e.g.
[AG1|VFD1|CP_L2_1:]
FMS_MINI_DB_INIT_REQ_PASSWORD SAPI-FMS parameter set at the client end during
FMS_MINI_DB_INIT_REQ_ACCESS_GR connection establishment, refer to the SAPI
OUPS documentation (for example for passwords).
FMS_MINI_DB_INIT_RSP_PASSWORD
FMS_MINI_DB_INIT_RSP_ACCESS_GRO
UPS
FMS_OD 1 Following connection establishment, the
object dictionary is read by the partner and
the variables it contains are evaluated. Since
reading the object dictionary puts a
considerable load on the network and delays
the connection establishment, whenever
possible this should be omitted and local
object dictionaries used.
0 No object dictionary is read from the partner.
Caution: If no object dictionary is read,
access to variables on this connection is only
possible when a local object dictionary exists
or variables are configured in the
[connection(variables)] section of the text
database.
Default 1
Entry Meaning
FMS_MINI_DB_OD_FORMAT 0 A short object dictionary is read from the
partner.
1 A long object dictionary is read from the
partner. The long object dictionary contains
additional information such as the variable
name and access rights. The long object
dictionary can only be read when the
connection configuration is suitable.
Default 0
FMS_OD_LOCALFILE Path and file name of the local object dictionary.
InitiateReq 0 The connection is never established actively
1 The connection is established actively when
the partner device is accessed.
2 The connection is always established actively
regardless of its use.
Default 1
AcceptInitiateInd 1 A connection establishment request from the
partner is always accepted.
2 The connection establishment request of the
partner is not accepted, the FMS-OPC server
can, however, attempt to establish the
connection to the partner itself.
Default 1
AbortConnectionAfter 0 The FMS-OPC server never terminates a
connection itself (except when the FMS-OPC
server is closed down)
n>0
The FMS-OPC server terminates a
connection automatically after n ms after the
last use of the connection.
Default 0
Timeout Error monitoring time: If a pending job cannot be
processed within this monitoring time, the
connection is reset and the job is acknowledged
with an error.
Default 15000 ms
Overview The following section of the configuration file allows the definition of
the FMS variables valid for this connection. For access to variables,
the FMS protocol requires information about the properties of the
variables, for example, data type, access rights etc. Variables of a
connection that are required often can be predefined in this section so
that, for example, the data type is known prior to connection
establishment.
An alternative to defining variables in this section is the use of a local
object dictionary.
Entry Meaning
2nd connection section Variables predefined for this connection. The
[Connection|VFD|CP(Variables)] section name consists of the connection name
e.g. and the additional part "(Variables)".
[AG1|VFD1|CP_L2_1:(Variables)]
Name=Index|AccessRights|Type This section contains any number of variable
e.g. definitions
NAME100=100|RW|boolean Boolean
NAME101=101|RW|integer8|NAME102=10 1 byte integer
2|RW|integer16|NAME103=103|RW|integer 2 bytes integer
32 4 bytes integer
NAME104=104|RW|unsigned8 1 byte unsigned integer
NAME105=105|RW|unsigned16 2 bytes unsigned integer
Power=106|RW|unsigned32 4 bytes unsigned integer
Temperature=107|RW|float 4 bytes floating point
NAME108=108|RW|vstring5 Character string 5 characters
NAME109=109|RW|bstring8 Bit string 8 bits
NAME112=112|RW|integer8[4] Array of 4 integers
NAME119=119|RW|ostring5[3] Array of 3 octet strings with a length of 5 bytes
NAME120=120|RW|{integer8|float|vstring3}
| Structure with integer, floating point and
character string with 3 characters
Structures can have a maximum of 10
components.
FMS-Date
NAME130=130|RW|fmsdate
FMS-TimeOfDay
NAME131=131|RW|fmstimeofday4
FMS-TimeDifference
NAME132=132|RW|fmstimedifference4
FMS-TimeOfDay (with days from 01.01.1984)
NAME133=133|RW|fmstimeofday6
FMS-TimeDifference (with days from
NAME134=134|RW|fmstimedifference6 30.12.1899)
Entry Meaning
must not contain blanks.
Name Name in the long object dictionary
Range of values: Length maximum 32
characters, however not longer than defined in
the FMS_MINI_DB_OD_NAME_LENGTH
parameter in the [PROTOCOL] section.
Permitted characters: a-z A-Z 0-9 $ . (period) _
(underscore), ANSI >127
Index FMS variable index, must be higher than 15.
AccessRights R means read access, W means write access,
RW means read and write access.
Type FMS types: The string types vstring, ostring,
bstring, fmstimeofday and fmstimedifference
require additional length information, with bstring
this is always a multiple of 8. Arrays require the
number of array elements in square brackets,
structures can only contain simple data types in
the braces (in other words no arrays or
structures).
Defining Aliases The third section of the configuration file allows the definition of
symbolic names for a valid FMS variable. An alias is a purely textual
substitute for an otherwise valid FMS variable name or FMS variable
index.
Entry Meaning
3rd connection section Predefined aliases for this connection. The
[Connection|VFD|CP(Aliases)] section name is made up of the connection name
e.g. and the additional "(Aliases)".
[AG1|VFD1|CP_L2_1:(Aliases)]
Alias=FMSVariable This section contains any number of alias
e.g. definitions.
The symbolic name "Motor“ refers to FMS Index
Motor=100
100, the "Heatingpower“ name refers to the FMS
Heatingpower=Power
name "Power".
Alias The alias can be used just like a normal FMS
variable on the OPC interface.
Range of values: Length maximum 32
characters
permitted characters: a-z A-Z 0-9 $ _
(underscore) & (), ANSI > 127
FMSVariable Internally, the OPC server replaces the variable
name of the alias with this FMS variable.
Introduction The FMS-OPC server can also be operated as an FMS server as well
as an FMS client. Via an FMS server connection, the FMS-OPC server
provides variables that can be accessed by other FMS devices.
To be able to act as an FMS server, the OPC server must be started
with the help of an OPC client (for example OPC Scout).
Configuration Each FMS VFD|CP pair implicitly has one server connection. All the
communications partners of a VFD|CP pair can access the variables
defined on the server connection via the communication system. The
variables of the server connection are addressed like normal FMS
variables on the OPC interface of the FMS-OPC server. Just like a
normal FMS connection, the server connection also contains three
configuration sections.
Entry Meaning
1st connection section General server parameters
[|VFD|CP]
The connection name of the server connection is
e.g.
empty unless otherwise configured, in other
[|VFD1|CP_L2_1:]
words it consists only of the VFD and CP name.
Server Activating the server connection
1 The VFD-specific server connection is
created.
2 The VFD-specific server connection is not
created.
Default 1
ServerConnectionName The server connection can be assigned a
connection name. This must be different from
the FMS connection name of this VFD. If a
connection name is entered here, all the names
of the sections are changed correspondingly.
Default ”empty”
Entry Meaning
2nd connection section Contains defined variables for the server
[|VFD|CP(Variables)] connection. If a name is entered in
e.g. "ServerConnectionName" in the 1st connection
[|VFD1|CP_L2_1:(Variables)] section, this name must precede the entries
here. Example:
[MyServer|VFD1|CP_L2_1:(Variables)]
Name=Index|AccessRights|Type|Initial- This section contains any number of variable
value definitions
e.g.
100=100|RW|boolean|-1 Boolean
101=101|RW|integer8|-123 1 byte integer
102=102|RW|integer16|-12345 2 bytes integer
103=103|RW|integer32|-1234567 4 bytes integer
104=104|RW|unsigned8|234 1 byte unsigned integer
105=105|RW|unsigned16|23456 2 bytes unsigned integer
Power=106|RW|unsigned32|2345678 4 bytes unsigned integer
Temperature=107|RW|float|1,345 4 bytes floating point
108=108|RW|vstring5|"abcde" Character string 5 characters
109=109|RW|bstring8|1.0.0.1.1.0.0.0 Bit string 8 bits
112=112|RW|integer8[4]|{10|20|30|40} Array of 4 integers
119=119|RW|ostring6[3]|{00.01.02.03.04.0 Array of 3 octet strings with a length of 6 bytes
5|40.41.42.43.44.45|d0.d1.d2.d3.d4.d5}
120=120|RW|{integer8,float,vstring3}|{- Structure with integer, floating point and
55|3|5|"xyz"} character string with 3 characters
Entry Meaning
Type FMS types: The string types vstring, ostring,
bstring, fmstimeofday and fmstimedifference
require additional length information, with bstring
this is always a multiple of 8. Arrays require the
number of array elements in square brackets,
structures can only contain simple data types in
the braces (in other words no arrays or
structures).
Initialvalue The initial value must always correspond to the
particular data type. All initial values of arrays or
structures must be enclosed in braces and be
separated by the pipe symbol "|". The initial
value is optional but should always be used.
Entry Meaning
3rd connection section Aliases predefined for the server connection.
[|VFD|CP(Aliases)]
e.g.
[|VFD1|CP_L2_1:(Aliases)]
Alias=FMSVariable This section contains any number of alias
e.g. definitions.
Entry Meaning
1st connection section Connection-specific parameters. No parameters
[DEMO] are defined within this section.
Entry Meaning
2nd connection section Variables defined for the demo connection.
[DEMO(Variables)]
Entry Meaning
3rd connection section Aliases predefined for the demo connection.
[DEMO(Aliases)]
Alias=FMSVariable This section contains any number of alias
e.g. definitions.
The "conn" parameter identifies the connection; "vfd" and "cp" specify
the CP|VFD pair. The "filename“ parameter specifies the path and file
name of the local object dictionary to be created. The optional
parameter "odformat“ decides whether a long (value 1) or a short (0)
object dictionary is requested. The standard value for this parameter is
0. With the "timeout“ parameter, the time is specified in milliseconds
after which an error is detected. The standard value is 120000 for 2
minutes.
Example: odupload "AG <1>|VFD <1>|CP_L2_1:" myconn.od 1
240000
Uses To allow the local object dictionary to be used for a connection, the
path and file name of the created file must be entered as the value for
the parameter "FMS_OD_LOCALFILE“ in the connection section. The
"FMS_OD“ parameter must also be set to 0 to prevent the transfer of
the object dictionary via the network.
Overview Editing the configuration file for the Send/Receive protocol becomes
necessary in the following situations:
File Location The file location for the configuration file for the SR-OPC server set
during installation is as follows:
General Protocol The following table shows the parameters for configuring the general
Configuration properties of the SR-OPC server.
Entry Meaning
Section [PROTOCOL] The general protocol settings are made in this
section.
CycleTime This value specifies how quickly the job waiting
list is checked through for pending jobs.
Default 100 ms
(set by the configuration program)
UseOnlyThisDevice Access points (devices) at which the SR-OPC
server logs on. Several access points are
separated by commas.
Caution:The last access point must be
terminated by a comma.
Example:
UseOnlyThisDevice=TCPIP:, CP_H1_1:,
UseDemoConn 1 The SR-OPC server generates a simulation
connection with which variable access can be
simulated without a functioning protocol.
0 No simulation connection is provided.
Default 0
(set by the configuration program)
BufferLength Segmentation of the data buffer
Range of values 512 – 4096
A change in the default maximum value is only
required when you are operating a TF database
of the SIMATIC NET TF communication protocol
at the same time. The maximum value must be
matched with the buffer pool of the TF database
(PDU size setting in the COML TF configuration
tool, refer to the TF documentation).
Default 4096
Overview Each access point used by the SR-OPC server has a section in the
text database file in which connections to network partners including
symbolic names can be predefined. The advantage of this is that when
the configuration is changed, (for example changed Ethernet address
on the communication partner) the address only needs to be changed
at one central point if the symbolic name was also used by the OPC
application in the SR variables.
Entry Meaning
Access point section Connection predefined for this access
[Access point(Connections)] point. During operation, further
e.g. connections can be used with suitable
[CP_H1_1:(Connections)] SR variable notations.
Name=LocalTSAP,HostID,RemoteTSAP,ActiveFla This section contains any number of
g connection definitions.
e.g.
Passive connection establishment,
S5Receive=&PCPCPCPC,142.11.45.150,&RECVR TCPIP
ECV,0
S5Send=FF.FF.FF.FF, 142.11.45.150,AA.AA.AA,1 Active connection establishment, TCPIP,
as alternative TSAP
S5Fetch=&PCPCPCPC,08.00.06.01.26.70,&PCPC Active connection establishment, ISO
PC01,1
S5Write=&PCPCPCPC,08.00.06.01.26.70,&PCPC Active connection establishment, ISO
PC02,1
S5ReceiveExp=&PCPCPCPC,08.00.06.01.26.70,& Passive connection establishment, ISO
RECVREEX,0
S5SendExp=&PCPCPCPC,08.00.06.01.26.70,&SE Active connection establishment, ISO
NDSEEX,1
The individual elements of the
connection definition must be separated
by commas and must not contain blanks.
Name Symbolic connection name,
Range of values: Length maximum 32
characters, permitted characters: a-z A-Z
0-9 $ _ (underscore)
LocalTSAP Local TSAP, two notations are possible:
1. Hex Notation
xx.xx.xx.xx.xx.xx.xx
maximum 8 two-digit hexadecimal
values separated by periods.
2. Alternative String Notation
&TTTTTTTT
preceding & symbol followed by a
maximum of 8 printable characters. The
comma must not be used.
If you want non-printable characters or
Entry Meaning
commas in the TSAP name, you must
use hexadecimal notation.
HostID Ethernet or TCP/IP address of the
partner station.
1. Ethernet
xx.xx.xx.xx.xx.xx
exactly 6 two digit, hexadecimal
values separated by periods.
2. TCP/IP
yyy.yyy.yyy.yyy
exactly 4 3-digit decimal values
between 0 and 255 separated by
periods.
RemoteTSAP TSAP of the partner station, the notation
is the same as for LocalTSAP.
ActiveFlag 0 Passive establishment, the
partner establishes the
connection
1 Active establishment, the
partner waits for
connection establishment
Overview Each SR connection has up to two sections in a text database file. The
connection-specific parameters are configured in the first section, in
the second section, aliases for variables can be defined. The
configuration is evaluated when the SR-OPC server starts up.
Entry Meaning
1st connection section Connection-specific parameters
[Connection Name|Address|Access Point] If no symbolic name exists for a connection, this
e.g. must be used, otherwise the symbolic address.
[LocalClient||TCPIP:] They must not both be used at the same time.
[|&TCP2,142.11.45.150,&TCP1,1|TCPIP:]
Conn_persistance_count SR parameter of the SR variable field 1, see SR
documentation
Default 0
Conn_abort_timeout SR parameter of the SR variable field 1, see SR
documentation
Default 0
Conn_negot_options SR parameter of the SR variable field 1, see SR
documentation
Default 0x0000
AbortConnectionAfter 0 The SR-OPC server never terminates a
connection itself (except when the SR-OPC
server is closed down)
n > 0 The FMS-OPC server terminates a
connection automatically n ms after the last
use of the connection.
Default 0
S5Access Controls the access rights to variables for the
"FETCH" and "SEND with WRITE function"
modes. By using this parameter, you can, for
example, prevent a read job being requested on
a SEND connection which would lead to a
connection close by the partner.
0 S5 variables are not permitted on this
connection.
1 S5 variables are permitted only with read
access
2 S5 variables are permitted only with write
access
Default 0
(If direct access to S5 variables is required
Entry Meaning
with FETCH or SEND with WRITE function,
this parameter must be set.)
Initiate Controls the point in time at which a connection
is established
1 The connection is established actively where
necessary when the partner is accessed
2 The connection is established actively as
soon as the connection is closed. (For
example when the program starts up)
Default 1
Timeout Error monitoring time: If a pending job cannot be
processed within this monitoring time, the
connection is reset and the job is acknowledged
with an error.
Default 15000 ms
LenSend Preset size of the default send buffer
During operation, further additional send buffers
of any length (maximum 65535 bytes) can be
used.
Default 256
LenSendExp Preset size of the default send buffer for high
priority data.
During operation, additional send buffers of any
length (max. 16 bytes) can be used.
Default 16
Entry Meaning
2nd connection section Predefined aliases for this connection. An alias is
[Connection Name|Address|Access a purely textual substitute for an otherwise valid
Point(Aliases)] SR variable name.
e.g.
Nesting of aliases is not supported, in other
[LocalClient||TCPIP:(Aliases)]
words an alias must always refer directly to a
[|&TCP2, 142.11.45.150,&TCP1,1|
valid SR variable of this connection.
TCPIP:(Aliases)]
Alias=SRVariable This section contains any number of alias
e.g. definitions.
Motor=Receive,w0
Heatingpower=Send10,dword3 Alias motor refers to a word in the receive block.
Alias heatingpower refers to a double word within
a send buffer.
Entry Meaning
Alias The alias can be used like a normal SR variable
on the OPC interface.
Range of values: Length maximum 32
characters
permitted characters: a-z A-Z 0-9 $ _
(underscore) & (), ANSI > 127
SRVariable On the OPC interface, the occurrence of the
alias is replaced by this SR variable.
• E (Inputs, 4 bytes)
• A (Outputs, 4 bytes)
• P (Peripheral I/Os, 8 bytes)
• M (Flag, 256 bytes)
• DB10 (Data block number 10, 256 bytes).
Entry Meaning
1st connection section Connection-specific parameters, this section is
[DEMO] not currently supported.
Entry Meaning
2nd connection section Aliases predefined for the demo connection.
[DEMO(Aliases)]
Alias=SRVariable This section contains any number of alias
e.g. definitions.
Overview You must edit the configuration file for the Send/Receive protocol in
PROFIBUS (FDL) in the following situations:
File Location The file location for the configuration file for the FDL-OPC server set
during installation is as follows:
General Protocol The following table shows the parameters for configuring the general
Configuration properties of the FDL-OPC server.
Entry Meaning
Section [PROTOCOL] The general protocol settings are made in this
section.
CycleTime Default 100 ms.
This value specifies how quickly the job waiting
list is checked through for pending jobs.
UseOnlyThisDevice Access points (devices) at which the FDL core
logs on. Several access points are separated by
commas. Caution: The last access point must be
terminated by a comma.
Example:
UseOnlyThisVFD=CP_L2_1:,CP_L2_2:,
UseDemoConn 0 Default.
No simulation connection is provided.
1 The FDL core generates a simulation
connection with which item access can be
simulated without a functioning protocol.
AutoDefineConnection 0 Default
1 The FDL core server detects all connected
partners when it is started up and creates a
connection for each of them via the default
SAPs. Since these connections are entered in
the text database, the core server resets this
flag to 0 again after it has been used once.
Overview Each FDL access point has a further section in the text database file in
which connections to network partners including symbolic names can
be predefined. The advantage of this is that when the configuration is
changed, (for example changed PROFIBUS station address on the
communication partner) the address only needs to be changed at one
central point if the symbolic name was also used by the OPC
application in the FDL items.
Entry Meaning
Access point section Connection predefined for this access point.
[Access point(Connections)] During runtime, further connections can be
e.g. created using suitable FDL item notations.
[CP_L2_1:(Connections)]
Name=LocalSAP,STATION,RemoteSAP This section contains any number of connection
e.g. definitions.
PLC1=15,11,14
STATION_10=255,10,255
The individual elements of the connection
definition must be separated by commas and
must not contain blanks.
Name Symbolic connection name,
Range of values: Length maximum 32
characters. Permitted characters: a-z A-Z 0-9 $ _
(underscore)
LocalSAP Local SAP
Range of values: 0-63, 255
STATION Profibus station address
RemoteSAP SAP of the partner station.
Range of values: 0-126,127
Overview Each FDL connection has up to two sections in a text database file.
The connection-specific parameters are configured in the first section,
in the second section, aliases for FDL items can be defined. The
configuration is evaluated when the FDL core starts up.
Entry Meaning
1st connection section Connection-specific parameters
[Connection Name|Address|Access Point]
If no symbolic name exists for a connection, this
e.g.
must be used, otherwise the symbolic address.
[PLC1|CP_L2_1:]
They must not both be used at the same time.
[|255,10,255|CP_L2_1:]
Timeout Default 15000 ms
Error monitoring time: If a pending job cannot be
processed within this monitoring time, the
connection is reset and the job is acknowledged
with an error.
MaxSendCredits Default 3
Maximum number of parallel send jobs on this
connection
MaxRetryNoRessources Default 5
Maximum number of repeated send attempts if
the partner is temporarily unable to receive due
to a lack of resources
Conn_negot_options Default 0x0000
FDL parameter of the FDL variable field 1, see
FDL documentation
LenSendSDA Default 244 or 246 (with default SAPs)
Preset size of the default send buffer for
acknowledged sending.
During operation, further additional send buffers
of any length (maximum 244 or 246 bytes) can
be used.
LenSendSDN Default 244 or 246 (with default SAPs)
Preset size of the default send buffer for
unacknowledged sending.
During operation, further additional send buffers
of any length (maximum 244 or 246 bytes) can
be used.
Entry Meaning
Name This demonstration connection always has the name DEMO. Make
sure that no other connection with this name exists in your network
configuration.
Entry Meaning
1st connection section Connection-specific parameters, this section is
[DEMO] not currently supported.
Entry Meaning
2nd connection section Aliases predefined for the demo connection.
[DEMO(Aliases)]
Alias=FDLItem The section contains any number of alias
e.g. definitions, see above.
• Receive
• Send
Managing The FDL core can create and manage new connections during
Connections operation using an FDL variable with a suitable connection definition
using a symbolic address via the IVar interface, for example:
FDL:[|255,33,255|CP_L2_1:]receive
Overview You must edit the configuration file for the DPS protocol in PROFIBUS
(DPS) in the following situations:
File Location The file location for the configuration file for the DPS-OPC server set
during installation is as follows:
General Protocol The following table shows the parameters for configuring the general
Configuration properties of the DPS-OPC server.
Entry Meaning
Section [PROTOCOL] The general protocol settings are made in this
section.
CycleTime Default 20 ms
This value specifies how quickly the job waiting
list is checked through for pending jobs.
UseOnlyThisBoard Default DPSONLINE,
Board at which the DPS core logs on.
UseDemoBoard 0 Default
No simulation connection is made available.
1 The DPS core generates a simulation
connection with which slave access can be
simulated without a functioning protocol. The
slaves available in the demo connection can
be configured.
CSWatchThread 0 Default.
Debug monitoring deactivated.
For debugging purposes; not intended to be
documented for the user.
1 The DPS core creates the files WatchCS.ini
and WatchCS2.ini cyclically in the Windows
NT root folder. These files contain information
about the most important internal critical
sections.
ClearAlarms Default 60000 ms
Time after which a pending protocol alarm is
removed from the internal waiting list if it cannot
be passed on to an IAlarm client.
Alarms are not currently supported and this
parameter should therefore not be documented
for the user.
Entry Meaning
1st Board Section Logon parameters set for this board.
[Boardname]
e.g.
[CP_L2_1:]
GSD Standardized PROFIBUS GSD file that identifies
the slave. The core server, however, only uses
the information PNO_Ident and the first module
description.
StationAddr PROFIBUS station address for the slave
Baudrate Baudrate used, the following values are possible:
Baudrate=BD_9K6
Baudrate=BD_19K2
Baudrate=BD_93K75
Baudrate=BD_187K5
Baudrate=BD_500K
Baudrate=BD_1M5
Baudrate=BD_3M
Baudrate=BD_6M
Baudrate=BD_12M
Baudrate=BD_45K45
AutoOnline 1 Default: The core server switches the slave
online when it starts up.
0 The core server does not switch the slave
online when it starts up, the slave is then only
ready for operation when the item
&devicestate() is written.
Entry Meaning
2nd Board Section Predefined alias for this board An alias is a
[Boardname(Aliases)] purely textual substitute for an otherwise valid
DPS item.
e.g.
Nesting of aliases is not supported, in other
[DPSONLINE(Aliases)]
words an alias must always refer directly to a
valid DPS item of the board.
Alias=DPSItem This section contains any number of alias
definitions.
e.g.
Motor=SlaveM2EX0.3 Alias Motor input bit of a slave
Heatingpower=SlaveAW3 Alias Heatingpower refers to an output word of a
slave.
Alias The alias can be used just like a normal DPS
item on the IVar interface.
Range of values: Length maximum 32
characters
permitted characters: a-z A-Z 0-9 $ _
(underscore) . (period) & (), ANSI > 127
DPSItem On the Ivar interface, the occurrence of the alias
is replaced by this DPS item.
Sample Slaves Due to the complicated structure of the slave configuration data, this
section should not be made public to the user but a text database
containing several useful sample slaves should be made available.
Entry Meaning
1st Demo Board Section Connection-specific parameters, this section is
[DEMO] not currently supported.
GSD Standardized PROFIBUS GSD file that identifies
the slave. The core server DPS, however, uses
only the first module description.
Entry Meaning
3rd Demo Board Section Predefined aliases for the demo board. An alias
[DEMO(Aliases)] is a purely textual substitute for an otherwise
valid DPS item.
Nesting of aliases is not supported, in other
words an alias must always refer directly to a
valid DPS item of the demo board.
Alias=DPSItem This section contains any number of alias
definitions, see above.
e.g.
Motor=SlaveM2EX0.3 The "Motor" alias references an input bit of a
slave.
Heatingpower=SlaveAW3 Alias "Heatingpower" references an output word
of a slave.
With Windows NT, version 4.0 or higher, the client can run COM objects on another
computer. This functionality that allows the COM objects of an application to be
distributed on several computers is known as DCOM (Distributed COM).
This chapter explains how to set up the OPC server for SIMATIC NET to operate with the
DCOM functionality.
What is DCOM? COM objects such as the OPC server do not necessarily need to be on
the same computer as the client. With DCOM (Distributed COM), a
client can create and use COM objects both on its own system and on
other computers. This allows the components of an application to be
distributed within a network.
COM Library A client does not address an object directly to start it or use it but
accesses the COM library. This is part of the operating system. The
COM library manages information in the registry about the COM object
known in the system.
COM library
Computer
OPC-Client
OPC client OPC server
COM-
COM COM
Bibliothek
library library
Transparency For the client, the use of a COM object with DCOM or with local COM
mechanisms is transparent. The operating system internal COM library
manages the object and recognizes where the object should be created
based on the object configuration.
Program Before a client can use a COM object on another computer, the
"dcomcnfg" properties of the COM object must be configured on the client
computer and on the remote computer.
DCOM and the COM objects required on the computer are configured
using the system program dcomcnfg from the "Windows\System32"
folder. After starting the program, for example by entering "dcomcnfg"
in the "Run" dialog (Start menu), three tabs are available for
configuring DCOM:
This text describes the situation in which exactly one client connects to
an OPC server running on a different computer. If you want to use
more than one OPC server from a client, please refer to the DCOM
documentation.
Default Properties In the "Default Properties" tab, you specify basic properties of DCOM.
For DCOM operation with the OPC server within a workgroup (no
domain server available for authentication) make the settings as
shown.
If a domain server can be used for authentication, the default
authentication level can be set to "Connect" and the Default
Impersonation Level to "Identify" for security reasons. For installation
and startup, however, the settings shown below are also recommended
for this mode.
Default Security In the "Default Security" tab, you can specify the rights for DCOM
operation. These settings make sure that only clients with the correct
permissions can use the server.
The following default permissions are relevant in conjunction with
DCOM:
• Access permissions
• Launch permissions
• Configuration permissions
These permissions can be set individually for each object and the
default properties are then ignored.
Access The default access permissions for all COM objects specify which
Permissions accounts are allowed to access the object; in other words call the
methods and which accounts are explicitly denied access.
Launch The default launch permissions for all COM objects specify which
Permissions accounts have the right to create the object and which accounts are
explicitly denied this permission.
Configuration The default configuration permissions specify which accounts can
Permissions modify the information in the registry about COM objects; in other
words can also install new objects on the computer.
Applications The "Applications" tab displays all the COM objects available on the
computer. Here, you select a COM object you want to configure and
open the configuration dialog by clicking the "Properties" button.
The OPC server for SIMATIC NET is listed as "OPC.SimaticNET".
Different The DCOM configuration for the computer with the OPC client differs
Configurations from that of the computer with the OPC server:
• For the computer with the OPC client, you must set the computer in
the network on which the server will be activated and the account
for the server.
• For the computer with the OPC server, you must set the accounts
that have the right to use the server. In addition to the special
permissions in conjunction with OPC, the account of the user of the
OPC servers must also have user permissions.
"Location" Tab
The "Location" tab is used to specify the computer on which the server
is started. Since the configuration of the computer with the OPC server
is described in this section, you must specify "Run application on this
computer".
"Identity" Tab
"The Launching The account of the user that launched the OPC client is used. This
User" user must then also have the required permissions; in other words,
must be entered in the "Security" tab. The user must also have the
default permissions entered for the group of users on this computer; in
other words, must belong to the group of users. This mode must not
be used with the OPC server for SIMATIC NET since the OPC server
cannot be started more than once (by different users).
This User The account of a specified user is used. This user must have the
required permissions; in other words, must be entered in the "Security"
tab. The user must also have the default permissions entered for the
group of users on this computer; in other words, must belong to the
group of users. This setting must be used for the server mode of the
OPC server for SIMATIC NET (no user logged on).
"Security" Tab You specify the access permissions for the OPC server in the
"Security" tab. For the three aspects relevant to COM objects, you can
either use the default permissions or user-defined permissions for the
selected COM object.
When using the default permissions, the account entered in the
"Identity" tab must have the required permissions in the settings for
default security (default access permission, default launch permission).
If you do not want a particular user to have all COM objects of the
system available, you must configure user-defined permissions. To
operate the OPC server, only the access permission and the launch
permission need to be configured.
Selecting Users The users that are allowed to use the OPC server must be entered in
the default access permissions. Several users have been entered as
examples of the required permissions:
Type of access:
Allow launch
Access to registry:
HKEY_CLASSES_
ROOT
The application that will use the OPC server runs on the client
computer. The OPC server itself is started on another computer when
using DCOM, which is why there is no process for the OPC server
visible in Windows NT Task Manager. The OPC server must
nevertheless be registered on the client computer so that the COM
library knows the required object and so that configuration is possible.
You should also read the notes on client installation in the Installation
Instructions.
For the computer with the OPC client, you must set the computer in
the network on which the server will be activated and the account for
the server.
"Location" Tab The location of the server must be specified in this tab. For DCOM
operation, only the check box "Run application on the following
computer:" must be selected. Click "Browse" to locate the server
computer.
"Identity" Tab In the "Identity" tab, you specify which user account should be used for
the client computer. For the client computer, it makes sense to specify
the currently interactive user; in other words the logged on user.
"Security" Tab The security settings should be made as they are configured on the
server computer.
Please note the following:
DCOM always uses the secure settings. If, for example "connect" and
☞ "anonymous" are set on the client and "none" and "identify" are set on
the server, the combination "connect" and "identify" will be used for the
DCOM protocol.
This chapter explains how the OPC Custom interface for Data Access is used. It also
lists the interfaces and methods of the OPC customer interface. This is not a detailed
interface description but contains supplementary information and notes relating
specifically to SIMATIC NET.
the OPC server for SIMATIC NET supports version 2.0 of the OPC
Custom Interface.
Introduction The following sections illustrate step-by-step how you can call the
methods of an instance of an OLE class in C++. Note the difference
between the term class in OLE and in C++.
OLE Classes, C++ A Windows object is an instance of an OLE class. The term OLE class
Classes differs from the class in C++. A class in C++ is a type definition. An
OLE class is, however, an object description and does not contain
types.
Class Identification Each OLE class can be identified uniquely by a 128 bit long
Code identification code, the CLSID. This is used by the operating system for
the unique assignment of a DLL or EXE file that implements this class.
A client that wishes to use an object of a class requires only the
CLSID.
The following applies to the OPC server for SIMATIC NET for all
protocols:
OPC.SimaticNET
Step Description
1 Initialize COM
2 Query the CLSID
3 Create an Object
4 Call an OPC function
5 Release the interfaces used
Step 1: Before you can use the functions of COM, the COM library must be
Initialize COM initialized with the following call:
#include "opc.h"
HRESULT r1;
r1 = CoInitialize(NULL);
Step 2: If the name of an object is known, the CLSID can be queried using the
Query the CLSID OLE function “CLSIDFromProgID”.
Example
The following program section illustrates how to query the CLSID for
the OPC server for SIMATIC NET:
CLSID clsid;
Example
The following lines show how an object of the class “OPC server” with
reference to the “IUnknown” interface can be created:
IUnknown * pOPCUnknown;
Example
The program shown below outputs the status of the server and the
vendor information. If the “GetStatus” method is called successfully,
the OPC server allocates the memory areas for the return information
via the “IMalloc” interface. The user must release these memory areas
again.
IOPCServer *pOPCServer;
IMAlloc *pIMalloc;
OPCSERVERSTATUS *pss;
r1 = pOPCUnknown->QueryInterface(IID_IOPCServer,
(void**)&pOPCServer);
r1 = pOPCServer ->GetStatus(&pss);
CoGetMalloc( 1, &pIMalloc);
pIMalloc->Free(pss->szVendorInfo);
pIMalloc->Free(pss);
Example
Using the following commands, the reference counter for the interfaces
“IUnknown” and “IOPCServer” is reset:
pOPCServer->Release();
pOPCUnknown->Release();
pIMalloc->Release();
Structure of the The following supplementary information about the interfaces lists the
Description objects of OPC, their interfaces and the methods defined in these
interfaces and points out particular characteristics of the OPC server
for SIMATIC NET.
Return Values All the listed methods return a result of the type HRESULT.
Description The OPC server class has various attributes that contain information
about the status, the version etc. of an OPC server object. The OPC
server class also has methods with which the client can manage the
objects of the OPC group class. A client application addresses only an
object of this class directly using COM mechanisms. The other objects
are created by corresponding OPC methods.
The methods of the IOPCServer interface are used to manage the
objects in the OPC group class. The interface IOPCBrowseSer-
verAddressSpace allows the address space of the server to be
investigated.
Schematic The following schematic illustrates the “OPC server” object with its
interfaces.
IUnknown
IOPCServer
IOPCBrowseServerAddressSpace
OPC server
object
IOPCCommon (V2.0)
IConnectionPointContainer (V2.0)
IOPCItemsProperties (V2.0)
Description:
Creates a group in the server object.
Notes:
• The "pTimeBias" parameter is not evaluated by the OPC server for
SIMATIC NET.
• "LCID" is irrelevant for the OPC server for SIMATIC NET.
• The "UpdateRate" is specified by the configuration parameter
“Minimum Update Rate” as a multiple of the configuration value.
• The “pPercentDeadband” parameter has no significance for the
OPC server for SIMATIC NET.
• If the "szName" parameter is empty, a name is generated beginning
with the underscore character (for example “_123456”). User-
defined names should therefore not begin with the underscore
character.
CreateGroupEnumerator
( dwScope, riid, ppUnk )
Description:
Creates various enumerators for the group.
Notes:
Since there are no public groups in the OPC server for SIMATIC NET,
the return values for the parameter “dwScope” “...PRIVATE” and
“...PUBLIC” are identical.
Description:
Supplies the error message for a specific error code.
Notes:
The OPC server for SIMATIC NET supports German and English error
texts. Errors detected by the Windows operating system are explained
in the language in which the operating system was installed.
Description:
Supplies an additional interface pointer for the name of a private
group, in other words the reference counter is incremented.
GetStatus ( ppServerStatus )
Description:
Supplies the status information of the server.
Notes:
The return value of the OPC server for SIMATIC NET is the name and
the version of the OPC server.
Description:
Deletes a group on the server.
Notes:
The OPC server for SIMATIC NET does not support the use of the
"bForce“ parameter. It is not possible to delete groups to which
references are still active.
Overview This interface contains methods with which the address area of the
server can be queried. The address area contains all the OPC items
known to the server.
Description:
This provides the possibility of querying the access path of an ItemID.
Notes:
Not required for the OPC server for SIMATIC NET.
Description:
Supplies a string of the type “IEnumString” whose content is specified
by the call parameters. The position from which the list is created can
be set using the “ChangeBrowsePosition” method.
Notes:
• “BRANCH” excludes the filters for Type and AccessRights.
• The rules for creating a filter are as follows:
− Asterisk (*) Any character string, including
empty strings
− Plus (+) Any string of characters,
however at least one character
− Question marks (?) Any single character
− Square brackets ( [ ] ) One single character from the
specified set
• To use one of the filter characters, this must be preceded by a back
slash (\).
ChangeBrowsePosition
( dwBrowseDirection, szString )
Description:
Allows you to browse through the address area. You can change to the
higher level or to a branch.
Description:
Creates a complete ItemID in the hierarchical address area. This
function is necessary since browsing itself only provides the
designations below the current node.
Notes:
The description of GetItemID in OPC specification is inconsistent with
the description of ChangeBrowsePosition. With
ChangeBrowsePosition, it is not possible to specify a complete ItemID.
For this reason, the OPC server for SIMATIC NET only currently
supports the command GetItemID for single leaves (LEAF).
QueryOrganization ( pNameSpaceType )
Description:
Supplies the structure of the address area. The address area can be
organized with a flat or hierarchical structure.
Notes:
The structure of the address area of the OPC server for SIMATIC NET
is structured hierarchically.
Overview This interface of version 2.0 of the OPC Custom Interface contains
methods allowing the language settings and the name of the client to
be made known to the server.
SetLocaleID ( dwLcid )
Description:
Sets the language code of the server. The language code specifies the
language in which the server outputs text.
Notes:
The OPC server for SIMATIC NET supports English and German.
GetLocaleID ( pdwLcid )
Description:
Fetches the language code of the server.
Notes:
The OPC server for SIMATIC NET supports English and German.
QueryAvailableLocaleIDs
( pdwLcid )
Description:
Provides all the available language codes of the server.
Notes:
The OPC server for SIMATIC NET supports English and German.
Description:
Provides the error text for a specific error code in the set language.
SetClientName ( szName )
Description:
Transfers a descriptive text for the client to the server. The descriptive
text can be used for any purpose by the server, for example for logging
in trace files.
Overview This interface of version 2.0 contains methods allowing specific server
information to be queried about an item.
QueryAvailableProperties
( szItemID, pdwCount, ppPropertyIDs, ppDescriptions,
ppvtDataTypes )
Description:
Returns a list of available properties for an item.
Description:
Provides the values of the properties of an item transferred in a list of
PropertyIDs.
Description:
Provides (whenever possible for the propertyID) a list of ItemIDs for a
list of PropertyIDs. These ItemIDs can be included in a group
simplifying and speeding up access to the data.
Notes:
The OPC server for SIMATIC NET does not support this function. The
call is rejected with error message 0x8004001 (not implemented).
Description The “OPC Group” class manages the individual process variables, the
OPC items. Using these group objects, a client can form semantically
meaningful units of OPC items and execute operations with them.
Schematic The following schematic illustrates an object of the “OPC Group” class
and its interfaces.
IUnknown
IOPCItemMgt
IOPCGroupStateMgt
IOPCSyncIO
IOPCAsyncIO OPC group
IDataObject object
IEnumOPCItemAttributes
IOPCAsyncIO2 (V 2.0)
IConnectionPointContainer (V2.0)
Overview This interface provides methods to manage more than one item in a
group.
Time Stamp With each value read, OPC supplies a time stamp. This indicates
when this value was received or when it was changed. Since the
SIMATIC systems do not use a time stamp, the time at which the value
is received on the server is used as the time stamp.
Description:
Adds one or more items to a group.
Notes:
• A unique name of an item for the OPC server for SIMATIC NET is
as follows:
[<protId>:<connName>]VariableName (for DP and S7)
or
<protId>:[<connName>]VariableName (for FMS and SR)
Examples: S7:[S7-OPC_1|VFD1_OPC|CP_L2_1:]EB0
DP:[CP_L2_1]Slave063SlaveState
FMS:[CR1|VFD1|CP_L2_1:]100
SR:[MyConnection||CP_H1_1:]receive
Description:
Creates an enumerator for the items of a group.
Description:
Deletes one or more items from a group.
Description:
Sets the active state of one or more items in a group.
Description:
Sets the client handle of one or more items in a group.
Description:
Sets the requested data type of one or more items in a group.
Notes:
See AddItem
Description:
Checks the validity of an OPC item, for example whether it was added
to a group without any error occurring, and supplies information such
as the canonical data type.
Notes:
See AddItem
Description:
Creates a copy of a group. All group attributes are copied except for
the following:
• The active state is set to FALSE
• A new server handle is assigned
Notes:
The “szName” parameter can be empty. In this case a unique name is
generated (see AddGroup).
Description:
Fetches the status of the group. The client application must inform the
OPC server where the results are to be stored using a pointer.
Notes:
• The "pTimeBias" parameter is irrelevant for the OPC server for
SIMATIC NET.
• The “pPercentDeadband” parameter has no significance for the
OPC server for SIMATIC NET.
• The “LCID” parameter, in other words language-specific textual
values in read/write, has no significance for SIMATIC variables.
SetName ( szName )
Description:
Allows the name of a group to be changed. The name must always be
unique.
Description:
SetState allows various properties of the group to be changed.
Notes:
• The "pTimeBias" parameter is irrelevant for the OPC server for
SIMATIC NET.
• The “pPercentDeadband” parameter has no significance for the
OPC server for SIMATIC NET.
• The “LCID” parameter, in other words language-specific textual
values in read/write, has no significance for SIMATIC variables.
• The "UpdateRate" is specified by the configuration parameter
“Minimum Update Rate” as a multiple of this value.
Overview This interface provides methods for synchronous reading and writing.
Synchronous means that the client waits until the read or write
operation is completed and only then continues execution.
Use The use of synchronous calls is recommended when the client requires
the result for further processing. Other clients are not blocked since the
OPC server for SIMATIC NET starts a separate thread for each client.
In general, it is advisable to use the IData interface for processing
variable changes (or IAdviseSink on the client side). This interface
guarantees the highest possible data throughput and also reduces the
actual number of calls to the absolute minimum (only when changes
occur).
Description:
Reads the values, status information or time stamp of one or more
items in a group. The values can be read from the cache of the server
or directly from the hardware. Reading from the cache is, however,
only possible when the group is activated.
Notes:
The call is monitored by the timeout monitoring on the server. The
corresponding configuration parameter is “Read/Write Timeout” (see
Section 7.4).
Description:
Writes values for one or more items of a group to the hardware.
Notes:
The call is monitored by the timeout monitoring on the server. The
corresponding configuration parameter is “Read/Write Timeout” (see
Section 7.4).
Overview This interface of the Group class provides methods for asynchronous
reading and writing of items. Asynchronous means that the client
triggers a read or write operation and then continues operation.
Asynchronous operations provide a transaction ID. When the server
has completed the read or write operation, the client receives a
message sent to its IAdviseSink interface.
Cancel ( dwTransactionID )
Description:
Cancels an outstanding job.
Description:
Sends an asynchronous read command. The result is sent to the
IAdviseSink interface of the client.
Notes:
The call is monitored by the timeout monitoring on the server. The
corresponding configuration parameter is “Read/Write Timeout” (see
Section 7.4). If the timeout monitoring is aborted, there is a callback
with hrStatus=E_ABORT.
Description:
Requests a current value for every active OPC item.
Description:
Sends an asynchronous write command.
Notes:
The call is monitored by the timeout monitoring on the server. The
corresponding configuration parameter is “Read/Write Timeout” (see
Section 7.4). If the timeout monitoring is aborted there is a callback
with hrStatus=E_ABORT.
Overview The IDataObject interface is the standard interface of OLE for data
transmission. It contains methods for establishing a message
connection between the client and a server group.
Description of the If the server wants to send a message to a client, the client must
Mechanism provide a partner for the server. This partner is the IAdviseSink
interface of the client. A server sends a message to a client by calling
the OnDataChange method of the IAdviseSink interface of the client.
Schematic of the The following schematic illustrates how the “IAdviseSink” interface on
Mechanism the client and “IDataObject” on the server interact.
Client Server
IDataObject::DAdvise
IAdviseSink IDataObject
IAdviseSink::OnDataChange
Description:
Establishes a connection between a server and the client. If a client
wants to receive a message, it must establish a connection using this
method. It transfers a pointer to its IAdviseSink interface to the server.
DUnadvise ( Connection )
Description:
Terminates an existing connection between a client and server.
Overview This interface based on the IEnum standard interface returns the items
of a group. The interface is supplied only by
“IOPCItemMgr:CreateEnumerator”. It is not obtainable with
QueryInterface.
Clone ( ppEnumItemAttributes )
Description:
Creates an identical copy of the enumerator.
Description:
Fetches the next OPC item of the group.
Notes:
The OPC server for SIMATIC NET does not support engineering units.
EUType and EUInfo are therefore irrelevant.
Reset ( void )
Description:
Resets the list to the first item of the group.
Skip ( celt )
Description:
Skips a number of items in the list.
Description:
Sends an asynchronous read command. The result is sent to the client
via a connection point.
Notes:
The call is monitored by the timeout monitoring on the server. If the set
time is exceeded, this is indicated by the status E_ABORT.
Description:
Sends an asynchronous write command. The message indicating
completion of the job comes via the specified connection point.
Notes:
The call is monitored by the timeout monitoring on the server. If the set
time is exceeded, this is indicated by the status E_ABORT.
Cancel2 ( dwCancelID )
Description:
Cancels an outstanding job.
Description:
Requests a current value for every active OPC item.
SetEnable ( bEnable )
Description:
Activates messages via connection points. Messages generated by the
Refresh method are sent regardless of these settings.
GetEnable ( pbEnable )
Description:
Returns the current value of the flag for messages via connection
points.
This chapter explains how the OPC Automation interface for Data Access is used. It also
lists the properties and methods of the OPC automation interface. This is not a detailed
interface description but contains supplementary information and notes relating
specifically to the OPC server of SIMATIC NET.
Introduction The OPC automation interface was specified by the OPC Foundation
in version 1.0. Certain aspects in this specification were unclear and it
was not approved. Some weaknesses of version 1.0 became
particularly clear with the introduction of Visual Basic 5.0.
New Version Since the start 1999, there is an approved version of the specification
of the automation interface available with version number 2.02.
The following descriptions relate to version 2.02 of the specification of
the OPC automation interface.
Procedure
Step Description
1 Declaring the Variables
5 Synchronous Reading
Preparations Create a new Visual Basic project and the activate the reference for
the automation interface 2.02 of the OPC server in the "Project -
References" menu.
Step 1: In Visual Basic or Visual Basic for Applications, a variable of the type
Declaring a Object refers to an OLE object. The DIM statement declares an object
Variable of the instance.
Object Type
Example
Example
The following code section shows how a Visual Basic client can
connect to the OPC server for SIMATIC NET:
Example
The following lines show how a group is created in Visual Basic:
'Declarations
Step 4: OPC items will now be inserted in the created group object. The items
Adding OPC Items represent the connections to the process variables, their parameter
ItemID specifies which variable will be addressed. The syntax of this
parameter is shown in Chapter 5.
When the method is called, the server initializes the values of the
arrays "lServerHandles“, "lErrors“ and "ItemsObj“. The "IErrors“ array
contains status information for each item inserted that indicated
whether or not the item was successfully inserted.
Example
The following example creates two items in the previously created
OPC group "GrpObj“. The first item represents a DP variable, the
second an FMS variable.
'Declaration
Dim ItemServerHandles() As Long
Const MAX_INDEX = 2
Const OPC_DS_CACHE = 1
Const OPC_DS_DEVICE = 2
'Definition of ItemIDs
szItemIDs(1) = "FMS:[DEMO]101"
szItemIDs(2) = "DP:[DEMO]MyMotor"
AccPath(1) = ""
AccPath(2) = ""
Step 5: In the last step, a synchronous read operation to read the process
Synchronous variables of a group is executed. Synchronous means that the server
Reading only returns control to the Visual Basic program after the required
results have been returned via the communications system. This
means that the flow of communication is delayed by the time required
for this communication. The OPCDevice constant means that the
values should be read directly from the device and not from the cache
of the OPC server.
Example
Just like the AddItems command, OPCRead is also a group operation,
in other words several process variables within a group can be
accessed with one call. The "lNumItems“ parameter specifies the
number of variables to be read. The individual variables themselves
are described in the array "lServerHandles“ by the handle assigned by
the server.
The values are returned as long and as string according to the
"ReqDataTypes" parameter of the "AddItems" method.
Object Model for The object model for the OPC automation interface according
the Automation specification 2.0 differs from the model described in Section 4.4:
Interface Separate collection objects manage the objects OPC Group and OPC
Item. The collection objects provide functions for counting the objects
assigned to them. The browsing functions are also brought together in
a separate "OPC browser" object.
OPCServer
1:1 1:n
OPCGroups
(Collection) OPC-Browser
1:n
OPCGroup
1:1
OPCItems
(Collection)
1:n
OPCItem
Structure of the The following supplementary information about the interfaces lists the
Description objects of the automation interface of OPC, their properties, methods
and events and points out particular characteristics of the OPC server
for SIMATIC NET.
Note:
Example:
Dim ReqDataTypes(MAX_INDEX) As Integer
ReqDataTypes(1) = vbVLong
ReqDataTypes(2) = vbVString
Description Objects of the OPC server class are created by the client. The
properties of an OPC server contain general information about the
server. When an OPC server object is created, an OPCGroup
collection is also created as a property of the OPC server object.
StartTime Date Time at which the server was started (in UTC).
LocaleID Long Code for specifying the language for OPC server
output texts
Bandwidth Long Bandwidth of the server.
Notes:
• The OPC server for SIMATIC NET provides the following as vendor
information: "SIMATIC NET OPC-Server“
• Public groups are not supported by the OPC server for SIMATIC
NET.
• The Bandwidth property is not supported by the OPC server for
SIMATIC NET.
Description:
Provides the names (ProgIDs) of the registered OPC server on the
local computer (without argument) or on the specified node.
Notes:
• The ProgID for the OPC server for SIMATIC NET is as follows:
OPC.SimaticNET
Description:
Structure of a link to an OPC server.
Notes:
• The ProgID for the OPC server for SIMATIC NET is as follows:
OPC.SimaticNET
Disconnect ()
Description:
Structure of the link to an OPC server.
Notes:
The OPC server for SIMATIC NET closes all communications
connections after the Disconnect of the last OPC client.
CreateBrowser () As OPCBrowser
Description:
Creates an object of the OPCBrowser class to investigate the address
area of the server.
Notes:
Refer to the description of the OPCBrowser object in Section 11.5.
Description:
Supplies the error message for a specific error code.
Notes:
The OPC server for SIMATIC NET supports German and English error
texts. Errors detected by the Windows operating system are explained
in the language in which the operating system was installed.
QueryAvailableLocaleIDs
() As Variant
Description:
Obtains the language codes available from the server as an array with
long values.
Notes:
The OPC server for SIMATIC NET supports German and English error
texts. Errors detected by the Windows operating system are explained
in the language in which the operating system was installed.
QueryAvailableProperties
ItemID As String, ByRef Count As Long, ByRef PropertyIDs() as Long,
ByRef Descriptions() As String, ByRef DataTypes() As Integer
Description:
Obtains a list of property codes and the corresponding description texts
for the properties of the specified item.
Notes:
Properties are supported by the OPC server for SIMATIC NET.
Description:
Obtains a list with the values of the requested properties.
Notes:
Properties are supported by the OPC server for SIMATIC NET.
Description:
Obtains a list of the ItemIDs corresponding to the transferred
PropertyIDs. ItemIDs can be inserted for more efficient data acquisition
in OPC groups.
Notes:
The OPC server for SIMATIC NET does not supply PropertyIDs that
could be represented as ItemIDs.
Description:
This event is triggered when the OPC server is closed down. The
linked clients can react to the event, for example, by releasing items
and groups.
Notes:
The OPC server for SIMATIC NET triggers this event when the close
request is set in the configuration program (Section 7.10).
Description The OPCBrowser object is a collection object with which the address
area of the OPC server can be investigated. An object of the
OPCBrowser class must be created by the CreateBrowser method of
the OPCServer object. It is possible to create several OPCBrowser
objects for one server.
Notes: • The structure of the address area of the OPC server for SIMATIC
NET is hierarchical.
Description:
Provides the name of the entry specified by the index "Key“.
ShowBranches ()
Description:
Enters the names of the branches of the current browse position into
the collection.
Description:
Enters the names of the leaves of the current browse position into the
collection. If the parameter "Flat“ is true, the collection with all leaves
of the current and deeper branches are filled starting from the current
browse position. The default for "Flat" is false.
MoveUp ()
Description:
Moves the current position in the address area one level up.
Description:
Moves the current position in the address area into the current branch
(one level deeper).
MoveToRoot ()
Description:
Moves the current position in the address area to the root.
Description:
Moves the current position in the address area to a specified, absolute
position. The absolute position is specified as an array of branch
names starting from the root.
Description:
The server converts the name to an ItemID that can be transferred to
the "Add" method of "OPCItems". The creation of this ID is based on
the current position of the browser, extended by the node with the
name contained in the "Leaf" string.
Description:
This provides the possibility of querying the access path of an ItemID.
Notes:
Not required for the OPC server for SIMATIC NET.
Public groups are not supported by the OPC server for SIMATIC NET.
Description:
Provides a reference to the indexed object of the collection.
Description:
Creates a group in the server object.
Notes:
• If the Name parameter is empty or not specified, the OPC server
generates a name that starts with an underscore (for example
"_123456"). User-defined names should therefore not begin with the
underscore character.
Description:
Provides the reference to an OPC group indicated by the name or the
server handle.
Description:
Deletes a group on the server.
RemoveAll ()
Description:
Deletes all groups and items of the server.
Description:
This event simplifies the processing of events throughout all groups of
the collection by reporting changes in the value and state of all items in
all groups.
Description The “OPC Group” class manages the individual process variables, the
OPC items. Using these group objects, a client can form semantically
meaningful units of OPC items and execute operations with them.
Notes: • The TimeBias property is not evaluated by the OPC server for
SIMATIC NET.
• LocaleID is irrelevant for the OPC server for SIMATIC NET.
• The DeadBand property has no significance for the OPC server for
SIMATIC NET.-
• To allow value changes of the items of a group to be signaled using
the appropriate event, the properties "IsActive" and
"IsSubscribed" must be set to "True".
Description:
Synchronous reading of the values, status information or time stamp of
one or more items in a group. The values can be read from the cache
of the server or directly from the hardware. Reading from the cache is,
however, only possible when the group is activated.
Notes:
The call is monitored by the timeout monitoring on the server. The
duration is specified by a configuration parameter in the protocol-
specific configuration file (Section 8).
Description:
Synchronous writing of values for one or more items of a group to the
hardware.
Notes:
The call is monitored by the timeout monitoring on the server. The
duration is specified by a configuration parameter in the protocol-
specific configuration file (Section 8).
Description:
Sends an asynchronous read command. The result is returned with the
"AsyncReadComplete“ event.
Notes:
Asynchronous read commands always read directly from the device!
The call is monitored by the timeout monitoring on the server. The
duration is specified by a configuration parameter in the protocol-
specific configuration file (Section 8).
Description:
Sends an asynchronous write command. The result is returned with the
"AsyncWriteComplete“ event.
Notes:
The call is monitored by the timeout monitoring on the server. The
duration is specified by a configuration parameter in the protocol-
specific configuration file (Section 8).
Description:
Requests a current value for every active OPC item. The results are
returned by the "DataChange“ event.
Description:
Cancels an outstanding asynchronous job.
Description The OPC automation interface supplies the changes to the values of
active terms and the results of asynchronous operations with events.
The requirement for this is the declaration of OPC groups WithEvents.
Description:
The DataChange event occurs when it is detected that an active item
has a change value or a change quality. Checking value changes is
triggered by the UpdateRate timer. Events are generated only for
active items within an active group of events.
Description:
The AsyncReadComplete event is triggered when a read job is
completed.
Description:
The AsyncWriteComplete event is triggered when a write job is
completed.
Description:
The AsyncCancelComplete event is triggered when a cancel job is
completed.
Description The OPCItems object is a collection object for creating and managing
OPC items. The default properties of OPCItems specify default values
for all OPC items to be created.
Description:
Provides a reference to the item of the collection described by the
ItemSpecifier index.
(The "GetOPCItem“ method, on the other hand, provides a reference
to the server handle.)
Description:
Provides a reference to the server handle created by Add.
Description:
Inserts an item in the OPCItems collection of a group.
Notes:
• AddItem returns errors using the variable "Err" to "On Error".
• The structure of the ItemIDs for the OPC server for SIMATIC NET
is described in Chapter 5.
• It is possible to add the same OPC item to the same group more
than once. In this case each of these items nevertheless has its
own server handle.
The server handles of the items are only unique within a group and
not for all items of all groups.
Description:
Inserts several items in the OPCItems collection of a group.
Notes:
• AddItems returns errors only using the "Errors" array, the error
variable "Err" is not set.
• The structure of the ItemIDs for the OPC server for SIMATIC NET
is described in Chapter 5.
• It is possible to add the same OPC item to the same group more
than once. In this case each of these items nevertheless has its
own server handle.
The server handles of the items are only unique within a group and
not for all items of all groups.
Description:
Deletes one or more items from a group.
Description:
Checks the validity of one or more OPC items; in other words whether
it was added to a group without any error occurring, and supplies
information such as the canonical data type.
Notes:
See AddItems
Description:
Sets the active state of one or more items in a group.
Description:
Changes the client handle of one or more items in a group.
Description:
Sets the required data type of one or more items in a group.
Notes:
The OPC server for SIMATIC NET does not support units (engineering
units)
Read (Source As Integer, Optional ByRef Value As Variant, Optional ByRef Quality
As Variant, Optional ByRef TimeStamp As Variant )
Description:
Reads the value, the quality, and/or the time stamp of this variable.
Description:
Sets the value of this variable synchronously.
This chapter lists the interfaces and methods of the OPC Custom interface for Alarms &
Events. This is not a detailed interface description but contains supplementary
information and notes relating specifically to SIMATIC NET.
Use in C/C++ The use of the OPC Custom interface for Alarms & Events is
analogous to the use of the custom interface for Data Access (see
Section 10.2). The ProgID must, however, be used for the OPC Alarm
& Events server:
OPC.SimaticNetAlarms
Refer, in particular, to the sample program for OPC Alarms & Events
in the product folder "Samples\S7\Custom\AlrmEvnt\SimpleAE".
Structure of the The following supplementary information about the interfaces lists the
Description objects of OPC, their interfaces and the methods defined in these
interfaces and points out particular characteristics of the OPC server
for SIMATIC NET.
Description A client generates an object of the class "OPC Event Server" and
addresses this object to be able to use the Alarm&Event services. It
provides a management interface via which a message object is
created, various queries are executed and events are activated. The
client can also set the language for output texts and logon to receive
server-specific events.
ProgID The Alarm & Event server for SIMATIC NET has the ProgID
SIMATIC NET
OPC.SimaticNETAlarms
Schematic The following schematic illustrates the “OPC server” object with its
interfaces.
IUnknown
IOPCEventServer
IOPCCommon
IConnectionPointContainer OPC event
server object
Overview This is the central interface for use of the Alarm&Event functionality. It
is used to generate subscription objects and the area browser as well
as to investigate event categories and to manage conditions.
Description:
Provides current information about the status of the OPC server. The
status is returned as a structure (refer to the OPC Alarms & Events
specification).
Notes:
• The client must release the memory required for the structure and
the szVendorInfo.
CreateEventSubscription
(BOOL bActive, DWORD dwBufferTime, DWORD dwMaxSize,
OPCHANDLE hClientSubscription, REFIID riid, LPUNKNOWN * ppUnk,
DWORD * pdwRevisedBufferTime, DWORD * pdwRevisedMaxSize´)
Description:
Creates a subscription for informing the client and returns the
requested interface for access to the subscription object.
Description:
Provides information about the filter options supported by the OPC
Event server.
Notes:
• The OPC Event server for SIMATIC NET supports the following
filters.
OPC_FILTER_BY_EVENTS 0x01
OPC_FILTER_BY_CATEGORY 0x02
OPC_FILTER_BY_SEVERITY 0x04
OPC_FILTER_BY_SOURCE 0x16
Description:
Provides the event categories offered by the OPC Event server.
Notes:
• The OPC Event server for SIMATIC NET supplies event categories
only when the value OPC_SIMPLE_EVENT is set for the parameter
"dwEventType".
• The OPC Event server for SIMATIC NET supports the following
event categories.
S7_PROCESS_SCAN 0x01
S7_PROCESS_ALARM 0x02
QueryConditionNames
(DWORD dwEventCategory, DWORD* pdwCount, LPWSTR**
ppszConditionNames)
Description:
Provides the conditions offered by the OPC Event server for a
particular event category.
Notes:
Conditions are not supported by the OPC Event server for SIMATIC
NET.
QuerySubConditionNames
(LPWSTR szConditionName, DWORD* pdwCount, LPWSTR**
ppszSubConditionNames)
Description:
Provides the subconditions offered by the OPC Event server for
specific event categories.
Notes:
Subconditions are not supported by the OPC Event server for
SIMATIC NET.
QuerySourceConditions
(LPWSTR szSource, DWORD* pdwCount, LPWSTR**
ppszConditionNames)
Description:
Provides the conditions offered by the OPC Event server for a specific
event source.
Notes:
Conditions are not supported by the OPC Event server for SIMATIC
NET.
QueryEventAttributes
(DWORD dwEventCategory, DWORD* pdwCount, DWORD**
ppdwAttrIDs, LPWSTR** ppszAttrDescs, VARTYPE** ppvtAttrTypes)
Description:
Provides the attributes offered by the OPC server for a specific event
category. Additional information (for example associated values) are
transferred to the client using attributes.
Notes:
The attributes provided by the OPC Event server for SIMATIC NET
are listed in Section 6.2.2.
Description:
Using this function, the OPCItems corresponding to an event attribute
for use with an associated OPC Data Access server can be obtained.
Notes:
The attributes provided by the OPC Event server for SIMATIC NET
cannot be represented as ItemIDs for use with the OPC Data Access
server for SIMATIC NET.
TranslateToItemIDs is not supported by the OPC Event server for
SIMATIC NET.
Description:
Provides information about the state of a condition of an event source.
Notes:
Conditions are not supported by the OPC Event server for SIMATIC
NET. E_NOTIMPL is returned.
EnableConditionByArea
(DWORD dwNumAreas, LPWSTR* pszAreas)
Description:
Activates all the conditions for all event sources within the specified
area.
Notes:
Conditions are not supported by the OPC Event server for SIMATIC
NET. E_NOTIMPL is returned.
EnableConditionBySource
(DWORD dwNumSources, LPWSTR* pszSources)
Description:
Activates all conditions for all specified event sources.
Notes:
Conditions are not supported by the OPC Event server for SIMATIC
NET. E_NOTIMPL is returned.
DisableConditionByArea
(DWORD dwNumAreas, LPWSTR* pszAreas)
Description:
Deactivates all the conditions for all the events sources within the
specified area.
Notes:
Conditions are not supported by the OPC Event server for SIMATIC
NET. E_NOTIMPL is returned.
DisableConditionBySource
(DWORD dwNumSources, LPWSTR* pszSources)
Description:
Deactivates all conditions for all specified event sources.
Notes:
Conditions are not supported by the OPC Event server for SIMATIC
NET. E_NOTIMPL is returned.
Description:
Transfers an event confirmation to the client. Only conditional events
can be confirmed. An event is identified by the event source, the event
name, the activation time, and an additional information ("Cookie").
Notes:
Conditions are not supported by the OPC Event server for SIMATIC
NET.
Description:
Creates an OPCEventAreaBrowser object for investigating the process
area.
Notes:
Areas and the browsing of areas is not supported by the OPC Event
server for SIMATIC NET. E_NOTIMPL is returned.
IUnknown
IOPCEventSubscriptionMgt
IConnectionPointContainer
OPC event
subscription
object
Overview This is the central interface for managing the information via a specific
"Event Subscription". On this interface, relevant events can be
selected for the client among other things.
Description:
Provides a filter for selecting certain events for this "Event
Subscription".
Notes:
The parameters for filtering have the following significance for the
OPC Event server for SIMATIC NET:
Description:
Returns the currently used filter for selecting certain events for this
"Event Subscription".
Notes:
The parameters for filtering have the same significance for the OPC
Event server for SIMATIC NET as explained in the description of the
"SetFilter" method.
SelectReturnedAttributes
(DWORD dwEventCategory, DWORD dwCount, DWORD*
dwAttributeIDs)
Description:
Specifies the attribute for an event category to be supplied with the
event message.
Notes:
The possible attributes for the OPC Event server for SIMATIC NET are
described in Section 6.2.2.
GetReturnedAttributes
( DWORD dwEventCategory, DWORD * pdwCount, DWORD*
pdwAttributeIDs)
Description:
Returns the list with the attributes for an event category to be supplied
with an event message.
Notes:
The possible attributes for the OPC Event server for SIMATIC NET are
described in Section 6.2.2.
Description:
Sends all active and all inactive, unconfirmed condition messages
corresponding to the current filter setting to the client.
Notes:
Since the OPC Event server for SIMATIC NET supports only simple
events, no event messages are sent with the refresh.
Description:
Cancels an active refresh.
Notes:
Since the OPC Event server for SIMATIC NET supports only simple
events no event messages are sent during a refresh. A CancelRefresh
therefore has not effect.
Description:
Returns the current status of the event subscription.
Description:
Allows the setting of various properties of an event subscription.
Description When using connection points to transfer events to a client, the client
must provide a COM object with the interfaces IUnknown and the call-
specific interface (for example IOPCEventSink) to receive the calls.
When it logs on at a connection point, the client transfers a pointer to
the IUnknown interface to the server.
IUnknown
IOPCEventSink
IOPCShutdown
Event sink
client object
Overview This is the central interface of the client for receiving messages. It
contains a method called by the server to transfer events.
Description:
Transfers one or more event messages to the client.
Notes:
The "*pEvents" structure contains one or more events. In the structure
elements that follow, the SIMATIC NET OPC Event enters specific
values:
Overview Via the call interface based on this connection point, the server can
inform its clients before it is closed down or before it closes down. In
critical situations, this allows the OPC server to inform its clients so
that, for example, they can close down correctly.
Description:
Via this interface, the server can inform its clients when it is closed.
Notes:
The "Reason" (parameter szReason) can be set using the configuration
program for the OPC server.
Nuremberg
Johnson City
Singapore
Nuremberg
SIMATIC BASIC Hotline SIMATIC Premium Hotline
(charged, only with SIMATIC card)
Local time: Mo to Fr 8:00 to 18:00 (CET) Local time: Mo to Fr 0:00 to 24:00 (CET)
Phone: +49 (911) -895-7000 Phone: +49 (911) -895-7777
Fax: +49 (911) -895-7002 Fax: +49 (911) -895-7001
E-mail: simatic.support@nbgm.siemens.de
In its online services, SIMATIC Customer Support provides you with wide-ranging
additional information about SIMATIC products:
via the Bulletin Board System (BBS) of the SIMATIC Customer Support
mailbox in Nuremberg (Tel.: +49 (911) - 895-7100).
To dial the mailbox, use a modem with up to 28.8 Kbps, V.34 (parameters:
8, N, 1, ANSI) or ISDN (parameters: x.75, 64 Kbps)
To help you to become familiar with the SIMATIC S7 automation system, we offer
training courses Please contact your regional training center or the central training
center in D-90327 Nuremberg, Tel. 0911-895-3154.
Authorization
Please note that this software product can only be operated when you are in
possession of a valid authorization..
Note
For test or demonstration purposes, you can install the software product in the
demonstration mode without a license to acquaint yourself with the functions.
The S7-300 meets the requirements and criteria of IEC 1131, Part 2. The S7-300
meets the requirements for CE marking. CSA, UL and FM approvals exist for the
S7-300.
Due to the low levels of pollutants, the SIMATIC S7-300 can be recycled.
Siemens Aktiengesellschaft
Anlagenbau und Technische Dienstleistung
ATD ERC Essen Recyling/Remarketing
Fronhauser Str. 69
45 127 Essen
Course Siemens AG
Registration Trainings-Center für Automatisierungstechnik
AUT 959 Kursbüro
Östliche Rheinbrückenstraße 50
76181 Karlsruhe
Germany
14 Glossary
AS-Interface Actuator Sensor Interface - cable for direct connection of simple binary
sensors and actuators (transfer of small amounts of information)
DP Protocol Protocol for data transmission to distributed I/Os via a DP network ->
PROFIBUS
Industrial Ethernet Bus system for use in industry on the basis of Ethernet (previously
SINEC H1)
Network A network consists of one or more connected subnets with any number
of nodes. Several networks can exist parallel to each other.
OPC Client User program that uses an OPC server via the OPC interface to
access process data.
OPC Server An OPC server is a product that provides the OPC client with wide
ranging functions allowing communication via industrial networks.
SIMATIC Name of products and systems for industrial automation from Siemens
SIMATIC Computing
6GK1971–0BA00–0AA1 i
A.4.29 ForeColor Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-62
A.4.30 LargeChange Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-63
A.4.31 LayoutType Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-63
A.4.32 LimitCheck Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-64
A.4.33 Locked Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-65
A.4.34 LowerLimit Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-65
A.4.35 Max Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-66
A.4.36 Min Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-67
A.4.37 MultipleEngines Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-67
A.4.38 Offset Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-68
A.4.39 PCName Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-68
A.4.40 Precision Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-69
A.4.41 PropertyChangedName Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-69
A.4.42 PropertyChangedObject Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-70
A.4.43 Radix Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-71
A.4.44 RangeRawMax, RangeRawMin, RangeScaledMax, and RangeScaledMin
Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-72
A.4.45 ReadMultiVariables Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-74
A.4.46 ReadVariable Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-74
A.4.47 ScaleMode Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-75
A.4.48 ShowButtons Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-76
A.4.49 ShowErrorBoxes Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-77
A.4.50 SmallChange Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-78
A.4.51 TagServerName Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-79
A.4.52 TagSource Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-79
A.4.53 Ticks Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-80
A.4.54 TrueCaption Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-80
A.4.55 TrueColor Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-81
A.4.56 UpperLimit Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-81
A.4.57 Value Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-83
A.4.58 Write Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-84
A.4.59 WriteMode Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-84
A.4.60 WriteMultiVariables Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-85
A.4.61 WriteVariable Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-85
A.4.62 ZeroPad Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-86
A.5 Other SIMATIC Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-87
A.5.1 SIMATIC Button Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-87
A.5.2 Properties, Methods, and Events of the Button Control . . . . . . . . . . . . . . . A-91
A.5.3 SIMATIC Number Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-92
A.5.4 Properties, Methods, and Events of the Number Control . . . . . . . . . . . . . . A-99
A.5.5 SIMATIC Slider Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-103
A.5.6 Properties, Methods, and Events of the Slider Control . . . . . . . . . . . . . . . . A-106
A.6 Guidelines for Custom Controls and Third-Party Containers . . . . . . . . . . . A-107
A.6.1 Guidelines for Using Third-Party Containers with the Data Control . . . . . A-107
A.6.2 Guidelines for Creating a Custom ActiveX Control . . . . . . . . . . . . . . . . . . . A-108
A.6.3 Using a Custom Control with the Data Control . . . . . . . . . . . . . . . . . . . . . . . A-109
SIMATIC Computing
ii 6GK1971–0BA00–0AA1
SIMATIC Computing A
A.1 Getting Started with Computing
Chapter Overview
The Computing software provides you with a simple way to access and to use data
from a communication system such as a PROFIBUS–DP, a FMS Network or a S7
programmable controller.
This chapter provides some easy programming examples to help you become
familiar with the power and flexibility that can be achieved by using the ActiveX
controls provided by SIMATIC Computing.
Warning
! After you assign a variable to the Value property of a SIMATIC ActiveX control, the
control is able to access process data. When you change the value that is
displayed in the control, you are changing the value in the actual process. Do not
connect these examples to a control engine that is connected to equipment.
Altering process data can cause unpredictable process operation, and
unpredictable process operation could result in death or serious injury to
personnel, and/or damage to equipment.
Exercise caution to ensure that you do not access any data that could cause
process equipment to operate erratically. Always install a physical emergency stop
circuit for your machineor process.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-1
SIMATIC Computing
SIMATIC Computing
A-2 6GK1971–0BA00–0AA1
SIMATIC Computing
A.1.1 Overview
The examples in this chapter show some of the ways you can use the ActiveX
controls provided by Computing. As shown in Figure A-1, this chapter provides
samples of subroutines for the following applications:
S Create a user interface: You can use the SIMATIC controls with a third–party
container (such as Microsoft’s Visual Basic) to create an I/O interface Panel.
See Section A.1.2. (You can use this panel to test the other sample programs in
this chapter.)
S Use a standard ActiveX control: You can use a standard control (such as a
Label control from Visual Basic) to access data in the control engine. See
Section A.1.3.
S Load data from the control engine into standard software packages: You can
load data into a Microsoft Office application (such as Microsoft’s Excel). See
Section A.1.4.
I/O Panel
Label control
Excel
Third-party application
SIMATIC Computing
6GK1971–0BA00–0AA1 A-3
SIMATIC Computing
The Data control allows any OLE Container (such as Visual Basic 5.0) to access
process data. You can use the SIMATIC controls provided by Computing with
Visual Basic to create a simple I/O Panel that interacts with a control engine.
To create this sample application, you need the following items:
S Microsoft Visual Basic 5 or higher
S SIMATIC controls from Computing
Inserting the SIMATIC Controls into the Toolbox for Visual Basic
Use the following procedure to create the sample I/O panel:
1. Open a standard Visual Basic project:
– Select the File –>New Project menu command to display the “New Project”
dialog box.
– Select the “Standard EXE” icon and click on the “Open” button.
2. Select the Project –> Components menu command to display the
“Components” dialolg box.
3. As shown in Figure A-2, select the following SIMATIC controls in the
“Components” dialog box:
– Data control (Siemens SIMATIC Data Control)
– Button control (Siemens S7vbButton Control)
– Number control (Siemens S7Number Control)
4. Click on the “Apply” button. The SIMATIC controls that you selected appear in
the toolbox for Visual Basic. Click on the “OK” button to close the “Components”
dialog box.
Note
Even though the Computing controls sometimes use “S7” in their names, they can
be used with other systems (S5, DP–Network, FMS–Devices) too.
SIMATIC Computing
A-4 6GK1971–0BA00–0AA1
SIMATIC Computing
Components
OK Cancel Apply
I/O Panel
0 0 0
Number controls
Button controls
OFF OFF OFF
Data control
SIMATIC Computing
6GK1971–0BA00–0AA1 A-5
SIMATIC Computing
5. Refer to Table A-1 and assign the variables to the SIMATIC controls.
6. Click on the “Apply” button to enter the assigned variables.
SIMATIC Computing
A-6 6GK1971–0BA00–0AA1
SIMATIC Computing
Table A-1 Assigning Sample names to the SIMATIC Controls (for S7–protocol)
The variable names correspond to the itemIDs valid for the OPC
General Engine Connections Events Name Select the option for a direct
connection
Connect via Tag Source
Tag Source
Browse...
Direct Connect
Enter @SimaticNet as the type of
control engine
PC Name
SIMATIC Computing
6GK1971–0BA00–0AA1 A-7
SIMATIC Computing
SIMATIC Computing
A-8 6GK1971–0BA00–0AA1
SIMATIC Computing
You can use the Data control to connect any ActiveX control (such as VB Label
control) to data in the control engine. To create this sample application, you need
the following items:
S Microsoft Visual Basic 5 or higher
S SIMATIC Data control from Computing
Components
OK Cancel Apply
Figure A-6 Adding the Data Control to the Visual Basic Toolbox
3. Insert a Data control onto the VB form. (For information about inserting controls
onto the VB form, see Section A.1.1.)
4. Insert a VB label on your form. Change the Border Style property to “1–Fixed
Single.”
5. Select the Data control and click the right mouse button to bring up the pop-up
menu. From the pop-up menu, select Properties to display the “Properties”
dialog box for the Data control.
6. From the “Properties” dialog box, select the “Connections” tab. Click on the “+”
symbol to expand the list of controls.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-9
SIMATIC Computing
7. Select the Label1 control and click on its “+” symbol to expand its properties list.
8. Select the Caption property and enter S7:[ DEMO]MB0 in the “Assigned
Variable” field. A-7). Click on the “Apply” and “OK” buttons to enter the data and
close the “Properties” dialog box.
SIMATIC Computing
A-10 6GK1971–0BA00–0AA1
SIMATIC Computing
General Engine Connections Events Name Select the option for a direct
connection
Connect via Tag Source
Tag Source
Browse
Direct Connect
Enter @SimaticNet as the type of
control engine
PC Name
SIMATIC Computing
6GK1971–0BA00–0AA1 A-11
SIMATIC Computing
Using the Data control in an Excel spreadsheet allows you to access the values in
the control engine. To create this sample application, you need the following items:
S Microsoft Excel 97
SIMATIC Computing
A-12 6GK1971–0BA00–0AA1
SIMATIC Computing
SIMATIC Computing
6GK1971–0BA00–0AA1 A-13
SIMATIC Computing
MB0
Add...
OK Cancel
3. In the ”Properties” dialog box, enter the variable name “S7:[DEMO]MB0” in the
“Assigned Variable” field. See Figure A-10.
4. Click on the “Apply” button to accept the assigned variable. Notice that the
event key “MB0” appears in boldface under S7Data1.
5. Enter new event keys for MB1 (Variable S7:[DEMO] MB1) and MB2 (Variable
S7:[DEMO]MB2) by selecting S7Data1 again and repeating steps 2. and 3.
S7Data1 Browse...
MB0
Update rate (ms): 100
Dead band: 0
SIMATIC Computing
A-14 6GK1971–0BA00–0AA1
SIMATIC Computing
SIMATIC Computing
6GK1971–0BA00–0AA1 A-15
SIMATIC Computing
Note
To exit Excel or to activate the Excel menus, you must first close UserForm1.
Computing provides access through the SIMATIC Data control to the process data
being controlled by a control engine such as a Simatic Net
Communicationsystem.You can use the standard SIMATIC controls provided with
the Computing software (see Table A-2), or you can connect any other ActiveX
control to the SIMATIC Data control.
SIMATIC Computing
A-16 6GK1971–0BA00–0AA1
SIMATIC Computing
A.3 Accessing the Process Data with the SIMATIC Data Control
Chapter Overview
The SIMATIC Data control provides the connection between your ActiveX controls
and the control engine (for example, the protocol connection with S7).
The Data control has specific properties that you can configure:
S For container applications (such as MicroSoft Visual Basic): access the
properties as for any other control in that container (for example, by using the
right mouse button). Open the context menu for the Data control by clicking the
right mouse button and selecting the Properties menu command.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-17
SIMATIC Computing
Caution
! Failing to disable the timers in your program could cause timer-generated
connections to remain connected, allowing these connections to continue to write
data to the control engine. This could cause the control engine to operate
erratically, which could potentially cause damage to equipment and injury to
personnel.
To ensure that all connections are disconnected when your program closes,
always disable all timers before the End statement in the Form_Unload subroutine.
In order to access process data, the SIMATIC controls (Button, Number or Slider)
must first establish a connection through the Data control. Figure A-11 shows the
relationship between the Data control and the other SIMATIC controls.
You use the Connections tab of the Data control to assign a variable (the memory
location) to the Value property of each SIMATIC control. The Data control
configures the control engine to check the assigned variables at a specified rate (in
milliseconds). If there is a change in the value, the new value is written to the Data
control. The Data control then writes the new value to the other controls.
Distributed I/O
Figure A-11 Using the SIMATIC Data Control for Connecting to a Control Engine
SIMATIC Computing
A-18 6GK1971–0BA00–0AA1
SIMATIC Computing
As shown in Figure A-12 the General tab allows you to configure the following
parameters for the connection to the control engine:
S Autoconnect (automatic connection): when this option is enabled, the Data
control automatically connects to the process variables in the control engine.
When this option is disabled, the Data control connects to the variables only
when instructed by the program code (using a Connect method) that you
associated with the control.
S Autoconnect Timeout: time-out (in milliseconds) for the automatic connection:
specifies the amount of time that the Data control waits between connecting to
the control engine and writing data.
Some containers may not provide a mechanism for telling the Data control to
write to the control engine. After the time-out that you specify, the Data control
starts writing data.
S Default Update Rate (ms): specifies the rate that the control engine checks the
process variables to see if change has occurred.
S Default Dead Band: specifies to the control engine the amount of change that
must occur in a value before the control engine writes the new value to the Data
control. For example: if the dead band is 10 and the value in the control engine
is 22, then the control engine does not write a new value until the value
becomes either 33 or 11.
S Show Error Boxes: specifies whether to display the default error boxes when
there is a user-generated error. Computing provides error messages in English
only. If you want to display messages in other languages, you must deselect
this option and write program code to react on the error event.
AutoConnect:
SIMATIC Computing
6GK1971–0BA00–0AA1 A-19
SIMATIC Computing
Tag Source
Browse
Direct Connection
PC Name
SIMATIC Computing
A-20 6GK1971–0BA00–0AA1
SIMATIC Computing
As shown in Figure A-14, clicking on the “Browse” button allows you to search for
a valid tag source (*.tsd). The tag source provides the symbolic identification that
allows you to access different control engines from one Data control.
Tag Source
Browse
Direct Connection
PC Name
After you select the type of connection (single control engine or multiple control
engines), click on the Apply button to enter your selections for the Data control
properties.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-21
SIMATIC Computing
As shown in Figure A-15, you can use the SIMATIC Data control to connect your
program to a control engine residing on a different computer.
Note
When you configure the SIMATIC Data control to connect to a single (specific)
control engine, you cannot connect a tag file. This means that you cannot use
symbol names for the variables in the control engine.
To use symbol names, select the option for connecting to multiple control engines
and browse to a tag file that contains symbols for only one control engine.
Third-party control
DCOM
SIMATIC Data control
PC 1 PC 2
WinLC
Use the following procedure to configure the SIMATIC Data control for
communicating over DCOM with a control engine on a remote computer:
1. Open a container application (such as Visual Basic).
2. Insert a SIMATIC Data Control in a form.
SIMATIC Computing
A-22 6GK1971–0BA00–0AA1
SIMATIC Computing
3. Double–click on the Data control to display the ”Properties” dialog box for the
Data control.
4. Click on the “Engine” tab to display the configuration choices. See Figure A-16.
5. Select the “Direct Connection” option.
6. In the “PC Name” field, enter the network name of server computer (for
example, “PC_2”).
7. In the “Control Engine” field, enter the name of the control engine: @SimaticNet
(using Simatic Net).
8. Click on the “OK” button to configure the Data control for communicating with
the remote control engine.
All of the controls that you insert and connect through this Data control will access
the variables in the remote control engine.
Note
You must have configured the different computers for DCOM.
For additional information about DCOM, refer to the online help for Windows NT.
Browse
Direct Connection
PC Name PC_2
SIMATIC Computing
6GK1971–0BA00–0AA1 A-23
SIMATIC Computing
As shown in Figure A-17, the Connections tab shows the ActiveX controls
(whether they are SIMATIC controls or third-party) that can be connected to the
control engine.
Adding a Connection
If you want to configure a connection for an ActiveX control before you place the
control into your ActiveX container, you can use the Add button to add an instance
of the control to the Controls list. As shown in Figure A-18, click on the Add button
to specify the instance that you want to connect to the Data control.
After you have added the ActiveX control instance to the Controls list, you can
select the instance from the list, choose the Add button again and add any
additional properties. For instance, you could add a SIMATIC Number control
instance to the connections list, and then add the Value property to the Number
control in order to assign a variable to the Number control.
SIMATIC Computing
A-24 6GK1971–0BA00–0AA1
SIMATIC Computing
Note
If you have attached a tag file to the Data control or use the process variable from
Simatic Net, you can enter the symbols instead of the absolute addresses. You
can also click on the Browse button to navigate to the symbol.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-25
SIMATIC Computing
Deleting a Connection
If you remove a control from the ActiveX container, the connection remains
configured in the Data control. This means that the next time you place a control of
the same name into the container, the connection that you configured for the
previous control of that name is automatically applied to the new control. For
instance, if you remove a control called Number1, and later insert a new Number
control, the default name for the new control is Number1, and the new control
inherits the existing Number1 connection. Use the Delete button if you want to
prevent new controls from inheriting a previously configured connection: from the
Controls list, select the instance whose connection you want to delete, and click on
the Delete button.
Note
If you remove a control, or change your mind about adding a control after you
have already configured a connection for it using the Add button, you can only
delete the connection to it if there is no control in the ActiveX container that uses
the name specified in the connection. Delete the connection before you add any
other control that uses the name that is specified in the connection. You cannot
use the Delete button to remove a connection to a control that is present in the
ActiveX container.
SIMATIC Computing
A-26 6GK1971–0BA00–0AA1
SIMATIC Computing
The Data control provides a filter that allows you to display a subset of the
properties for the controls. For example, you may want to display only the
“Enabled” and “Value” properties and avoid scrolling through all of the other
properties for each control.
Use the following procedure for filtering the properties:
1. Access the Properties dialog box for the Data control.
2. As shown in Figure A-20, click on the Filter button.
3. As shown in Figure A-21, enter the properties to display and click on the Add
button. Use the Edit button to correct entries and the Delete button to remove
entries.
4. As shown in Figure A-22, select the “Apply filter to properties” check box to
display only the properties listed in the filter.
Use the “Apply filter to properties” check box to toggle the filter on and off.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-27
SIMATIC Computing
OK Cancel mode:
Add... properties
SIMATIC Computing
A-28 6GK1971–0BA00–0AA1
SIMATIC Computing
As shown in Figure A-23, the Events tab allows you to add custom events that are
triggered by the Data control. You enter a key (string) and assign that key to a
process variable. If that variable changes, then the Data control generates an
event with a parameter that contains the string that you entered in the “Key” field.
Your program can then react to this event.
See Section ”Sample Program for Responding to Events” for a sample program
that responds to events.
S7Data1 Browse...
OverflowWarning
Update rate (ms): 100
Dead band: 0
Add... Delete
Adding an Event
The Add button allows you to add user-specified events for controller value
changes. You can write your own code to handle the event by handling the
ValueChanged event of a Data control. Select a Data control from the expandable
list under the “Keys” field and click on the Add button; then type any name you
choose for the event (for example, OverflowWarning). Next, type a variable in the
“Assigned Variable” field to identify the process value that causes the event to be
fired.
Figure A-23 shows an sample event that has been added. A change in the value of
the variable DP:[Demo]DemoPower calls the event handler for the Data control.
The input to the event handler is the text string “OverflowWarning”.
Deleting an Event
To delete a user-specified event, expand the list under “Keys,” select the desired
event, and click on the Delete button.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-29
SIMATIC Computing
The Data control uses a connection table for determining which property of the
various controls are connected to specific process variables of the control engine.
Each connection table contains an entry for each connection. Each entry contains
the following information:
S Property name: this field identifies the property that has an assigned variable.
S Data source: this field identifies the name of the process variable.
S Update rate: this field defines the update rate for the connection. If no value is
entered in this field, the Data control uses the default update rate (which is the
value stored in the DefaultUpdateRate property).
S Default Dead Band: this field defines the dead band for automatically writing to
the control engine or the control. If no value is entered in this field, the Data
control uses the default update rate (which is the value stored in the
DefaultDeadBand property).
When you use the “Properties” dialog box to configure the Data control, the Data
control automatically creates a connection table. You can also create a program to
manually create connection tables. See Section A.3.9 for a sample program for
manually creating a connection table.
SIMATIC Computing
A-30 6GK1971–0BA00–0AA1
SIMATIC Computing
You can write a program to create a table to define the connections (assigned
variables) or events for the control engine.
Note
Instead of creating a connection table, consider using the read and write methods
for the Data control (ReadVariable, ReadMultipleVariables, WriteVariable, and
WriteMultipleVariables). These methods allow you to access more data with just
one line of code.
Table A-3 shows, how to assign the property caption of a label control with the
name lblChange to the process variable S7:[DEMO]MW2 using program code.The
value stored in MW2 displays as the caption in the label control.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-31
SIMATIC Computing
SIMATIC Computing
A-32 6GK1971–0BA00–0AA1
SIMATIC Computing
You can create a program that responds to events in the control engine. In this
sample program, eight lights correspond to the eight events which are defined in a
connection table. See Figure A-24. The events are connected to the status of
memory location MB0: a change in the value stored in MB0 generates a set of
events (named for each bit in the byte).
As shown in Figure A-24, the program also contains the following elements:
S Data control (S7Data4) for connecting to the control engine
S Timer (Timer1) that increments the value stored in MB0 (which then causes the
control engine to generate the events)
S Command button (cmdStartEvent) for starting or stopping the timer (thereby
starting or stopping the generation of events)
Timer1: generates a
ReadVariable and WriteVariable
at fixed intervals
Figure A-24 Sample Program for Responding to Events in the Control Engine
Caution
! Failing to disable the timers in your program could cause timer-generated
connections to remain connected, allowing these connections to continue to write
data to the control engine. This could cause the control engine to operate
erratically, which could potentially cause damage to equipment and injury to
personnel.
To ensure that all connections are disconnected when your program closes,
always disable all timers before the End statement in the Form_Unload subroutine.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-33
SIMATIC Computing
Table A-5 Sample Program for Creating a Connection Table for Responding to Events
SIMATIC Computing
A-34 6GK1971–0BA00–0AA1
SIMATIC Computing
Table A-6 Sample Programm for Responding to Events in the Control Engine
SIMATIC Computing
6GK1971–0BA00–0AA1 A-35
SIMATIC Computing
Table A-6 Sample Programm for Responding to Events in the Control Engine, continued
Running the Sample Program (Generating the Events in the Control Engine)
The code listed in Table A-7 changes the value stored in MB0. These changes
then causes the control engine to generate the events defined in the connection
table (Table A-5).
S The command button (cmdStartEvents) starts or stops the timer (Timer1).
S The timer (Timer1) reads the value stored in MB0 of the control engine,
increments the value, and writes the new value back to the control engine.
The changed value of MB0 causes the control engine to generate the events.
Warning
! Failing to disable the timers in your program could cause timer-generated
connections to remain connected, allowing these connections to continue to write
data to the control engine. This could cause the control engine to operate
erratically, which could potentially cause damage to equipment and injury to
personnel.
To ensure that all connections are disconnected when your program closes,
always disable all timers before the End statement in the Form_Unload subroutine.
SIMATIC Computing
A-36 6GK1971–0BA00–0AA1
SIMATIC Computing
You can write a program that initiates access to data (reading or writing) in the
control engine.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-37
SIMATIC Computing
Table A-8 Reading a Single Variable from the Control Engine, continued
SIMATIC Computing
A-38 6GK1971–0BA00–0AA1
SIMATIC Computing
’Display the values and return codes for the array in a List Box
ListBox1.Clear
ListBox1.AddItem ”Return Code = ” & Hex(rc)
ListBox1.AddItem ” – name_s & “ = ” & value_v(0) & “ “ & value_v(1) & “ “ –
value_v(2)
ListBox1.AddItem ” – State = ” & Hex(state_1)
End Sub
SIMATIC Computing
6GK1971–0BA00–0AA1 A-39
SIMATIC Computing
’Display the values and return codes for the array in a List Box
ListBox1.Clear
ListBox1.AddItem ”Return Code = ” & Hex(rc)
ListBox1.AddItem ” – Wrote MD0:REAL[0] = ” & value_r(0)
ListBox1.AddItem ” – Wrote MD0:REAL[1] = ” & value_r(1)
ListBox1.AddItem ” – Wrote MD0:REAL[2] = ” & value_r(2)
End Sub
SIMATIC Computing
A-40 6GK1971–0BA00–0AA1
SIMATIC Computing
For reading and writing Boolean data, you must use the ReadMultiVariables
method or WriteMultiVariables method. Table A-12 provides a sample program for
reading and writing arrays of Boolean data.
mybools(0) = “S7:[Demo]M0.0”
mybools(1) = “S7:[Demo]M0.1”
mybools(2) = “S7:[Demo]M0.2”
mybools(3) = “S7:[Demo]M0.3”
mybools(4) = “S7:[Demo]M0.4”
mybools(5) = “S7:[Demo]M0.5”
mybools(6) = “S7:[Demo]M0.6”
mybools(7) = “S7:[Demo]M0.7”
myvals(0) = False
myvals(1) = False
myvals(2) = False
myvals(3) = False
myvals(4) = False
myvals(5) = False
myvals(6) = False
myvals(7) = False
SIMATIC Computing
6GK1971–0BA00–0AA1 A-41
SIMATIC Computing
You use the properties and methods listed in Table A-13 to manipulate the Data
control.
SIMATIC Computing
A-42 6GK1971–0BA00–0AA1
SIMATIC Computing
Event Description
ConnectionError Occurs when an error on a connection occurs
ValueChanged Occurs when the value of a connected variable changes and no
connected event was specified on the call to the Connect method
When an error occurs in the Data control, the control generates a ConnectionError
event. Your program can capture this ConnectionError event and respond to
specific situations. The ConnectionError event can detect standard OLE errors,
such as E_FAIL or E_OUTOFMEM. Table A-15 lists some of the error codes.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-43
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A Boolean expression that specifies whether object can
respond to user-generated events.
Setting Description
True (default) All connections are activated.
False All connections are deactivated.
Note
The connections remain established, even if they are deactivated.
SIMATIC Computing
A-44 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the alignment.
Setting Description
0 or Left (default) The number is aligned to the left side of the field.
1 or Right The number is aligned to the right side of the field.
2 or Center The number is centered in the field.
Note
This property only has an effect if the BorderStyle property is set to
“Fixed Single” (1).
Syntax:
object.Appearance [= value]
The Appearance property has these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the appearance of
object.
Setting Description
0 or Flat Paints the controls and forms without visual effects.
1 or ThreeD (default) Paints the controls with three-dimensional (3-D)
effects.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-45
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A Boolean expression that specifies whether object can
respond to user-generated events.
Setting Description
True (default) All configured connections will be established at
runtime.
False The connections will be established with a call to the
Connect method.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value of the type Long, which states the timeout in
milliseconds.
SIMATIC Computing
A-46 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the background color
of an object.
Setting Description
Standard Colors Colors specified by using the RGB Color palette
Windows System Colors specified by system color constants (depending on
Colors the container); for example, colors listed in the Visual
Basic (VB) object library in the Object Browser
Note
This property determines whether the Appearance property has any effect.
Syntax:
object.BorderStyle [= value]
The BorderStyle property has these parts:
SIMATIC Computing
6GK1971–0BA00–0AA1 A-47
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the border style.
Setting Description
0 or None (default) No border or border-related elements
1 or FixedSingle A fixed, single-line border
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A String value that specifies the text of the label.
SIMATIC Computing
A-48 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the alignment of the
label.
Setting Description
0 or Left (Default for the first label) The label is aligned to the left
side of the field.
1 or Right (Default for the second label) The label is aligned to the
right side of the field.
2 or Center The label is centered in the field.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the background color
of object.
Setting Description
Standard Colors Colors specified by using the RGB Color palette
Windows System Colors specified by system color constants (depending on
Colors the container); for example, colors listed in the Visual
Basic (VB) object library in the Object Browser
SIMATIC Computing
6GK1971–0BA00–0AA1 A-49
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the background or
foreground colors of object.
Setting Description
Standard Colors Colors specified by using the RGB Color palette
Windows System Colors specified by system color constants (depending on
Colors the container); for example, colors listed in the Visual
Basic (VB) object library in the Object Browser
SIMATIC Computing
A-50 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that allows the user is to determine a
specific size for a label. The default value (-1) specifies
that the size be determined by the length of the text for the
label.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
result A long value that indicates whether an error has occurred.
The result is zero if no error occurs.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-51
SIMATIC Computing
Note
A programmer who uses Visual Basic (or a similar programming language) would
use the ConnectName method, while a programmer who uses Visual C (or a
similar programming language) would use the ConnectObject method.
Syntax:
result = object.ConnectName ConnectedObject, ConnectionTable
The ConnectName method has these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
result A long value that indicates whether an error has occurred.
The result is zero if no error occurs.
ConnectedObject A String expression that evaluates to the name of an
object that should be connected. If this parameter is set to
an empty String, the control generates the ValueChanged
event if a connected variable changes.
ConnectionTable (optional) Specifies a connection table. If this parameter is
omitted, the control reads the ConnectionTable property of
the ConnectedObject.
The connection table is declared as an array. Each
element in the array has the following parts:
S Name of the element (such as “Value”)
S Memory location (such as MW100)
S Update rate or time-out value (in ms)
S Deadband value
For more information about the connection table, see
Section A.3.8.
Note
If the ConnectedObject and ConnectionTable parameters are both omitted, an
error is reported.
SIMATIC Computing
A-52 6GK1971–0BA00–0AA1
SIMATIC Computing
Note
A programmer who uses Visual Basic (or a similar programming language) would
use the ConnectName method, while a programmer who uses Visual C (or a
similar programming language) would use the ConnectObject method.
Syntax:
result = object.ConnectObject ConnectedObject, ConnectionTable
The ConnectObject method has these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
result A long value that indicates whether an error has occurred.
The result is zero if no error occurs.
ConnectedObject A String expression that evaluates to the name of an
object that should be connected. If this parameter is set to
an empty String, the control generates the ValueChanged
event if a connected variable changes.
ConnectionTable (optional) Specifies a connection table. If this parameter is
omitted, the control reads the ConnectionTable property of
the ConnectedObject.
The connection table is declared as an array. Each
element in the array has the following parts:
S Name of the element (such as “Value”)
S Memory location (such as MW100)
S Update rate or time-out value
S Deadband value
Note
If the ConnectedObject and ConnectionTable parameters are both omitted, an
error is reported.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-53
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A String that specifies the pathname or identification of the
control engine to be accessed by object.
SIMATIC Computing
A-54 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A Variant that specifies the value of the control.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-55
SIMATIC Computing
Note
This property determines whether the Precision property has any effect.
Syntax:
object.DataType [= value]
The DataType property has these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the data type.
Table A-16 lists the data types and settings for value.
Note
If the data size configured to be accessed in the control engine is larger than the
data being displayed in the SIMATIC control and the value of the data from the
control engine is larger than can be displayed by the data type, the value is
displayed with ‘‘...’’ preceding it. For example, you can assign a double-word
variable, such as MD100, in the SIMATIC Data Control and select the data type
“Byte” in the SIMATIC Number Control. If the value in the control engine exceeds
255 (the maximum value for a byte), “...” precedes the value. Before the value can
be changed from the SIMATIC Number Control, the ‘‘...’’ preceding the value must
be deleted.
SIMATIC Computing
A-56 6GK1971–0BA00–0AA1
SIMATIC Computing
Note
If you specify a dead band (such as “10”) for a bit variable (such as M15.5), the
control engine will not transmit a changed value for that bit.
Syntax:
object.DefaultDeadBand [= value]
The DefaultDeadband property has these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value of the type Single, which must not be negative.
Note
For WinLC, the minimum default update rate is 0. For CPU 416-2 DP ISA, the
minimum default update rate is 100 ms.
Syntax:
object.DefaultUpdateRate [= value]
The DefaultUpdateRate property has these parts:
SIMATIC Computing
6GK1971–0BA00–0AA1 A-57
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value of type Long.
Part Description
0 All changes of the connected variable are reported
immediately.
>0 Changes of the connected variable are reported after this
timeout.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the orientation.
Setting Description
0 Horizontal
1 Vertical
SIMATIC Computing
A-58 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
result A long value that indicates whether an error has occurred.
The result is zero if no error occurs.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A Boolean expression that specifies whether object can
respond to user-generated events.
Setting Description
True (default) Allows the object to respond to events
False Prevents object from responding to events
SIMATIC Computing
6GK1971–0BA00–0AA1 A-59
SIMATIC Computing
Note
The ScaleMode property must be set to “ByFormula” (1) for the Factor and Offset
properties to have any effect.
You can use a formula to scale the value. In the following formula, “PLC Value” is
similar to the contents of the Value property if the control is connected to the
control engine; “Scale” is the value of the Factor property; “Offset” is the value of
the Offset property; and “Displayed value” is also the contents of the Text property.
PLC Value * Factor + Offset = Displayed value
Syntax:
object.Factor [= value]
The Factor property has these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A floating-point value that defines the factor for the scaling
formula.
Note
The default value of the factor is 1.0, and the default value of the offset is 0.0.
SIMATIC Computing
A-60 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A String value that specifies the text of the label.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the background or
foreground colors of an object.
Setting Description
Standard Colors Colors specified by using the RGB Color palette
Windows System Colors specified by system color constants (depending on
Colors the container); for example, colors listed in the Visual
Basic (VB) object library in the Object Browser
SIMATIC Computing
6GK1971–0BA00–0AA1 A-61
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the foreground colors
of object.
Setting Description
Standard Colors Colors specified by using the RGB Color palette
Windows System Colors specified by system color constants (depending on
Colors the container); for example, colors listed in the Visual
Basic (VB) object library in the Object Browser
SIMATIC Computing
A-62 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the amount of change.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the layout type.
Setting Description
Horizontal (0) (default) Arranges the labels to the left and right of the
display area of the control
Vertical (1) Arranges the labels above and below the display area of
the control
SIMATIC Computing
6GK1971–0BA00–0AA1 A-63
SIMATIC Computing
Note
This Limit Check property must be enabled for the UpperLimit and LowerLimit
properties to have any effect.
Syntax:
object.LimitCheck [= value]
The LimitCheck property has these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the kind of limit check.
Setting Description
CheckNone (0) (default) Does not check the entry against limits
Lower (1) Checks the value against the lower limit only
Upper (2) Checks the value against the upper limit only
Both (3) Checks the value against both the upper and lower limits
SIMATIC Computing
A-64 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A Boolean expression that specifies whether object can be
edited.
Setting Description
True You can scroll and highlight the text in the control, but you
cannot edit it. The program can still modify the text by
changing the Value property. Changes to the Value
property are reflected: the control displays the values in
the control engine, but you are unable to change them.
False (default) You can edit the text in the control.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-65
SIMATIC Computing
Note
The LimitCheck property must be set to “Lower” (1) or “Both” (3) before the
LowerLimit property can have an effect.
The LimitCheck property must be set to “Upper” (2) or “Both” (3) before the
UpperLimit property can have an effect.
Syntax:
object.LowerLimit [= value]
The LowerLimit property has these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A floating-point value that defines the lower or upper limit
used at limit checking.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the maximum number
displayed.
SIMATIC Computing
A-66 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the minimum number
displayed.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A Boolean expression that specifies whether object
connects to one or to several control engines.
Setting Description
True object connects to more than one control engine
simultaneously.
False (default) object connects only to the control engine
specified in the ControlEngine property.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-67
SIMATIC Computing
Note
The ScaleMode property must be set to “ByFormula” (1) for the Factor and Offset
properties to have any effect.
You can use a formula to scale the value. In the following formula, “PLC Value” is
similar to the contents of the Value property if the control is connected to the
control engine; “Scale” is the value of the Factor property; “Offset” is the value of
the Offset property; and “Displayed value” is also the contents of the Text property.
PLC Value * Factor + Offset = Displayed value
Syntax:
object.Offset [= value]
The Offset property has these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A floating-point value that defines the factor or the offset
for the scaling formula.
Note
The default value of the factor is 1.0, and the default value of the offset is 0.0.
SIMATIC Computing
A-68 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A String that specifies the pathname or identification of the
remote computer (PC) for the connection.
Note
The DataType property must be set to “Real” (6) before this property can have an
effect.
Syntax:
object.Precision [= value]
The Precision property has these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value An integer value that defines the precision of the number.
The default precision is 3.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-69
SIMATIC Computing
Note
A programmer who uses Visual Basic (or a similar programming language) would
use the PropertyChangedName method, while a programmer who uses Visual C
(or a similar programming language) would use the PropertyChangedObject
method.
Syntax:
result = object.PropertyChangedName ConnectedObject, Property
The PropertyChangedName method has these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
result A long value that indicates whether an error has occurred.
The result is zero if no error occurs.
ConnectedObject A String expression that evaluates to the name of the
connected control whose property has changed.
Property A String value with the name of the property that has
changed.
SIMATIC Computing
A-70 6GK1971–0BA00–0AA1
SIMATIC Computing
Note
A programmer who uses Visual Basic (or a similar programming language) would
use the PropertyChangedName method, while a programmer who uses Visual C
(or a similar programming language) would use the PropertyChangedObject
method.
Syntax:
result = object.PropertyChangedObject ConnectedObject, Property
The PropertyChangedObject method has these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
result A long value that indicates whether an error has occurred.
The result is zero if no error occurs.
ConnectedObject A String expression that evaluates to the name of the
connected control whose property has changed.
Property A String value with the name of the property that has
changed.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the radix used for
displaying the value.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-71
SIMATIC Computing
Setting Description
Binary (0) Binary mode (valid characters for input: 0 and 1)
Octal (1) Octal mode (valid characters for input: 0 to 7)
Decimal (2) (default) Decimal mode (valid characters for input: 0 to 9,
‘+’, ‘–’, and ‘.’)
Hexadecimal (3) Hexadecimal mode (valid characters for input: 0 to 9, a to
f, and A to F)
Note
The ScaleMode property must be set to “ByRange” (2) before these properties can
have an effect.
When you use a range transformation to scale the value, you specify a source
range (for the values in the control engine) and a destination range (for the values
that are displayed by the control). The values of one range will be transformed to
the other range. See Figure A-25. The source and destination ranges define a ratio
for the transformation; they do not define upper or lower limits. A value can be
larger or smaller than the range; the transformation will use the two ranges to
extrapolate the other value.
SIMATIC Computing
A-72 6GK1971–0BA00–0AA1
SIMATIC Computing
Transformation ratio
RangeRawMax RangeScaledMax
RangeRawMin RangeScaledMin
Syntax:
object.RangeRawMax [= value]
object.RangeRawMin [= value]
object.RangeScaledMax [= value]
object.RangeScaledMin [= value]
The RangeRawMin, RangeRawMax, RangeScaleMin, RangeScaleMax properties
have these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A floating-point value that defines the range boundaries for
the range mode scaling.
Note
The default value of the RangeRawMax is 255.0; the default value of the
RangeRawMin is 0.0; the default value of the RangeScaledMax is 100.0; and the
default value of the RangeScaledMin is 0.0.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-73
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
VarNames A Variant that specifies the array of variables (memory
locations) to be read from the control engine.
VarValues A Variant that contains an array of the corresponding
values of the specified variables in the control engine.
States A Variant that contains an array of the quality code (Long)
for each of the variables.
result A Long value that indicates whether an error has occurred.
The result is zero if no error occurs.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
VariableName A String expression that specifies the variable (memory
location) in the control engine to be read.
Value A Variant value containing the content of the specified
variable in the control engine.
State A Long value that provides the quality code for the
variable.
SIMATIC Computing
A-74 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
TimeOut A Long value that determines the length of time (in ms)
before generating a time-out error. (Not applicable for this
release). For the current release, this value should always
be 0.
result A Long value that indicates whether an error has occurred.
The result is zero if no error occurs.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-75
SIMATIC Computing
Note
The Scale Mode property determines whether the RangeRawMax, RangeRawMin,
RangeScaledMax, RangeScaledMin, Factor, and Offset properties have any
effect.
Syntax:
object.ScaleMode [= value]
The ScaleMode property has these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the kind of scaling.
Setting Description
ScaleNone (0) (default) No scaling
ByFormula (1) Use the formula containing the factor and offset to scale
the value
ByRange (2) Use the range transformation method to scale the value
SIMATIC Computing
A-76 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A Boolean expression that specifies whether or not to
display buttons.
Setting Description
True Two buttons will be shown on the right side of the display
field. When you enter a new value in the display field, the
buttons become active. To confirm the change and write
this value to the Value property (and to the control engine),
click on the Enter button; to cancel the value, click on the
Cancel button.
False (default) The buttons are hidden.
Note
Computing provides error messages in English only. If you want to display
messages in other languages, you must disable (deselect) the ShowErrorBoxes
option and write program code to react on the error event.
Syntax:
object.ShowErrorBoxes [= value]
The ShowErrorBoxes property has these parts:
SIMATIC Computing
6GK1971–0BA00–0AA1 A-77
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A Boolean expression that specifies whether the control
displays error boxes.
Setting Description
True (default) The control shows the default error boxes.
False The error boxes are hidden.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the amount of change
SIMATIC Computing
A-78 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A String value that specifies the name of an available
SIMATIC Data Control.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A String that identifies the pathname to the source (such
as a tag file) of symbolic information to be used when
configuring the control for variables and control engines.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-79
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A constant that determines the number of unit markers to
be displayed.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A String value that specifies the text of the label.
SIMATIC Computing
A-80 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant that determines the background or
foreground colors of object.
Setting Description
Standard Colors Colors specified by using the RGB Color palette
Windows System Colors specified by system color constants (depending on
Colors the container); for example, colors listed in the Visual
Basic (VB) object library in the Object Browser
SIMATIC Computing
6GK1971–0BA00–0AA1 A-81
SIMATIC Computing
Note
The LimitCheck property must be set to “Lower” (1) or “Both” (3) before the
LowerLimit property can have an effect.
The LimitCheck property must be set to “Upper” (2) or “Both” (3) before the
UpperLimit property can have an effect.
Syntax:
object.UpperLimit [= value]
The UpperLimit property has these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A floating-point value that defines the lower or upper limit
used at limit checking.
Note
The default value for the LowerLimit is 0.0, and the default value for the
UpperLimit is 100.0.
SIMATIC Computing
A-82 6GK1971–0BA00–0AA1
SIMATIC Computing
Note
If the value of the Value property changes, the Change event will be generated.
Syntax:
object.Value [= value]
The Value property has these parts:
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A Variant that specifies the value of the control.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-83
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A value or constant expression that specifies whether the
control automatically passes entered values to the Value
property.
Setting Description
Automatic (0) (default) Automatically passes the new (input) value to the
Value property
Manual (1) Does not write the new (input) value unless the control
processes a Write method
SIMATIC Computing
A-84 6GK1971–0BA00–0AA1
SIMATIC Computing
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
VarNames A Variant that specifies the array of variables (memory
locations) in the control engine.
VarValues A Variant that contains an array of the corresponding
values to be written to the specified variables.
States A Variant that contains an array of the quality code (Long)
for each of the variables.
result A Long value that indicates whether an error has occurred.
The result is zero if no error occurs.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
VariableName A String expression that specifies the variable (memory
location) in the control engine.
Value A Variant value containing the content to be written to the
specified variable in the control engine.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-85
SIMATIC Computing
Part Description
TimeOut A Long value that determines the length of time (in ms)
before generating a time-out error. (Not applicable for this
release). For the current release, this value should always
be 0.
result A Long value that indicates whether an error has occurred.
The result is zero if no error occurs.
Part Description
object An object expression (identifier for the specific SIMATIC
control) that evaluates to an object in the Applies To list.
value A Boolean expression that specifies whether or not the
displayed number is filled with leading zeros.
Part Description
True Fills the number with leading zeros to the size specified by
the DataType property.
False (default) Does not fill the number with leading zeros.
SIMATIC Computing
A-86 6GK1971–0BA00–0AA1
SIMATIC Computing
Chapter Overview
SIMATIC Computing provides a collection of custom SIMATIC controls for
accessing data in the control engine:
S SIMATIC Button control reads and writes Boolean (single bit) values.
S SIMATIC Number control automatically converts the S7data types, allowing you
to accurately read and write all of the S7 data types,
S SIMATIC Slider control provides a sliding indicator (“slider”) for entering or
displaying dynamic data.
The Button control allows you to associate a button display with data bit from your
process and to change them. You associate the button with your process by
assigning a variable (namely, the desired bit location) to it. You can then toggle the
button display to change the state of the bit; the button color also changes
automatically as the state of the bit changes within the process.
Figure A-26 shows the Button control. The Button control has two states of
animation: 0 (off) or 1 (on). Clicking on the Button control changes the data in the
control engine.
OFF Control
SIMATIC Computing
6GK1971–0BA00–0AA1 A-87
SIMATIC Computing
Warning
! After you assign a variable to the Value property of a SIMATIC or a third-party
ActiveX control, the control is able to access process data. When you change the
value that is displayed in the control, you are changing the value in the actual
process.
Altering process data can cause unpredictable process operation, and
unpredictable process operation could result in death or serious injury to
personnel, and/or damage to equipment.
Exercise caution to ensure that you do not access any data that could cause
process equipment to operate erratically. Always install a physical emergency stop
circuit for your machine or process.
Remember that the button control can be assigned only to an individual bit in the
control engine. The only valid data type for an Button control is BOOL.
SIMATIC Computing
A-88 6GK1971–0BA00–0AA1
SIMATIC Computing
Defining the Label and Enabling the Control (Using the General Tab)
The General tab of the Properties dialog (see Figure A-28) allows you to define the
two labels for the Button control:
S “TrueCaption”: Enter the text to be displayed in the control when the bit is “true”
(equal to 1 or “on”).
S “FalseCaption”: Enter the text to be displayed in the control when the bit is
“false” (equal to 0 or “off”).
The General tab also includes a check box for enabling the control. When you
select this option, the control can actively access the control engine. Deselecting
this option deactivates the control: it does not access the memory location of the
control engine and does not react on any mouse clicks. It also does not generate
events while disabled. The default setting for this option is enabled (selected).
TrueCaption: ON
FalseCaption: OFF
Enabled:
SIMATIC Computing
6GK1971–0BA00–0AA1 A-89
SIMATIC Computing
Effects
Bold Underline
Italic Strikeout
Sample Text:
MS Sans Serif
Gray
Green
Magenta
Red
SIMATIC Computing
A-90 6GK1971–0BA00–0AA1
SIMATIC Computing
You use the properties and methods listed in Table A-17 to manipulate the Button
control. Das Data Control reagiert auf die in Tabelle A-18 aufgelisteten
Ereignisse.
Event Description
Change event Occurs when the value of the Value property changes
Click event Occurs when a mouse button is pressed and released while the
mouse cursor is over the control
SIMATIC Computing
6GK1971–0BA00–0AA1 A-91
SIMATIC Computing
The Number control allows you to display process data in a numeric format and to
modify that data. You associate the number display with your process by assigning
a variable (the process value) to it.
You can type a new value into the display; the display also updates automatically
when the variable associated with it changes within the process. Besteht eine
Verknüpfung des Number Controls mit einer Prozeßvariablen, zeigt das Control
den Wert der Variablen an und die Prozeßvariable kann durch Eingabe eines
Wertes gesetzt werden.
The Number control provides access to the memory locations of the control
engine. Entering a new value in the control changes the data in the control engine.
Figure A-31 shows the Number control.
Enter Cancel
button button
Note
In order to connect the Number control to actual process data, you must establish
a connection through the Data control.
SIMATIC Computing
A-92 6GK1971–0BA00–0AA1
SIMATIC Computing
Warning
! After you assign a variable to the Value property of a SIMATIC or a third-party
ActiveX control, the control is able to access process data. When you change the
value that is displayed in the control, you are changing the value in the actual
process.
Altering process data can cause unpredictable process operation, and
unpredictable process operation could result in death or serious injury to
personnel, and/or damage to equipment.
Exercise caution to ensure that you do not access any data that could cause
process equipment to operate erratically. Always install a physical emergency stop
circuit for your machine or process.
To set properties for anything other than the Value property, you can use the
properties dialog box for the Number control itself. Use the Edit menu or right click
the mouse button and select the Properties command for the control.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-93
SIMATIC Computing
The fields on the General tab allow you to define the following properties
concerning how the data will be displayed:
S “Data type” defines the size of the presentation for the data. Table A-19
describes the sizes of the data types used by the Number control.
If you entered a specific data type for the assigned variable in the SIMATIC
Data control, you must enter the same data type here.
S “Radix” configures the data to be accessed (display or entered) as a binary,
octal, decimal or hexadecimal value.
S “Precision” defines the decimal place for the real (floating–point) number. (The
default value is three digits) This field is enabled only for the Real data type.
SIMATIC Computing
A-94 6GK1971–0BA00–0AA1
SIMATIC Computing
Using the alignment buttons, you can define how the value will be displayed in the
Number control: aligned to the left side of the field, centered in the field, or aligned
to the right side of the field.
You can also enable the Number control to check for upper and lower limits on the
value that you enter. You can select limit checking for a maximum value, a
minimum value, both maximum and minimum value, or for no limit checking.
When you enable the Limit Checking option, the Number control does not write an
out-of-range value (larger than the upper limit or smaller than the lower limit) to the
control engine. If the Number control has been configured to show the error
messages, the out-of-range value generates an error message.
Using the check boxes on the General tab, you can define other operations for the
control:
S “Zero Pad”: When you enable this option, the Number control fills out the data
type by inserting zeroes (0) to the left of the value. The default setting for this
option is disabled (not selected).
S “Show Buttons”: When you enable this option, the Number control displays the
Enter and Cancel buttons. (See Figure A-33.) When this option is checked, you
must confirm any new value in order to enter it. Typing a new value in the
display field of the control enables the buttons. Clicking on the Enter button
writes the new value to the control engine; clicking on the Cancel button
replaces the new value with the value from the control engine. The default
setting for this option is disabled (not selected).
You can also use the Return (or Enter) key on the keyboard instead of the Enter
button, and the Escape (Esc) key instead of the Cancel button.
S “Show Error Boxes”: when you enable this option, the Number control displays
the messages (“error boxes”) in response to pre-defined error conditions (for
example, for out-of-range or invalid numbers). The default setting for this option
is enabled (selected).
SIMATIC Computing
6GK1971–0BA00–0AA1 A-95
SIMATIC Computing
Appearance: 1 – 3D
Enabled
Locked (read-only)
Using the check boxes on the Style tab, you can define other operations for the
Number control:
S “Enabled”: When you select this option, the control can actively access the
control engine. Disabling this option deactivates the Number control: it does not
access the memory location of the control engine and does not react on any
mouse clicks. It also does not generate events while disabled. The default
setting for this option is enabled (selected).
S “Locked”: When you enable this option, the control becomes a : read-only
display. you can view the value in the memory location of the control engine, but
you cannot change the values from this control. The default setting for this
option is disabled (not selected).
SIMATIC Computing
A-96 6GK1971–0BA00–0AA1
SIMATIC Computing
Creating a Label for the Number Control (Using the Label Tab)
The Label tab of the Properties dialog box (see Figure A-35) allows you to define a
label (or caption) for the control. You can define two different captions for the
control (“Caption 1” and “Caption 2”).
As shown in Figure A-36, the labels can be oriented either horizontally or vertically
in relationship to the Number control:
S If you select Horizontal, Caption 1 is on the left and Caption 2 is on the right
side of the control.
S If you select Vertical, Caption 1 on the top and the Caption 2 on the bottom.
Use the alignment buttons for each caption to determine whether the label is
centered, aligned to the left, or aligned to the right.
Use the Font tab and the Color tab to specify the font, the font color, and the
background color of the label.
Size1: Size2:
–1 –1
Caption1: Caption2:
Control
Alignment1: Alignment2:
You can also specify a specific width (for horizontal labels) or height (for vertical
labels). Figure A-36 shows the labeling options for the Number control.
If you keep the default value for the size of the label (1), the Number control
automatically adjusts the size of the label to the amount text entered or to the font
size for the caption.
Entering a specific size for the labels allows you to control the appearance of the
Number control. For example, you may want to align the display area for a series
of Number controls, but the labels vary in length for each control. Choosing a
constant size for the labels would align the display areas.
If you enter a specific size for the captions, you enter the size in twips. (A twip is a
screen-independent unit that ensures that the placement and proportion of screen
SIMATIC Computing
6GK1971–0BA00–0AA1 A-97
SIMATIC Computing
elements are the same on all display systems. A twip is approximately 1/20 of a
printer’s point: 1440 twips=1 Inch. or 56.7 twips=1 mm when printed.)
Caption1
Caption 2
where:
process value = the value strored in the control engine, value of the
process variable
Scale = the scalling factor
Offset = the offset factor
Display = the value displayed in the Number control
When the Number control writes data to the control engine, the inverse of the
formula is used to scale the value.
SIMATIC Computing
A-98 6GK1971–0BA00–0AA1
SIMATIC Computing
If you choose to scale by range transformation, you specifiy the upper and lower
values for a source range (for the value in the control engine) and for a destination
range (for the value displayed in the Number control or Display). The Number
control then transforms the value from one range into the equivalent value for the
other range.
These ranges define only the relationship between the data in the control engine
and the data in the Number Control: if the value is above or below the ranges
entered for the information, the transformation uses the formula to extrapolate the
scaled value.
You use the properties and methods listed in Table A-20 to manipulate the Number
control. The control responds to the events listed in Table A-21.
When an error occurs in the Number control, the control generates an Error event.
Your program can capture this Error event and respond to specific situations. Table
A-22 lists the error codes for the Number control.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-99
SIMATIC Computing
SIMATIC Computing
A-100 6GK1971–0BA00–0AA1
SIMATIC Computing
Event Description
Change Occurs when the value of the Value property changes
Click Occurs when a mouse button is pressed and released while the
mouse cursor is over the control
DblClick Occurs when a mouse button is double-clicked while the cursor is
over the control
Error Occurs when the control encounters an error
KeyDown Occurs when the user presses a key while the control has the focus
KeyPress Occurs when an ANSI key is pressed and released while the control
has the focus
KeyUp Occurs when a key is released while the control has the focus
LimitCheckFailed Occurs when the limit check fails
MouseDown Occurs when a mouse button is pressed while the mouse cursor is
over the control
MouseMove Occurs when the mouse cursor moves over the control
MouseUp Occurs when a mouse button is released while the mouse cursor is
over the control
SIMATIC Computing
6GK1971–0BA00–0AA1 A-101
SIMATIC Computing
SIMATIC Computing
A-102 6GK1971–0BA00–0AA1
SIMATIC Computing
The Slider control allows you to display process data in a visual format (as sliding
indicator) and to modify that data. You associate the slider with your process by
assigning a variable (the process value) to it. You can then adjust the slider
indicator in order to modify the process value; the slider also changes its indicator
position automatically as the variable associated with it changes within the
process.
The Slider control provides access to the memory locations of the control engine.
Entering a new value in the control changes the data in the control engine.
Figure A-38 shows the toolbox icon and the Slider control.
Control
0 100
Note
In order to connect the Slider control to actual process data, you must establish a
connection through the SIMATIC Data control.
Warning
! After you assign a variable to the Value property of a SIMATIC or a third-party
ActiveX control, the control is able to access process data. When you change the
value that is displayed in the control, you are changing the value in the actual
process.
Altering process data can cause unpredictable process operation, and
unpredictable process operation could result in death or serious injury to
personnel, and/or damage to equipment.
Exercise caution to ensure that you do not access any data that could cause
process equipment to operate erratically. Always install a physical emergency stop
circuit for your machine or process.
To establish a connection between the Slider control and your process data, you
assign a variable to the Value property of the control. The variable cannot be
assigned within the Properties dialog box of the Slider control. Instead, use the
Properties dialog box of the SIMATIC Data control and select the slider from the
expandable list of controls under the Connections tab. (See FigureA-39).
SIMATIC Computing
6GK1971–0BA00–0AA1 A-103
SIMATIC Computing
To set properties for anything other than the Value property, you can use the
Properties dialog box of the Slider control. Use the Edit menu or right click the
mouse button and select the Properties command for the control.
SIMATIC Computing
A-104 6GK1971–0BA00–0AA1
SIMATIC Computing
General
Vertical Ticks:
Min: Max:
SmallChange: LargeChange:
Figure A-41 shows the other elements that are defined by the Properties dialog
box. You can enter the minimum (Min) and maximum (Max) values for the Slider
control, and you can choose whether or not to display these values. You can also
define the number of interim units (ticks) between the minimum and maximum
values.
Ticks
Minimum Maximum
value value
0 100
100
Horizontal Vertical
0 100
SIMATIC Computing
6GK1971–0BA00–0AA1 A-105
SIMATIC Computing
You use the properties and methods listed in Table A-23 to manipulate the Slider
control. Das Control reagiert auf die in Tabelle A-24 aufgelisten Ereignisse.
Event Description
Change event Occurs when the value of the Value property changes
Click event Occurs when a mouse button is pressed and released while the
mouse cursor is over the control
DblClick event Occurs when a mouse button is double-clicked while the cursor is
over the control
KeyDown event Occurs when the user presses a key while the control has the focus
KeyPress event Occurs when an ANSI key is pressed and released while the control
has the focus
KeyUp event Occurs when a key is released while the control has the focus
MouseDown event Occurs when a mouse button is pressed while the mouse cursor is
over the control
MouseMove event Occurs when the mouse cursor moves over the control
MouseUp event Occurs when a mouse button is released while the mouse cursor is
over the control
SIMATIC Computing
A-106 6GK1971–0BA00–0AA1
SIMATIC Computing
Chapter Overview
The SIMATIC Data control can be used not only with other SIMATIC ActiveX
controls, but also controls of other providers or custom ActiveX controls. To work
with a custom ActiveX control, the Data control requires that the control provide a
minimum of code to respond to changes in the assigned variable.
You can also use other containers, such as Visual Basic, with the SIMATIC
Controls. In order to use the SIMATIC controls in another container, the container
must support the requests of ”extended controls”. If the container does not support
these functions, you must supply program code to perform these functions.
For the SIMATIC Data control to work within a third-party container, the container
must support the “property browsing” functions of the Data control. To do this, the
container must support the functions for “extended controls” (as defined by
Microsoft for containers). An extended control is a partial control that wraps around
another control to support container-specific properties, methods and events.
(Refer to Microsoft’s on–line documentation for more information about containers
and extended controls.)
To provide the extended control functions, the container must support the following
methods:
S IOleClientSize::GetContainer
S IOleContainer::EnumObjects
S IOleControlSite::GetExtendedControl
The extended control of the container must also support a Name property.
Visual Basic unterstützt extended Controls. Containers from other vendors (such
as Borland’s Delphi version 3.0) do not support extended controls. The Siemens
customer support center can help determine if your container supports the
extended control functions.
If your container does not support the extended control functions, you must provide
program code to perform these functions. Contact the Siemens customer support
center for sample code that performs the extended control functions.
SIMATIC Computing
6GK1971–0BA00–0AA1 A-107
SIMATIC Computing
In order to create a custom ActiveX control that can be used with SIMATIC Data
Control, the custom control must provide a property to which data can be written
For example, your custom control might have a value property: when the Value
property changes, then the control reacts.
SIMATIC Computing
A-108 6GK1971–0BA00–0AA1
SIMATIC Computing
You can create a custom ActiveX control that communicates through the Data
control to access the control engine. To create this sample application, you need
the following items:
S Microsoft Visual Basic 5 or higher
S SIMATIC Data control from Computing
S Sample program
SIMATIC Computing
6GK1971–0BA00–0AA1 A-109
SIMATIC Computing
Table A-26 Sample Program for an ActiveX Control Used with Computing
Adding the Custom Control to a Program Using the SIMATIC Data Control
1. Open a new VB project: Use the File”Add Project menu command to display
the “Add Project” dialog box, then select the Standard EXE icon and click on
the “Open” button. Visual Basic opens a new project with an empty form in the
Object window.
The Project directory area now lists two projects: Project1 contains
UserControl1, and Project2 contains Form1.
2. Select the UserControl1 icon in the toolbox and insert it onto Form1 of Project2.
3. Add the Siemens SIMATIC Data control to the toolbox (components menu).
4. Select the Data control icon in the toolbox and insert it onto Form1 of Project2.
5. Select the Data control and click the right mouse button to bring up the pop-up
menu. From the pop-up menu, select Properties to display the “Properties”
dialog box for the Data control.
6. From the “Properties” dialog box, select the “Connections” tab. Click on the “+”
symbol to expand the list of controls.
7. Select the UserControl1 control and click on its “+” symbol to expand its
properties list.
8. Select the Value property and enter a process variable (browse button) in the
“Assigned Variable” field. Click on the “Apply” and “OK” buttons to enter the
data and close the “Properties” dialog box.
SIMATIC Computing
A-110 6GK1971–0BA00–0AA1
SIMATIC Computing
General Engine Connections Events Name Select the option for a direct
connection
Connect via Tag Source
Tag Source
Browse
Direct Connect
Enter@SimaticNet as the type of
control engine
PC Name
SIMATIC Computing
6GK1971–0BA00–0AA1 A-111