Skip to main content

WEBfactory 2010

Using WEBfactory 2010 Simulation OPC server with an own set of items

Abstract

Check out this article and learn how to user WEBfactory 2010 Simulation OPC server with an own set of items.

When running simulations and tests in WEBfactory 2010Studio using Simulation OPC Servers, it is very important to add your own set of items to the Simulation OPC Server configuration.

An Simulation OPC Server is able to read the configuration from an XML file located on the hard drive. So in order to input custom configuration to the Simulation OPC Server, we need to create an XML file with the desired configuration and tell the Simulation OPC Servers where that file is.

Creating the Configuration.xml file

Using Notepad (Notepad++) or any other text editor, create a new file.

In the new text document we will create the following structure: a server containing a group (or multiple groups) and the items inside the group(s).

  <Server active="1" itemPath="" showAppWin="1" branchDelimiter="0" priorityClass="0">
  	<Group active="1" itemPath="TestGroup1">
  		<Item type="bstr" valueGen="rand" writeable="1">Example1</Item> 
  		<Item type="bool" valueGen="rand" writeable="1">Example2</Item> 
  		<Item type="date" valueGen="rand" writeable="1">Example3</Item> 
  		<Item type="r8" valueGen="rand" writeable="1">Example4</Item> 
  	</Group>
	<Group active="1" itemPath="TestGroup2">
  		<Item type="bstr" valueGen="rand" writeable="1">Example5</Item> 
  		<Item type="bool" valueGen="rand" writeable="1">Example6</Item> 
  		<Item type="date" valueGen="rand" writeable="1">Example7</Item> 
  		<Item type="r8" valueGen="rand" writeable="1">Example8</Item> 
  	</Group>
  </Server>

In the above example, we added two groups containing 4 items each.

Each item has its own attributes:

  • Type : i1, i2, i4, ui1, ui2, ui4, r4, r8, date, bstr, bool or previous combined with '+' for array

  • valueGen : buffer, rand. Rand is incompatible with array type

  • writable: 1 - value is writable, 0 - value is not writable

Group attributes:

  • active - 1 - group is active, 0 - group is not active

  • itemPath - the name displayed for the group in the Simulation OPC Server

Multiple items can be defined with a single configuration file statement, but not more than 5000 items.

We can now save the file using the extension xml. Name it config.xml.

Configuring the Simulation OCP Server to work with the new configuration

To configure the Simultation OCP Server to work with the new xml file, a registry entry must be added.

Open Registry Editor. Navigate to HKEY_LOCAL_MACHINE > SOFTWARE > Wow6432Node > WEBfactory 2010 > WFSIMOPCDA > 1.00 > Settings.

Create a new String entry in the Settings key and name it ConfigFilePath. Edit the entry and add the path to the configuration xml file as value (example: C:\config.xml).

WF_SE_191.jpg

ConfigFilePath registry entry

Now the setup is complete.

In some situations, restarting the machine is necessary.

To test the new configuration, open WEBfactory 2010Studio, right-click on the WEBfactory 2010 .Sim.DA OPC Simulation Server and select Browse Connector.

The Browse Data Provider window will open. You can see the new configuration under the WEBfactory 2010 .Sim.DA.

WF_SE_193.jpg

The new configuration in the OPC Simulation Server