05-27-2011 06:20 AM
Hi,
I am trying to link boolean buttons on a Labview front panel to items on an OPC server. (I am running LabVIEW Professional Develompent System version 9.0)
I am hoping to use Labview as a client for a SCADA application for a customer.
I can browse to, and see all of my OPC tags when using the Datasocket as the method of Data Binding.
When I run the VI, I can see a red indicator beside the buttons on the front panel, giving the following error message: "Error: Can't add item to OPC Group."
I have tried several other OPC test clients to test if the problem is with the server or the client. I have been able to add (and read/write) the items in every test client that I have tried, apart from Labview.
I did note however that I had to define an access path for the OPC items when using a Kepware OPC Quick Client, otherwise they would not add. I am guessing that I may have to do the same in LabVIEW, but I cannot figure out how to do this.
Can you please advise.
Thank you.
Solved! Go to Solution.
05-27-2011 07:27 AM
Could you post a snippet/example of how you are addressing the opc server?
I have always had success like this:
05-27-2011 08:36 AM
Hi Ed,
Thanks for your reply.
Below is an example of how I am addressing the OPC server. It is running on the local machine. I was able to browse for, and see the tag shown below.
I am simply tring to link boolean buttons to the specific tags. (See below)
I also tried doing it using your soultion below, but had no luck. I received the error message "Err (42)" after the Datasocket Open function.
I am really puzzled because I can browse all of the tags on the server, but it just will not connect to them properly.
Any more advice would be greatly appreciated...
06-01-2011 04:55 AM
Hello SysEng123,
I would like to try and help you with your issue. Please answer the following questions:
Best Regards,
06-01-2011 05:10 AM
Error 42 is usually returned when LabVIEW can't find the location.
Looking at the path in you last post, opc:/ is with a single forward slash, and I have never seen commas in an address before.
Try running this snippet, and try browsing to the opc item to see what its address is. Then try talking to it with the code in my first post. If all is good, then try binding it.
06-01-2011 05:20 AM
06-01-2011 06:41 AM
06-01-2011 02:24 PM
What is the OPC version of the server you're trying to connect to?
For versions 2.x and below, you can only write a LabVIEW client using Data Socket.
For version 3.0, you can only only write a LabVIEW client using the DSC module.
See more here.
06-01-2011 05:02 PM
Thanks for the info. I had actualy heard that before. I know that the server did work with OPC clients that only supported OPC 2.0 because I tested this, so therefore I presumed it would work with Labview.
However, after further investigation into this problem I have since found out that there is a known bug with the version of OPC server I am using and Labview. I suppose this explains all the problems I was having.
Thanks for all the replies.