October 16, 2007 by Jeremy Pollard
In my last column, I reviewed the OPC DataHub from Software Toolbox. An accompanying product, the OPC Extender, is a logical transition for your Visual Basic (VB) development needs.
Users can use VB to create an HMI with the data that is served up by the DataHub, though the same is true when using any OPC server. You can also use a direct PLC driver; but once the OPC Unified Architecture (OPC/UA) is released, most industrial hardware vendors will support this specification, making OPC/UA the preferred data access method.
In fact, such companies as Rockwell Automation will be embedding OPC/UA into their hardware platform in future releases. To create an HMI in VB using an OPC server, you have to create code to connect to an OPC server, and there are many ways to do this.
Standard procedure dictates that you access OPC tags by name, perform the read, and do something with it. The OPC Extender changes all of this, allowing users to create applications without coding. This extends all controls in every application in which it is used.
Installing the application is painless, but it will only work with Visual Studio 2003/2005 and .NET. The 2005 Visual Studio Express version is not supported, although that is what I used for testing. VB6 users can use the ActiveX controls that come with the product, but keep in mind that a lot of the power will not be realized if you do.
I opened up Visual Studio and started testing. The scope of this test is to connect, read and write using the Extender. Just to be clear, the process of getting data into an HMI using OPC requires the use of a configured OPC server, which includes defining tag names for each PLC address you need to access.
Once the VB development is open, you can start a new project, add a form and then add the Extender components you need. There are a few components that can aid in automatically stepping the user through the process of configuring the application.
I first added the OPC data engine that connects the VB application to an OPC server. This connector searches the computer that you named the default computer for installed OPC servers. These OPC servers will communicate to the PLCs and extract data, which you can then configure. The engine will enumerate the tags that have been previously configured.
The “Subscription” extender allows you to connect to the OPC data engine. It subscribes to the OPC data engine, and asks for the data and information that you specified on the form you added after launching VB development. I added and selected a text box. The properties for this text box show up in the “Properties” window in the VB development environment. The “SubscriptionExtensions Array” property is where the connection is made with the object on the form. Anyone who has written code to connect a data point to an object knows that there is a bit to do to make this happen. But so far things have been painless.
The control that you associate with the OPC tag needs to have its display property associated with the data that the tag provides. For instance, “TEXT” is the property to connect with the OPC data tag, while “CAPTION” is the property for label control.
Using the text box control, the OPC Extender can format the data, and make the control read only, write only or read/write. You can add multiple connections to the object when there are multiple properties that can be set. There is an “InvokeMethodName” associated with each control. This only has real meaning for customer-generated controls where certain methods can be invoked upon a data change, such as the “PumpON” method when a pushbutton is pressed.
What does OPC Extender really give users? It will give them a huge jump on the market when OPC UA finally comes out. Since it separates the engine from the extension, the engine portion is the only part that changes when your OPC driver changes. Most industrial VB programmers donÃt code that way to allow for an easy upgrade path.
Does the Extender do everything without coding? Not really. If you want to change the colour of the text in the text box when the value exceeds 100, you have to do that with code. Remember that the form controlsÃ method can be invoked when the data is changed, but the code has to be written.
Writing data is all done via code. However, the benefit of the OPC Extender is that you can work from the data that is attached to the control, and use the controls events, properties and methods in the code instead of the native OPC data.
The Extender is runtime distributable at no charge, so the price tag is easier to handle if you are dealing with OPC. The Extender can be very helpful for any OEM. Though it is expensive, it may just be the ticket for you if your applications cover various OPC drivers.
Software Toolbox will soon have a version that directly accesses PLC memory.
Jeremy Pollard is a 25-year veteran of the industrial automation industry. He has worked as a systems integrator, consultant and an educator in the field. Jeremy can be reached at firstname.lastname@example.org.
Name: OPC Extender
Vendor: Software Toolbox
Application: Visual Basic development
Price: $1,195 US