Read 800xA Tag.Value via OPC
Which is the correct sintax to use on a VB6 code to read the value of a tag using the OPC (afwdsopcsurrogate.1).
- How to open the OPC
- How to read a specific tag.value
- How to close the OPC
See this as an VB6 embryo to read one property off one object using Aspect Automation Model in a client or server node with 800xA installed.
First enable the Aspect Automation interface in your VB project:
References: Aspect Automation 1.0 Type Library
Then put this code into a pushbutton, etc.
Private Sub Form_Load()
Dim systems As New ABBSystems
Dim system As ABBSystem
Dim object As ABBObject
Dim property As ABBProperties
Set system = systems.DefaultSystem
Set object = system.object("51-CPULOAD")
Set property = object.Properties
MsgBox property("Control Connection:VALUE")
The code will read VALUE of Control Connection on an object named 51-CPULOAD (similar to subscribe to the item "51-CPULOAD:Control Connection:VALUE" in an OPC DA Client).
This code has lots of overhead and is really only suitable for reading one property.
If you need to read multiple properties from a multitude of objects there are several shortcuts you should take to avoid overhead (all New and Set will cost a lot of execution time and there are shortcuts to take if you need to read many properties).
I think you deallocate by using Set xxx = nothing or use Erase xxx.
If you can still find a copy, the manual you want is 3BSE 024 835 R301 - Aspect_Integrator_Platform_2.1_-_Automation_Models_-_Programmer_s_Guide
It is quite an old manual and is written for PPA version 2.1 , but the Object Automation model has not changed so the information is still valid. Unfortunately, ABB do not seem to have updated or publicly re-released this manual for newer versions of 800xA. I think you can probably still get this manual on SolutionsBank.
If anyone else knows of a newer version of this manual I would appreciate a hint on where to find it.