TwinCat OPC Client Help

BECKHOFF TwinCatOpcClient Help

CONTENTS

  • Overview
    What is the TcOpcClient and how is it used?
  • The Main Window
    What does the TcOpcClient do?
  • Connecting to a Server
    How do I connect to a server and start receiving data?
  • Operations
    What type of operations can I perform?


Overview

This TcOpcClient has been developed to assist in the test and development of our OPC Data Access 1.0 and 2.0 Servers. This text assumes that you are using Windows 95/98 or Windows 2000/NT 4.0 (Service Pack 4 recommended).

The TcOpcClient supports both local and remote OPC server connections. Remote connections are handled through the operating system's DCOM interface. Windows 95 users should note that Microsoft provides a special update patch that fixes problems with the original COM/OLE logic that shipped with the operating system. In addition, this patch provides the DCOM support necessary for remote server access that was not implemented in the operating system.

Client Preparation

Begin by creating a server connection. A server connection is used to connect to an OPC server. Once this connection is made, a group can be added to the connection with varying properties such as update rate, dead band, and time bias. Finally, items can be added to the individual groups. These items have properties such as an initial active state, data type and access path. Active items will automatically receive data change notifications and will display its current value and quality in the item view.


The Main Window

Here is a view of the application.

Title Bar

The application title bar will display the name of the loaded project file. A * following the name indicates that it is modified.

Client Configuration

To configure the Beckhoff OPCClient select Options from the Tools menu:

Toolbar

Creates a New project

Opens an existing project from disk

Saves the current project to disk

Create a new server connection

Create new group

Create new item

Edit properties of the selected server, group or item

Cut the current selection to the clipboard

Copy the current selection to the clipboard

Paste a server, group or item(s) from the clipboard

Delete the current selection

Read recipe values

Write recipe values

Group Window

This window manages a list of server connections along with their group objects. Right clicking on a server/group in the list will display a menu of options applicable to the server/group. Double clicking will display the property sheet for the server/group.

Item Window

This window displays a list of item information for the selected group. Right clicking on an item name in the list will display a menu of options applicable to the item. Double clicking will display the properties dialog for the item.

Clicking on the Item ID column heading will cause the item list to be sorted based on Item ID. Moving the mouse over the header for the column that is to be changed and dragging the left or right end of the header button until the column is the desired size can change column widths.

Message Log

This window logs status messages generated by the application. As with the item window, the column headers may be resized. This window does not support sorting.


Server Connection

A server connection provides a link between an OPC server and this client. Through this connection, groups will be added.

Select New Server... from the Edit menu or click the toolbar button to create a new server connection using the following property sheet:

Prog ID

Specify the Prog ID of the OPC Server the client should connect to. You can browse for registered servers by expanding any of the following branches:

OPC Data Access Servers Version 1.0 - Data Access 1.0 servers should self-register and add their Prog ID to this component category. Servers that are properly registered will be listed under this branch.

OPC Data Access Servers Version 2.0 - Data Access 2.0 Servers should self-register and add their Prog ID to this component category. Servers that are properly registered will be listed under this branch.

OPC General - All Servers should add a special OPC key in the system registry to be identified as an OPC server. This method allows for older clients and servers to be used (the preferred method is to use component categories). Servers that are registered with this key will be listed under this branch.

Double-clicking on any registered server will automatically update the Prog ID field.

Remote Machine Name

Specify the name of the machine the OPC server (specified by the Prog ID) resides on. If the server is located on the same machine as the client, leave this field blank.

Once the client makes a successful connection to a server, invoke the server properties by selecting Properties... from the Edit menu to view the server status and the supported server interfaces.

The server status page details the current status of the server. The client queries the status of the server and obtains the following information:

Vendor – A String that specifies vendor specific information.

Start Time - Time the server application was started.

Current Time - Current Time as known by the server.

Last Update Time - Time the server sent the last data update to the client on this connection.

Server State - The current state of the server. Valid states are Running, Failure, No Configuration, Suspended, and Test.

Major Version - Major version of the server software.

Minor Version - Minor version of the server software.

Build Number - Build number of the server software.

This interface page lists the interfaces that are required at the server level. Interfaces not required are considered optional. The "supported" column states which interfaces this server supports.

Visual/Operational Changes

When the TcOpcClient adds, connects, or disconnects a server connection you will notice a change in the appearance of the server connection. The image that appears to the left of each server connection will change to one of the following:

The client is connected to the server.

The client is disconnected from the server.

The client could not connect to the server (the server may not be properly registered).


Group

A group is used to organize a collection of items with a common set of properties. The group also specifies the following properties: group name, update rate, time bias, percent dead band, language ID, active state, and the type of data connection that should be made to the server.

Select New Group... from the Edit menu or click the toolbar button to create a new group using the following property sheet:

Name

Enter a name to identify the group. If no name is entered, it is the responsibility of the OPC Server to generate a unique name for you.

Update Rate

Specifies how often, in milliseconds, the OPC server should provide updates for changing data.

Time Bias

Specifies the time difference in minutes between the client/server and the actual device. The information allows the client to convert the timestamp received by the server back to the local time of the device.

Percent Dead band

Specifies the percent change in data required to notify the client of a data change.

Language ID

Specifies the language to be used by the server when returning values as text for operations on this group.

Active State

Specifies the active state of the group. When the group is active, the client will receive data change updates for all active items at the specified update rate.

Update Notification

Specifies the method to use when receiving data change notifications, or initiating asynchronous requests. Valid selections are OPC 1.0 (No Timestamp), OPC 1.0 (With Timestamp) and OPC 2.0. Data Access 2.0 servers automatically supply timestamps with all data transactions.

When the group has been successfully added to the project, invoke the group properties by selecting Properties... from the Edit menu to modify group properties and view the supported group interfaces.

This interface page lists the interfaces that are required at the group level. Interfaces not required are considered optional. The supported column states which group interfaces are supported by server.

Visual/Operational Changes

When the TcOpcClient adds, activates or inactivates a group you will notice a change in the appearance of the group. The image that appears to the left of each group will change to one of the following:

The group is active.

The group is inactive.

The client could not add the specified group to the server connection.


Items

Items represent data that may be accessed via an OPC server. An item specifies the following properties: item ID, access path, requested data type, and active state.

To add an item to a group select New Item... from the Edit menu or click on the toolbar button to define an item using the item editor dialog box:

Access Path

Required by some OPC servers to complete an item definition. Refer to your OPC server's documentation to determine whether you need to specify an access path.

Item ID

The OPC server item used to reference the data. Refer to your OPC server's documentation to determine valid item names for the location in question. If the server supports tag browsing then you can select an item by using the browse controls.

Data Type

The requested data type should be used when communicating between the OPC server and the OPC Quick Client. This should be specified to agree with the size and type of the register or memory location that is being addressed. Supported data types are defined as follows:

Data Type | Description
Native | Default as determined by the OPC server
Boolean | Single bit
Char | Signed 8 bit value
Byte | Unsigned 8 bit value
Short | Signed 16 bit value
Word | Unsigned 16 bit value
Long | Signed 32 bit value
DWord | Unsigned 32 bit value
Real | Single precision floating point value. (32 bits)
Double | Double precision floating point value (64 bits)
String | Zero terminated character array.

Check the Array box if the data type is an array type.

Active State

Specifies the initial active state for the item when adding the item. The state can be changed later as described later on in this topic.

Button Definitions

Applies changes to the current tag and fills the dialog with properties of the previous tag in the list.

Applies changes to the current tag and fills the dialog with properties of the next tag in the list. If no next tag exists, the client attempts to auto-increment the current item ID.

Creates a new item definition.

Deletes the current item definition.

Validates the current item definition.

Browsing

If the server supports browsing, the browsing controls will be available for use. Browse the branch list to search for selected items. Apply appropriate filtering to simplify the search.

Visual/Operational Changes

When the TcOpcClient adds, activates or inactivates an item you will notice a change in the appearance of the item. The image that appears to the left of each item will change to one of the following:

The item is active.

The item is inactive.

The client could not add the specified item to the group.

Recipes

For each item, a recipe value may be specified, by selecting Set recipe from the Tools|Item menu. You may also choose to read recipes for a whole group, by choosing Read recipes from the Tools|Group menu. Later on you may write the whole recipe for one group down to the PLC.
Reading and writing of recipes may be accelerated by selecting a group and pressing <Strg + Leftarrow> for reading or <Strg + Rightarrow> for writing Group recipes.

Comments

Each Item has associated with it a comment. You can use this value to store any item specific data as you desire.


Operations

Server Connection Operations

Connect

Select Connect from the Tools|Server menu to reestablish a connection to the server. All groups and items will also be added.

Disconnect

Select Disconnect from the Tools|Server menu to disconnect from the server.

Reconnect

Select Reconnect from the Tools|Server menu to reestablish a connection to the server.

Get Error String

Select Get Error String... from the Tools|Server menu to obtain an error description for any valid error codes.

To request an error description from the server, enter the error code and press Apply. If the server can translate the error code, the description will appear. An OPC server should be able to translate any OPC error code, as well as Win32 errors.

This operation tests the following server functionality: IOPCServer::GetErrorString ( ).

Enumerate Groups

Select Enumerate Groups... from the Tools|Server menu to enumerate groups available to the server connection.

Groups can be enumerated two different ways. The server can be requested to enumerate groups by name or by object. Enumerating by name, the server passes back an enumeration of strings each containing the name of a group. Enumerating by object, the server passes back an enumeration of group interface pointers (IUnknown), which the client can make use of, by querying for other interfaces. Either way, the client uses both mechanisms to obtain the same results; a list of group names along with the properties of each group. The client can request only private groups (groups this client added to the server connection), public groups (groups that may have been added by another client, but made available to us) or all groups be enumerated.

This operation tests the following server functionality: IOPCServer::CreateGroupEnumerator ( )., IOPCServer::GetGroupByName ( ), IOPCGroupStateMgt::GetState ( ).

Get Group By Name

Select Get Group By Name... from the Tools|Server menu to obtain group properties by name.

To request group properties by name; enter the name of the group and press Apply. If the server can resolve the group name, the client will proceed to obtain the properties for that group.

This operation tests the following server functionality: IOPCServer::GetGroupByName ( ), IOPCGroupStateMgt::GetState ( ).

Group Operations

Clone Group

Select Clone Group from the Tools|Group menu to clone the selected group. An OPC server should create a new group, with a unique name, with identical properties to the group that is being cloned. If the cloned group contains items, the items should also be cloned, again with the same properties. The active state of the cloned group and items should be set to an inactive state.

This operation tests the following server functionality: IOPCGroupStateMgt::CloneGroup, SetState ( ), IOPCItemMgt::CreateEnumerator, SetClientHandles ( ), IEnumOPCItemAttributes::Reset, Next ( ).

Item Operations

Set Active/Inactive

Select Set Active/Inactive from the Tools|Item menu to activate/inactivate the selected item(s). Only active items should receive on data change updates (the group must also be set active)

Synchronous Read (Cache/Device)

Select Synchronous Cache Read or Synchronous Device Read from the Tools|Item menu to perform a synchronous read from cache/device, respectively, on the selected items.

Asynchronous Read (Cache/Device)

Select Asynchronous 1.0/2.0 Cache Read or Asynchronous 1.0/2.0 Device Read from the Tools|Item menu to perform an asynchronous read from cache/device, respectively, on the selected items. Reads using the older method, 1.0, uses IAdviseSink to return read complete notifications. The newer method, 2.0, uses connection points to exchange data between client and server.

Asynchronous Refresh (Cache/Device)

Select Asynchronous 1.0/2.0 Cache Refresh or Asynchronous 1.0/2.0 Device Refresh from the Tools|Item menu to perform an asynchronous refresh from cache/device on the respective selected items. Refreshes using the older method, 1.0, uses IAdviseSink to return refresh notifications. The newer method, 2.0, uses connection points to exchange data between client and server.

Synchronous/Asynchronous Write

Select Synchronous Write or Asynchronous 1.0/2.0 Write from the Tools|Item menu to perform a synchronous/asynchronous write on the selected items.

Both types of writes utilize the same dialog. The dialog displays the current value at a 100-millisecond refresh rate. Enter the data to write in the write value column and press Apply to send the data to the server. Pressing "OK" applies the write and closes the dialog. Press Cancel to abort the operation.

Secuity Operations

You may choose to protect administrative operations on a configuration with an admin password. To do so, select tools->SetPwd from the menu. In the Following Dialog you are prompted to enter the current and new Administration passwords.

As soon as you switch to a non blank password, any administrative operation on the document will be prohibited. To perform administrative tasks setlect tools->login and enter the password.


Notes on the documentation

This description is only intended for the use of trained specialists in control and automation engineering who are familiar with the applicable national standards.
It is essential that the documentation and the following notes and explanations are followed when installing and commissioning the components.

It is the duty of the technical personnel to use the documentation published at the respective time of each installation and commissioning.

The responsible staff must ensure that the application or use of the products described satisfy all the requirements for safety, including all the relevant laws, regulations, guidelines and standards.

Disclaimer

The documentation has been prepared with care. The products described are, however, constantly under development.
We reserve the right to revise and change the documentation at any time and without prior announcement.
No claims for the modification of products that have already been supplied may be made on the basis of the data, diagrams and descriptions in this documentation.

Trademarks

Beckhoff®, TwinCAT®, EtherCAT®, EtherCAT G®, EtherCAT G10®, EtherCAT P®, Safety over EtherCAT®, TwinSAFE®, XFC®, XTS® and XPlanar® are registered trademarks of and licensed by Beckhoff Automation GmbH.
Other designations used in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owners.

Patent Pending

The EtherCAT Technology is covered, including but not limited to the following patent applications and patents:
EP1590927, EP1789857, EP1456722, EP2137893, DE102015105702
with corresponding applications or registrations in various other countries.

EtherCAT® is registered trademark and patented technology, licensed by Beckhoff Automation GmbH, Germany.

Copyright

© Beckhoff Automation GmbH & Co. KG, Germany.
The reproduction, distribution and utilization of this document as well as the communication of its contents to others without express authorization are prohibited.
Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of a patent, utility model or design.


Recipes

About recipes

Using the Beckhoff OPC Client you may save and use recipe values with your OPC Configurations.
Each item in the itemview has one recipe value associated with it. You may download current values from the PLC or edit values by hand.
Later on you can choose th apply a groups recipe, which means that for every item in the group the recipe value is written to your PLC variables.

Configure recipes

To set up your recipe values press the Read Recipes button from the toolbar whith a group or server selected. For the selected group (or server) every items recipe value will be set to the curren value.