OPC Data Access 2.05

A

Thread Starter

Anonymous

Can anyone provide me with a snippet of VB code showing how to do a Synchronous (and/or Asynchronous) Write following the DataAccess Specification 2.05. I just need to know how to Add Items to a Group and Write the items in one transaction. Thanks.
 
<p>The download at the opc foundation titled OPC Data Access Automation Spec. shows VB6 code snippets on how to carry out all the functions.

<p>Here are some vb.net snippets:
<pre>

Myserver.Connect(ServerName)

Dim tmpg As Object = Myserver.OPCGroups

Mygroups = CType(Marshal.CreateWrapperOfType(tmpg, GetType(OPCAutomation.OPCGroupsClass)), OPCAutomation.OPCGroupsClass)

tmpg = Nothing

Mygroup = CType(Mygroups.Add("Values"), OPCAutomation.OPCGroupClass)

Myitem = Mygroup.OPCItems.AddItem(MachineName & "." & TypeName & "." & ValueName, 1)

myitem.Write(Formatted_Value)

</pre>
<p>Hope this helps!<br>
Gerry
 
I've just built some examples using Rockwell Software OPC server. I started with their example client, but:

Search ab.com or rockwellsoftware.com for RSIOPCDemo.zip(?) or partialdemo1.zip

They have a few good pdf files for guidance.

Mike.
 
I have used the Kepware VB examples in two of my OPC projects. They had an simple example that does exactly what you are looking for and they had a much more advanced example that even showed how to do tag browsing. Its all done in VB code with a lot of comments. Way more comments than I would normally put in my own code. The examples were in their download package. I don't think they provide them separately on the wb site.
 
Top