ksona


I am trying to develop an opc - da client using .net technology.
Have gone through the documents on opc and opc client and all,
but am still not sure how to implement it, can someone give me a direction on how to start with it



Re: opc

MS ISV Buddy Team


can you please provide some additional details on exactly what you're trying to do and any other relevant info that I can pass on to our support engineer

thanks,

-brenda (ISV Buddy Team)







Re: opc

Manny M

Hey Ksona,

I was just speaking to a college of mine about DA cleints this morning. Have your checked out the OPC Exchange at http://blog.matrikonopc.com/

I know that Eric Murphy is an OPC genius, and he can probably give you a hand, or point you in a great direction.

You can also email me and I can see if one of my college's has some time to help you out I'm curious as to what devices you are trying to access






Re: opc

Eric Murphy

Genius That's a wee bit over the top, let's just say I've experienced a thing or two about OPC. However, if you're fishing for a response, flattery will get you everywhere :)

As the other replies pointed out, the question is a bit open ended. 'using .NET technology' offers a few possibilites, depending on your develpoment language C#, VB.NET, managed C++, etc.

The easiest way, would be to make use of the OPC Client .NET wrapper supplied by the OPC Foundation. You do have to be a member to access this, however that offers other advantages such as invitations to the OPC Interoperabilty events to test your client against other vendors.

If that's not an option, I have seen VB.NET applications that make use of the OPC Automation dll. This was originally intended for VB apps, but some vendors have upgraded the automation interface to work with VB.NET You would have to ask specifically because not all versions do.

Otherwise, you are looking at writing an application that interfaces to unmanaged COM interfaces. From an programatic point of view, an OPC client would be no different from any other COM client. If you're new to OPC, this is not a trivial task...






Re: opc

Uglydragon79

Hey Ksona,

I agree with what Eric Murphy said, that your best bet is to get the libraries off of the OPC Foundation's site. But you might want to try Visicom's excellent .NET interface library here:

http://www.codeproject.com/dotnet/opcdotnet.asp

Again, do not assume that this is of any commercial quality & stability, you're best option is to get the OPC Foundation's.

Hope this helps!

Steve





Re: opc

Smithy196

Hi Eric,

Sounds like you know what you're talking about ... Can I also butter you up and find out if you know anything about using an OPC interface in VB.NET that was designed for VB6. The problem is the RSiOPCAuto.dll that Rockwell use to interface to their OPC server (RSlinx). It only accepts Arrays with lower bounds of 1 which is not possible in VB.NET. (see refs below)

1) http://www.control.com/1026218609/index_html

2) http://www.control.com/1026222355/index_html

I only dimly understand the article on http://www.codeproject.com/dotnet/opcdotnet.asp. It seems to be saying that if I was using VC++ I could write some kind of code which would make be able to use the OPC interface which was COM and written for VB6. If I was using C++ I'd be laughing.

I'm not. :-)... and while the C++ is interesting and gives me hope, I'm working with VB.NET and I'm still trying to figure out how I can use the OPC interface designed for VB6 with VB.NET. Why do I even need RSiOPCAuto.dll If OPC is a standard, can I not just use any OPC interface and hope that RSLinx (the Rockwell OPC server) answers with the right data Is there not a "General" OPC interface dll

Puzzled from Leicester

Andrew Smith

andrew.w.smith|at|severntrent.co.uk






Re: opc

perrakus

You can use vb.net or c# with rslinx's COM dll.

You just add the reference to RsiOPCAuto.dll to your project and use its classes.

To pass an array to a OPC method, just dim the array to n+1 and fill it starting at index 1.
The method will return object arrays that you will read starting at index 1.
You have to cast to the specific types to get the values.

Excuse me for my bad grammar.

I hope this helps.





Re: opc

rtmurray

I was looking for some help developing a C# OPC client using the OPCAutomation wrapper when I stumbled upon your conversation. Here is a link to a VB.Net sample OPC client that helped shed some light on using .Net to develop OPC clients using the wrapper.

http://www.kepware.com/Temp/Simple_VB_dot_Net_OPC.zip




Re: opc

ksona

Thanks Everyone,

Right now, i am using Advasol http://www.advosol.com/ opc client components for my opc client development. It looks ok till now :)





Re: opc

Eric Murphy

Andrew,

Perrakus is correct in his discription on using the Automation dll with VB.NET.    Once you add the reference, you can access all the classes just like in VB6.    Since VB.NET doesn't seem to support the 'Option Base 1' you will have to handle the offset yourself.

A little bit of background on the Automation wrappers.   There actually is a "General" OPC interface dll.   It's called the Automation Wrapper, or OPCDAAuto.dll.     When the first OPC DA specifications were released, the OPC Foundation did not wish to support complied applications, so the source code for the OPCDAAuto.dll was supplied to all OPC members.   Each vendor then recompiled the code under their own GUID (Rockwell renamed it RSiOPCAuto.dll).    In November of 2005, the OPC Foundation decided to take the responsibility of maintaining various applications  (DA Wrapper, Compliance tests, proxy stubs etc).    All the bug fixes various vendors had applied over the years was compiled and the OPC Foundation released the 'official' OPCDAAuto.dll v2.02.    Many vendors already were supporting 'their' wrapper so continue to ship the vendor branded version.    

Version 2.02 of the automation wrapper has been tested with VB.NET on Win2000 and WinXP.   You can read the details on the Foundation website at

http://www.opcfoundation.org/DownloadFile.aspx/Data%20Access/OPC%20DA%20Auto%202.02%20Source%20Code%205.30.htm RI=306

If you are an OPC Foundation member you can download the files directly.   If you are an end user, you need to get the binaries from your OPC Vendor  (I assume it's Rockwell in your case)

Cheers and Good Luck.

Eric

 






Re: opc

leandro_

When i try add an Opc group, i get te following error message:

Opc Server add group failed with exception: Unable to cast object of type 'OpcAutomation.OpcServerClass' to type 'OPCAutomation.IOpcGroups'

Does anyone help me




Re: opc

perrakus

Post your code here to have a look at it, leandro

Are you using a reference to COM OPC

Altough the exception is very clear.




Re: opc

MartinBrasil

I have the same problem .I am using this sample code ( http://www.faweb.net/us/opc/sample_vbnet.html) Does anybody have a solution for this




Re: opc

perrakus

The link you posted doesn't work.

Post the code in this forum.




Re: opc

MartinBrasil

Sorry , this one should work

http://www.faweb.net/us/opc/sample_vbnet.html

Here a sample of the code:

'--- connect OPCServer

OPCMyServer = New OPCAutomation.OPCServer

OPCMyServer.Connect(txtSvrName.Text, "")

OPCMyGroups = OPCMyServer.OPCGroups ' !!!!!!!!!!!!! << The problem happens in this line

OPCMyGroup = OPCMyServer.OPCGroups.Add("Group1") ' OPCMyGroups.Add("Group1")

OPCMyGroup.UpdateRate = Val(txtUpdateRate.Text) ' UpdateRate is 1000msec

OPCMyGroup.IsActive = False

OPCMyGroup.IsSubscribed = OPCMyGroup.IsActive

OPCMyItems = OPCMyGroup.OPCItems