opcengine software documentation

32
Dynsim OPCEngine Software Documentation

Upload: bruce-kfoo

Post on 29-Dec-2015

56 views

Category:

Documents


3 download

DESCRIPTION

a

TRANSCRIPT

Page 1: OPCEngine Software Documentation

Dynsim OPCEngine

Software Documentation

Page 2: OPCEngine Software Documentation

Revision Log

Rev Date Initials Description0 1 Nov 2002 KDK Initial Release0.1 25 July 2006 NS Add product data template information

2 of 26

Page 3: OPCEngine Software Documentation

Product Data

Product Name: Dynsim OPCEngine

Description: Acts as an OPC client to allow various Dynsim/SIM4ME engines to interact with other OPC applications (often third party) through cross referencing.

Type: Dynsim OTS Software Engine.

Required Third Party Software:Required Third Party HardwareSupported Dynsim Version:

Dynsim 4.1

Supported Third Party Version:Third party support contact:Cost: Contact SimSci-Esscor sales.Third Party Cost:

3 of 26

Page 4: OPCEngine Software Documentation

Contents

Revision Log........................................................................................................................2

Product Data........................................................................................................................3

Contents...............................................................................................................................4

System Architecture Diagram..............................................................................................5

Installation Guide.................................................................................................................7

User Guide...........................................................................................................................8

Starting the OPCSim Configurator..................................................................................8

OPC Server Configuration...............................................................................................9

OPC Communications Setup.....................................................................................11

OPC Data Transfer Options.......................................................................................11

OPCEngine (Client) Configuration...............................................................................12

Timestep Configuration.............................................................................................12

Snapshot Configuration.............................................................................................15

OPC Item Data Configuration.......................................................................................17

Adding Tags Graphically...........................................................................................17

Adding Tags Manually..............................................................................................20

Deleting Tags.............................................................................................................21

Modifying Tags.........................................................................................................22

Configuration Validation...............................................................................................23

Error Logging............................................................................................................23

Printing Support.........................................................................................................23

Saving and Opening Configurations..........................................................................24

Config File Specification in SIM4ME...........................................................................24

Using the OPCSim Snapshot Viewer............................................................................25

4 of 26

Page 5: OPCEngine Software Documentation

System Architecture Diagram

SIM4ME is a modular environment, which allows multiple engines and multiple Graphical User Interfaces (GUI) to work in a co-ordinated effort for the development and use of dynamic simulation applications such as Operator Training Simulators (OTS). The SIM4ME architecture is capable of being distributed and therefore supports splitting OTS tasks between multiple processors and/or multiple computers.

A SIM4ME engine handles interactions between a specific emulation package or modelling environment and the SIM4ME Simulation Executive, or other engines. The OPCEngine facilitates data transfer between any SIM4ME engine, such as a DynsimPower engine or one of several DCS emulation or interface engines, and a third party software or hardware package via standardized OPC communication protocol.

This document describes the OPCEngine implementation for SIM4ME and the functional requirements placed on an OPC server wishing to integrate with the SIM4ME architecture by using the OPCEngine.

The following are true of the OPCEngine and the OPC Server it interacts with:

OPC Data Access (OPC DA) is used as the communications protocol.

The engine is implemented as an OPC Client application.

5 of 26

SIM4ME

DCS Engine

DynsimPEngine

3rd PartyOPC Interface

GUI

OPCEngine

Page 6: OPCEngine Software Documentation

The engine supports both OPC DA 2.0x and 1.0a specifications, and always uses OPC DA 2.0x interfaces in preference to OPC 1.0a interfaces where available.

The engine supports connection to both In-Process and Out-of-Process OPC servers on the local machine and Out-of-Process servers on a remote machine via use of DCOM.

The OPC Server in general is not integral to the emulator / model, and hence additional internal communications between the OPC Server and physical DEVICE (emulation / model) are typically necessary.

The OPC Server implements an internal CACHE for values obtained from the physical DEVICE.

A more detailed look at the OPCEngine architecture is depicted below.

6 of 26

Page 7: OPCEngine Software Documentation

Installation GuideThe SIM4ME OPCEngine package will be installed through a standard Windows installation package built with InstallShield.

This installer will ensure that all the relevant files are installed, registered where appropriate.

After installation via the install shield, the following steps must be completed before the OPCEngine can be used effectively.

OPC Server Configuration OPCEngine (Client) Configuration OPC Item Data Configuration Configuration Validation Config File Specification in SIM4ME

All of these steps are outlined in the User Guide below.

7 of 26

Page 8: OPCEngine Software Documentation

User Guide

Starting the OPCSim Configurator

Before running the OPCEngine, the OPCSim Configurator is used to configure OPC data points and groups. The SIM4ME OPCSim Configurator will be started from a menu pick on the Windows Start Menu:

Figure 1 SIM4ME OPCEngine Start Menu Entries

Once started the main application window for the OPCSim Configurator will be displayed:

8 of 26

Page 9: OPCEngine Software Documentation

Figure 2 OPCEngine Configurator main window

The main application window consists of a number of different areas:

Workspace Error Log OPC Item List Toolbar Status Bar Header Bar

The use and function of these different areas will be described as appropriate below.

OPC Server Configuration

Before configuration can begin the user must first select and make a connection to the target OPC Server.

This can be done through the ‘OPC Server…’ option on the Config menu of the OPCSim Configurator, or via the Toolbar button.

Selecting the ‘OPC Server…’ option will display the OPC Server Setup dialog box:

9 of 26

Page 10: OPCEngine Software Documentation

Figure 3 OPC Server Setup dialog box

This dialog box lists all OPC Servers (OPC DA 1.0 and DA 2.0) registered on the local PC, OPC Servers registered on remote PC’s (assuming both local and remote PC’s have OPCEnum installed and that DCOM on both machines is correctly configured). It also allows for the manual entry of an OPC Server via its ProgID if a server is not listed.

To continue a user must select an OPC server, or enter a server’s ProgID.

Clicking OK on this dialog will establish communications with the OPC Server, which will be indicated by the ‘Connection State’ displayed in the Status Bar.

Figure 4 OPC Server Connection Status

10 of 26

Page 11: OPCEngine Software Documentation

OPC Communications Setup

Once an OPC Server has been configured the next step is to configure the OPC communications settings, and the options for the OPCEngine operation. This is done through the ‘OPC Comms Setup…’ option on the Config menu, via the toolbar button.

Figure 5 OPCEngine Configuration Dialog

OPC Data Transfer OptionsThe Settings in this dialog for OPC Data Transfer allow the user to configure the following:

Update Rate: The rate at which changes in values for outputs from the OPC Server will be advised to the SIM4ME OPCEngine

% Deadband: The deadband value to be specified for all OPC groups used by the OPC. This value follows the deadband specification as described in the OPC DA specifications.

11 of 26

Page 12: OPCEngine Software Documentation

OPCEngine (Client) Configuration

The ‘Configuration Options’ settings allow the use to specify how the OPCEngine will operate.

The options are:

Run Engine in Step Mode: The OPCEngine will require specification of an OPC Item / tag which will cause the OPC Server to execute one step of integration time, and another tag which will indicate that the step has been completed. If this option is not specified the OPCEngine will still operate in step fashion, however it will not trigger the OPC Server to execute any logic.

Save State with Snapshots: When selected, the OPCEngine will maintain the current running state of the simulation through snapshots. The actual operation of saving and restoring snapshot data can be performed by either the OPCEngine itself, or by the OPC Server. When selected, a number of tags will need to be configured to enable the OPCEngine to perform snapshot functionality. When Snapshots are being used, the OPCEngine can optionally trigger the OPC Server to ‘Reset’. This option is provided so that certain OPC Servers can write restored values into operating registers after restoration of a snapshot. This option, if configured, will be performed synchronously after restoration of a snapshot and before the engine resumes stepped operation.

Timestep ConfigurationIf the Step Mode option has been selected, the ‘Time Step Setup…’ option becomes enabled on the Config Menu and toolbar, and the user is required to enter information to enable the OPCEngine to trigger timestep execution in the OPC Server. Selecting this option displays the Time Step Configuration dialog:

12 of 26

Page 13: OPCEngine Software Documentation

Figure 6 Timestep Configuration Dialog WriteID Tab

This is a tabbed dialog that consists of two tabs. The first tab ‘WriteID’ allows the user to specify the OPC Item and value that will cause the OPC Server to execute a single integration step.

The user needs to specify a minimum of the ItemID, Req,(ested) Datatype and Trigger Value. Normally it is expected that the user will specify a BOOL Item, and hence these are the defaults.Clicking on the ‘…’ button next to the ItemID will display the OPC Item Browser dialog allowing the user to browse for the OPC Item in the OPC Server’s namespace by using the standard OPC Browser interfaces. Support for this browsing will be dependent on support in the OPC Server.

13 of 26

Page 14: OPCEngine Software Documentation

Figure 7 OPC Item Browser

The ReadID Tab of the Timestep configuration dialog allows the user to specify an OPC Item, which is guaranteed to change value only when a time step has been executed, therefore providing an indication to the OPCEngine that the time step has been completed.

Unlike the WriteID tab, the user only needs to specify the OPC ItemID, the OPCEngine does not need to know, and does not care about the actual value of this item, only that it changes in response to a timestep.

14 of 26

Page 15: OPCEngine Software Documentation

Figure 8 Timestep Configuration Dialog - ReadID Tab

Snapshot ConfigurationWhen the Snapshot option is selected in the OPC Configuration and the OPC Server is configured to perform the snapshot save / restores, or the Reset option is configured, the ‘Snapshot Setup…’ option becomes enabled on the Config menu and toolbar.

Selecting this option will display the Snapshot Setup Dialog:

15 of 26

Page 16: OPCEngine Software Documentation

Figure 9 Snapshot Configuration Dialog

Again, this is a tabbed dialog, but the number of tabs that will be displayed will be dependent on the options selected in the OPC Communications Setup dialog.

The tabs that could be displayed are:

Save ID – Trigger value for OPC Server to Save State.

Save Complete ID – Item that changes value to indicate state has been changed.

Restore ID – Trigger value for OPC Server to Restore State.

Restore Complete ID – Item that changes value to indicate state has been changed.

Name ID – The item whose value that will be set to the name of the snapshot.

Reset ID – Trigger value for OPC Server to Reset State after snapshot restore.

Reset Complete ID – Item that changes value to indicate Reset has been completed.

Configuration of the fields on these dialogs is the same as previously described for the Time Step dialog. Tabs without ‘Complete’ in their title relate to OPC Item that the OPCEngine will write values into to trigger operations in the OPC Server. Tabs that include ‘Complete’ in their title relate to items that should change state to indicate completion of the operation in the OPC Server.

16 of 26

Page 17: OPCEngine Software Documentation

OPC Item Data Configuration In order for model data to be transferred between the OPCEngine and Server OPC Items must be configured into the OPC groups in the OPCSim Configurator.

The OPCEngine Configuration categorizes data into one of three groups:

Model Inputs – Items that are inputs to the model running in the OPC Server. The OPCEngine will write these values to the OPC Server.

Model Outputs – Items that are outputs from the model running in the OPC Server. The OPCEngine will be advised of changes in these values by asynchronous notifications from the OPC Server.

State – Items that need to only be read when saving the state of the model and items that need to be written to the model when restoring state.

Adding Tags GraphicallyTo add items to an OPC group, the user must first select the target group from the ‘OPC Group Configuration’ tree in the ‘OPC Sim View’ of the engine configurator workspace.

Figure 10 OPC Group Configuration

The currently selected OPC group is indicated in the header bar that is displayed over the top of the OPC item list display:

Figure 11 Header Bar

Once selected, the user can add items to that group, either by manual configuration, or by use of the OPC Browser interfaces.

17 of 26

Page 18: OPCEngine Software Documentation

To add items via the browser, the user can change tabs in the configurator workspace to browse the connected OPC Server.

Figure 12 OPC Browser tab

The items listed in the OPC Browser can be filtered by right clicking in the browser window and selecting the Browser Filter option. Selecting this option displays the Browser Filter dialog:

Figure 13 OPC Browser Filter dialog

Double clicking on a item / tag in the browser will add that tag to the selected OPC Group, and it will be displayed in the OPC Item list, together with the item value, quality and last update ‘timestamp’.

Display of ‘live values’ for the OPC items is optional, and can be disabled by toggling the ‘Live Data’ option on the View menu or toolbar.

18 of 26

Page 19: OPCEngine Software Documentation

It is also possible add items by right clicking on an item and select the ‘Add Selected Tag’ option from the displayed menu

The number of OPC Items currently configured in a group will be indicated in the ‘Tag’ area of the status bar.

Figure 14 OPC Item Display

If a user wants to add all items of a branch in the OPC Browser window, right clicking on a branch will display a menu allowing the user to add all child tags for that branch.

19 of 26

Page 20: OPCEngine Software Documentation

Figure 15 Add Child Tags option

Adding Tags ManuallyIf the user desires, or if the OPC Server does not support browsing, it is possible to add tags manually.

This is achieved by selecting the ‘Add Tag…’ option from the Config menu, or by using the toolbar button. Selection of this option displays the Add Tag dialog box.

20 of 26

Page 21: OPCEngine Software Documentation

Figure 16 Add Tag dialog box

The fields for this dialog box are identical to dialog boxes already described.

For all methods of adding items to an OPC group, the OPCEngine Configurator will only allow a tag to be added once to a particular group as adding a tag more than once is not meaningful.

Deleting TagsTo delete a tag from an OPC group the user needs to select the tag in the OPC Item List before selecting the ‘Delete Tag…’ option from the Config menu or toolbar.

The OPC Configurator will then prompt to verify that the tag should be deleted:

Figure 17 Delete Tag Confirmation dialog

21 of 26

Page 22: OPCEngine Software Documentation

Modifying TagsIt is possible to modify a tag added to an OPC group by using the Tag Properties dialog.

To modify a tag the user must select the tag in the OPC Item list before selecting the ‘Tag Properties…’ from the Config menu or toolbar.

Selecting this option will display the OPC Tag Properties dialog box:

Figure 18 OPC Tag Properties dialog box

22 of 26

Page 23: OPCEngine Software Documentation

Configuration Validation Before the OPCEngine configuration can be saved it must be validated and VALID.

Using the ‘Validate Configuration…’ option on the Config menu or toolbar performs the validation of the configuration.

The current validity of the configuration is displayed in the status bar, and it can be one of three states:

Valid – Configuration is VALID Invalid – Configuration is INVALID Unknown – Status of configuration is UNKNOWN, it has not yet been validated.

Figure 19 Configuration Validity Status Indicators

Error LoggingWhen errors are encountered in the OPC communications between the OPCEngine Configurator and OPC Server they are logged in the Error Log window. Most of the errors that can be logged are probably benign and will not effect the operation of the OPCEngine Configurator or OPCEngine.

Figure 19 Error Log Window

Printing SupportThe OPCEngine Configurator supports printing and print previewing of the item configuration of the currently selected OPC group. Print/Preview support is through the normal menu items on the File Menu or toolbar.

23 of 26

Page 24: OPCEngine Software Documentation

Figure 21 OPC Group Configuration Printout example

Saving and Opening ConfigurationsSaving and opening of OPCEngine configuration is performed through the normal menu items on the File menu, or by use of the related toolbar buttons.

The use of these functions is standard in the Windows environment, and hence is not described here.

The result of saving the OPCEngine Configuration is a single file, which needs to be specified on the command line of the OPCEngine in SIM4ME.

Config File Specification in SIM4ME The OPCEngine is configured in SIM4ME as per other engines. However the OPCEngine provides one on non-standard command line argument to allow specification of the OPCEngine configuration.

To link an instance of the OPCEngine with its configuration, the use must specify the configuration filename against the ‘-OPC’ command line option in the Engine Configuration Details dialog box in SIM4ME.

24 of 26

Page 25: OPCEngine Software Documentation

Figure 20 SIM4ME Engine Configuration dialog

Using the OPCSim Snapshot Viewer When the OPCEngine is configured to perform snapshot saves itself, it will save all information for the snapshot into a single binary format snapshot file.

This file contains all values for the Model Inputs, Outputs and State OPC groups.

To make it possible to view the contents of this binary file a Snapshot View applications has been provided, which can open the snapshot files.

By default these files are saved with the name of the OPCEngine (as configured in SIM4ME) in the TSUNAMI\Working directory.

The Snapshot Viewer is started from the option on the Windows Start Menu, just like the OPCEngine Configurator.

Once started the Snapshot View application window will be displayed:

25 of 26

Page 26: OPCEngine Software Documentation

Figure 21 OPCEngine Snapshot Viewer

By using the Open command on the File Menu or Toolbar, a snapshot file can be opened.

Once open the Snapshot View will display the three OPC groups in a tree on the left, and values for items contained in a group in the right hand pane when a group is selected.

Figure 22 Snapshot viewer with snapshot data

It should be noted that the Snapshot viewer does NOT allow the user to modify values contained with a snapshot file.

26 of 26