OPC Marshal Example

From SysCAD Documentation
Jump to navigation Jump to search

Navigation: User Guide ➔ Dynamic Example Projects ➔ OPC Marshal


Dynamic OPC Example.png


This project requires you to have the SysCAD Marshal (OPC) license add-on to work correctly.

PLEASE NOTE: By opening this project, SysCAD should automatically open up two extra applications:

  1. SysCAD Marshal - the SysCAD OPC Client Marshal.png
  2. OPC - a simple SysCAD OPC Server Test Utility OPC.png (ScdIODB.exe)
  • If SysCAD Marshal is not opened, there maybe an issue with registry. Please follow instructions: Setting up COM to add the required files to the registry.
  • If OPC is NOT opened, please install the OPC Components and then try again. (Installation file location: C:\SysCAD93\Setup\OPC Setup\OPC Core Components 3.00\Setup.exe)

Project Location

This Dynamic Transfer project is stored at:

..\SysCADXXX\ExamplesDynamic\OPC Marshal Example.spf

Features Demonstrated

  1. OPC connectivity between SysCAD, OPC Server and OPC client
  2. Using SysCAD Marshal as OPC Client

Brief Project Description

  • The SysCAD project is very simple, it consists of a single PGM file with a few tags, representing analogue in/out, digital in/out tags. The aim of the project is demonstrating how SysCAD can communicate with another application via OPC.

Project Configuration

Setting up SysCAD Marshal

SysCAD Marshal requires two files: (File location: inside the project folder)

  1. Marshal.scm file
  2. Marshal_Tags.db3 (this is a SQLite database; alternate file formats are csv text files or MS Excel files)
Marshal.scm file
Dynamic OPC Example1.png
Button Small 1.png: File Name
Button Small 2.png: Define where the IO slot tags are. This file contains a list of all the IO tags (slots) by specifying a "Marshal OPC Client Tag", its data type, its mapping to a tag on an OPC Server and optionally a connection mapping to a flowsheet SysCAD tag. For more information, see IO Tag List.
Button Small 3.png: Define the OPC server. In the example above, this is defined under the [Demo] section. The section name could be any name but importantly this exact name is used later in the scdDriver field as the first parameter, for example OPC(Demo, "TheOPCTagInServer")
Setting up the IO list:
The IO List (Marshal OPC Client Tag List) can be edited by editing the Marshal_Tags.db3 directly.
Dynamic OPC Example2.png
This is where user defines the tag matching between the two applications (SysCAD and OPC Server).
Button Small 4.png: File Name
Button Small 5.png: Unique Marshal Tag names. These are the Marshal OPC Client Tags.
Button Small 6.png: Maps SysCAD tags to the Marshal Tags (and/or Marshal Tags to other Marshal Tags). Use Set for send information to SysCAD, use Get to retrieve information from SysCAD.
Button Small 7.png: Maps OPC Server tags to the Marshal Tag. Demo is the OPC server defined in the Marshal.scm file Button Small 3.png. The OPC server tags are defined in the 3rd party OPC Server application.
Below is an example of the SysCAD Marshal:
Dynamic OPC Example2a.png

Setting up the SysCAD project:

Dynamic OPC Example3.png

  • For demonstration purposes, this project is set up with PGM tag for connectivity. However, if the project contains real unit operations such as tanks and pumps etc., the SysCAD models tags can be used.
  • SysCAD Marshal is switched on. To do this, go to Project - Settings - IO Connections Tab and select IO Marshal (OPC Client) ON.
  • If new connectivity tags are required, they must be defined in the Marshal_Tags file first, then save, close and reload the SysCAD project.

OPC Server

Dynamic OPC Example4.png

  • When the SysCAD project is running, user can go to the OPC server and change the values to the tags, then observe the value change inside SysCAD and vice versa.