Integrating VB6 and OPC
Are you having difficulties incorporating the OPC data into your VB6 solution? Need to create an OPC VB6 program quickly and in quality? If so, QuickOPC comes to the rescue. (VB.NET users click here)
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 also supports OPC UA Alarms&Conditions and OPC "Classic" Alarms&Events.
OPC Code Samples in Visual Basic 6.0
QuickOPC is easy to use - here is a VB6 example which reads and displays OPC data from 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")
Application-side subscriptions are possible, too. The VB6 examples for that are included.
It is also easy to communicate with an OPC "Classic" (Data Access) server:
' Read item value and display it in a message box
Dim Client As New EasyDAClient
MsgBox Client.ReadItemValue("", "OPCLabs.KitServer.2", "Demo.Single")
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 examples are available in the documentation, and installed with the product.
Useful links: VB6 Examples / VB6 in Knowledge Base / VB6 examples GitHub repository
