Using Symbol Factory .NET with OPC Data Access Servers
Tying your Symbol Factory .NET to tags on your OPC Data Access server is an easy and simple process. In fact, it can be done without having to write a single line of code by using your OPC Server and our Software Toolbox Extender product.
This example will show you how it's done.
Prerequisites:
This example assumes that you have an OPC Data Access server and our Software Toolbox Extender already installed. Since we will be connecting to a MicroLogix 1500, we will use the INGEAR AB OPC Server as our example OPC Data Access Server.
Step 1
Drop your Symbol Factory .NET components on your form. In this example, we will use the default pump (Standard Control) and the default Cutaway Control.

Step 2
Drop a Software Toolbox Extender Engine and Extender component onto your form.
First, locate the Extenders on your Visual Studio Toolbox.

For this example, we will use the OPC Data Control Engine and the Subscription Extender, which will tell the OPC server to
automatically poll our device. Drag the SwToolboxOPCDataControl1 and SubscriptionExtender onto your form.

You will also set the DefaultServer property of the Engine to point to your OPC Data Access server, in this case the INGEAR AB OPC Server.

...and finally you will set the Engine property on the Extender to point to the OPC Data Control Engine.

For more information on how to use the Extender and the Engines, please see our Software Toolbox Extender web site.
Step 3
Next, add some animations to your Symbol Factory .NET Standard Control, in this case the Pump. To do this, right click on the component and select "Symbol Factory .NET Properties".

Then, click on the "Animations" tab, and select "AnalogColor Fill" from the AnimationMode pull down menu. From here, you can select any animation sequence you wish. We've chosen five animation bands for this example.

For a more detailed explanation on how animations work, see "Using Bands" in either the Visual Studio 2003 or Visual Studio 2005/2008 sections of this web site.
Step 4
Now we tie in the OPC Data Access Server tags to the symbols. To do this, go to the properties of the Symbol Factory .NET
Standard Control (the Pump in our example), and click on the ellipses on the Subscriptions property.

You will then be able to tell the Extender which tag in the INGEAR AB OPC Server points to which property on the Symbol Factory .NET control. In this case, we have a tag in the OPC server called "Device1.N7_0"
that points to the PLC address "N7:0" in the MicroLogix 1500.

We click on "Add" to add in a new extension (you can have multiple ones), and merely set the "AssociatedControlProperty" to "AnalogValue1
" (which is the property associated with the animations above), set the "ItemID" to "Device1.N7_0" (which is the point on the PLC that we want polled), and set the ScanRate to 250 (for 250 ms).
This tells the Extender to get the OPC server to poll "Device1.N7_0" once every 250ms, and if there is a change in the value, report that change by changing the property 'AnalogValue1' to the value of '
Device1.N7_0'.
Click OK. You then repeat the same process with the Cutaway Control, except that we tie "Device1.N7_0" to the property "Level".
Step 5
Run and you're done! Notice that no code was written - the Extender takes care of all the underlying OPC functions for you so all you have to worry about is assigning a property to a PLC tag.
Links of Interest
If you wish to learn more about the components used in this example, please see the following:
|