Integrating VB6 and OPC
QuickOPC is a set of components that simplify the task of integrating OPC client functionality into custom applications. Reading a value from OPC Data Access or OPC Unified Architecture (OPC UA) server, or writing a data value can be achieved in just one or two lines of code!
QuickOPC is a radically new approach to access OPC data. Traditionally, OPC programming required complicated code, no matter whether you use OPC custom or automation interfaces. OPC Server objects must be instantiated, OPC Group objects must be created and manipulated, OPC Items must be added and managed properly, and subscriptions must be established and maintained. Too many lines of error-prone code must be written to achieve a simple goal – reading or writing a value. QuickOPC saves you all that hassle.
- New: QuickOPC now also supports OPC UA Alarms&Conditions.
OPC Code Samples in Visual Basic 6.0
' Read item value and display it in a message box
Dim Client As New EasyDAClient
MsgBox Client.ReadItemValue("", "OPCLabs.KitServer.2", "Demo.Single")
Do you think it can be any simpler? But the simplicity is not the only advantage; the component is also very powerful. Using complex heuristic algorithms to optimize itself on the fly, it provides the most efficient, fastest access to the OPC data.
Application-side subscriptions are possible, too. The VB6 examples for that are included with the product.
It is also easy to communicate with an OPC Unified Architecture (OPC-UA) server:
' Read node value and display it in a message box
Dim Client As New EasyUAClient
MsgBox Client.ReadValue("opc.tcp://opcua.demo-this.com:51210/UA/SampleServer", _ "nsu=http://test.org/UA/Data/;i=10853")
The PubSub variety of OPC UA (as opposed to client-server) uses message-oriented middleware to deliver the data. QuickOPC supports it as well. Code example is available in the documentation, and installed with the product.
Footnote & required disclosure: QuickOPC (including its Options) is a software development kit (SDK) for development of OPC clients. Installing QuickOPC or its Options does not change system settings.