Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Use of EasyDAClient throws VS 2017 exception

More
16 Jan 2018 06:57 #5871 by support
Applications that use QuickOPC should not reference OpcNetApi, OpcNetApi.Com or OpcNetApi.Xml at all, in the first place.

And, the warnings that you get list version numbers of these libraries that we do *not* distribute. So you need to prevent your app from using the incorrect versions you have somehow gotten into your computer and your projects. That's up to you.

Second, the warnings also show that you are probably referencing assemblies App_Web_OpcLabs*.dll. If so, remove these references as well.

Best regards

Please Log in or Create an account to join the conversation.

More
15 Jan 2018 19:59 #5868 by support
I cannot really tell because I cannot reproduce these problems. It all starts with the issues with the .licx file: Normally it should not be deleted (and should not cause any error); I only recommended to delete it because it is not necessary, and therefore it was a possible way of working around the issue.

Do you still get the *precisely* the same error when the .licx file is present? I am asking because in the original post, the error text contained an indication that somehow, your project loaded a supporting library that we also use - but a different version of it. This could indicate that either you have some unnecessary (and, actually, harmful, in this sense) assemblies into your References, or that they have loaded due to some other mixup. Make sure you clean everything well before making new attempts.
The following user(s) said Thank You: bobday

Please Log in or Create an account to join the conversation.

More
15 Jan 2018 19:46 #5867 by bobday
The documentation from Parker specifically states an OPC Server exists on the PAC Controller. This mislead me. Apparently when the development software is installed on the PC it also installs an OPC Server on the PC at the same time. This was not clear in there documentation.

Now that we have solved this problem, I have hit another obstacle. When I Instantiate the EasyDAClient it creates the licenses.licx file. Then when I delete the .licx file, my form Designer disappears. Then when I select View->Designer, I get a new tab labeled Resources.resx. This tab contains a table with one record containing "String1".

I do not have this problem with DAConnectivity, nor did I have this problem on earlier tries with EasyDAClient.

How do I get the Form Design back?

Please Log in or Create an account to join the conversation.

More
13 Jan 2018 14:51 - 15 Jan 2018 16:31 #5863 by support
I cannot tell with certainty, but I think you misunderstood the way the pieces are connected together. Here is how I think it looks like:

The PAC controller has IP 192.168.2.82, but it is *not* an OPC Server.

You then have CoDeSys OPC Server on the same machine as your OPC client. The CoDeSys OPC server connects to the PAC controller. But your OPC clients connects locally to the CoDeSys OPC server, and the location of the controller is irrelevant to the OPC client.

This way, there is no remote connection between the OPC client and OPC server - they are both on your PC. And no DCOM is involved. This means that the first argument to the method call really *should* be empty. You cannot connect directly to the PAC controller, because it has no OPC server directly in it.

Best regards
Last edit: 15 Jan 2018 16:31 by support.

Please Log in or Create an account to join the conversation.

More
13 Jan 2018 14:43 #5862 by bobday
The OPC server resides on a Parker PAC controller with its own IP address. The Client resides on my laptop with a different IP address.

Parker requires that the box with the OPC client have an .ini file specifying the IP address of the OPC server and some additional params. Perhaps this is a different architecture than other products.

File: C:/ProgramData.CoDeSysOPC.OPCServer.ini

[Server]
Version=0x3050900
updaterate=200
logevents=1
logfilter=15
syncinit=1
ReadCyclesAfterWrite=0
UseColonAsPlcDevider=0
GroupUpdateBehaviour=0
PLCs=1
PLC0=PAC

[PLC:PAC]
interfacetype=GATEWAY3
reconnecttime=15
waittime=10
active=1
logevents=1
logfilter=15
gateway=Tcp/Ip
gatewayaddress=localhost
gatewayport=1217
parameters=1
parameter0=IpAddress
value0=192.168.2.82

[Redundancy]
NumOfGroups=0

Please Log in or Create an account to join the conversation.

More
13 Jan 2018 08:23 #5861 by support
The first argument denotes a computer where the OPC server runs.

It can be empty if you want to connect to a local OPC server, i.e. an OPC server that resides on the same box as the OPC client (your app).

If that's what you want, then it is OK to leave it empty. I was under impression that your OPC server is on a computer different from where the OPC client is. When it is not empty, even if it is the IP address or name of the client computer, it always goes the "DCOM" (remote-like) way, with all the configuration hassles.

Please Log in or Create an account to join the conversation.

More
12 Jan 2018 23:28 #5860 by bobday
I tried everything suggested in your last post, but still no luck.

I then removed the IP address from the first param and tried to run again with an empty string for the param. It now works just fine, this solved the problem.

Is this OK to do it this way?

Please Log in or Create an account to join the conversation.

More
10 Jan 2018 06:46 #5850 by support
The warnings should be benign and not related to the other issue. They probably appear because you have referenced more assemblies than needed: For this kind of project, you should be fine referencing just OpcLabs.BaseLib and OpcLabs.EasyOpcClassic and nothing else. See opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...%20Assemblies%20Available.html , opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...%20Assembly%20Referencing.html , opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...Visual%20Studio%20Toolbox.html . As far as I can tell, you have even referenced assemblies that have nothing to do with our product. We have similar assemblies, but not of that version and processor architecture that is listed in the warning. You should remove the unnecessary assemblies from the project references.

To the actual issue: The method has thrown an exception, that is not called a hung. Exceptions are how the ReadItem or ReadItemValue signalizes errors, so in some respect that are normal and should be expected. A production-ready code should have a try-catch block around these methods, and catch exception of type 'OpcException'. See e.g. opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...eption%20or%20UAException.html .

The exception tells you that the details are in its InnerException, so that's what should be inspected, but I can tell from the error code (0x800706ba) that the innner exception says "The RPC server is unavailable.". This is an error that comes from the DCOM infrastructure (Microsoft), which is what OPC Classic uses for inter-machine communication. There can be many causes for this error, but first things to check are 1) whether the IP address is correct, 2) whether DCOM is enabled on the target computer, 3) whether the firewall on the server (or client) computer does not block DCOM communication (this is not a single port, but a port + a range of ports), 4) whether OPCEnum service is running on the server computer. See e.g. www.opclabs.com/resources/technology-opc/opc-videos/opc-dcom . The screenshots from Connectivity Explorer appear to be ran on the same computer as where the server is, so that may work, but a comparable test to what your code does would be to run the Connectivity Explorer on the computer where your run you code-based test, select the "Any COmputer" node and then add a computer node with the same IP address.

Best regards

Please Log in or Create an account to join the conversation.

More
10 Jan 2018 03:05 #5849 by bobday
I made the changes and tried to Build, but threw 4 warnings. see Snap85.png
Tried x86, x64 and all, but still had errors.

I then ran program with break point on first line, but program hung on that line.

Then tried to run without break point and threw exception. see Snap86.png
Attachments:

Please Log in or Create an account to join the conversation.

More
09 Jan 2018 21:56 #5848 by support
Please change
textBox1.Text = easyDAClient1.ReadItem("192.168.2.82", "CoDeSysOPCDA", "PAC.Application.GVL.MyString").ToString();
to
DAVtq vtq = easyDAClient1.ReadItem("192.168.2.82", "CoDeSysOPCDA", "PAC.Application.GVL.MyString")
textBox1.Text = vtq.ToString();

and inspect the value of 'vtq' between the first and second line.



regards

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.072 seconds