Quantcast
Channel: OPC Labs - OPC Labs - Recent Topics - OPC Labs Online Forums
Viewing all 1794 articles
Browse latest View live

How to create and write a simple complex type - by: RND

$
0
0
We hoped to use a structured type as an argument for method calls. We created a variable of that type to read and write for testing. We can browse and read the variable. We can use the OPC UA Complex Data writing example in the documentation to write one of the primitive data members in the variable after first reading it. But, we have been unable two find a way to write the variable as a single write. That would be necessary if using a complex type as a method call argument.

The PLC is Beckhoff with the Beckhoff OPC Server. The simple type is shown below.


We've tried several ways to construct an acceptable complex type variable to write with no success. It seems that we are unable to make the library aware of the type of the complex object being written Our common error message has been some form of this:



Browsing the nodes in the code, from Connectivity Explorer or UAExpert all seem to identify the type easily. We see 2 different nomenclatures for the type depending on the method for browsing it as:

We have tried some different code snippets to construct an object instance to be written with the code below as the latest, but in no case can we seem to be able to properly specify the type of the object being written based on the exceptions we are seeing. For Full Name of the data type, we have tried all of the above and many more.


Can you see any fundamental error in understanding we may have in using the library?

Thank you. We tried to include a few details that might show our missteps.

OPC hangups and handle leaks - by: jrcody38

$
0
0
Hi,

We are using the following setup.

OPC Quick Client v5.35.1173.1.
Wonderware inTouch for HMI
.NET Windows Forms application which references OPC Quick client.

We have been noting regular performance issues in production. Every two weeks or so, performance degradation is noted which leads to OPC event processing hang-ups in our .NET application we end up having to restart it.

What we have also noted is that there seems to be a handle leak stemming from use of the EasyDAClient object we use. From analysis, these leaks are coming from abandoned Mutex objects somewhere within the OPC code or in a dll which you use. This seems to conform to the below article.

www.opclabs.com/forum/general-issues/2123-handle-leak-memory...ing-opclabs-easyopc-dataaccess

The performance issues and hangups are quite subtle at times and sometimes our logs don't seem to give us too much information even though the performance of the system has significantly slowed and we need to restart it. I have provided some sample logs for you to assess. I have some questions in this regard:

1) Are the OPC client errors we are seeing directly related to the handle leak?
2) if not, can you provide any insight on the exception in question?
3) Are there any established symptoms of the handle leaks associated with the above referenced article on the leaks?


Attachments:
Sample OPC Client error message
Sample handle count snapshot of application. (Without handle leak it should run at about 500-600 handles).
Sample Mutant handle creation from Process Explorer
Sample abandoned Mutex information from WinDbg



Thanks,

Johnny

Get event state during event handling - by: KrisSik

$
0
0
Hi,

I am trying to get event's active/inactive state in the OpcClientOnEventNotification(object sender, EasyUAEventNotificationEventArgs e) event handler, but have no success in that, could you please help me?

I was expecting to see that attribute in the e.EventData.FieldResults, but that is not present in this dictionary. Maybe I need to configure the select clause while subscribing? For subscription I use SubscribeMultipleMonitoredItems method.

Best regards,
Kristian

Handle Leak / Memory Leak using OpcLabs.EasyOpc.DataAccess - by: JV

$
0
0
We encountered a handle leak/memory leak using OPCLabs QuickOPC DA in .NET.
The code is written in VB.NET.
Once we reference "OpcLabs.EasyOpc.DataAccess" anywhere in the code (instantiating a "EasyDAClient" of even just setting a parameter) the standard timer "System.Threading.Timer" starts leaking handles about linearly with the timer-frequency.

To observe the problem I stripped the application to the bare foundations.
The timer calls a sub that only executes:
Console.WriteLine("HandleCount: " & System.Diagnostics.Process.GetCurrentProcess().HandleCount)

Nothing else, but it there is still a handle leak implying a memory leak (resulting in 100% RAM usage after a while).

Is there any known issue with this?

You will find the stripped down version of the code in attachment + a screenshot of the referenced dll's.
There is no handle leak if everything reffering to OPCLabs is commented out.
Once any of the OPCLabs-lines is enabled again the memory/handle leak appears.
(e.g. line 15, 16, 23 ,24 or 25)

I use QuickOPC-5.35 (specifically build 5.35.442.1)
(A valid license was obtained for QuickOPC 5.22-5.3x Standard, with maintenance untill 23-11-2017)

Testing Demo version with Xojo - by: Sacha

$
0
0
I am testing the OPC client with Xojo through COM.

Everything works fine but I can't read the ID Tag collection because the method GetEnumerator gives me NIL. The other methods like Count returns correct values.

Why ?

PS: The Object is: OpcLabs.EasyOpc.DataAccess.AddressSpace.DANodeElementCollection

Best Regards

Sacha

Update to Version 2020.2 - by: Enrico

$
0
0
Hello,

I updated from version 2018.3 to version 2020.2. With version the 2018.3 the connectivity explorer was running fine (even today). After the update I get the following error message (see attachment) when trying to start.

I checked the current .net version. Shouldn't be a problem. See the attachment.

I also attach the setup log, I don't see any obvious problems there.

Any idea?

All the best from sunny Bremen

How to call a method with complex type arguments - by: cadomanis

$
0
0
This is something of a follow-up to the issue in How to Create and Write a Simple Complex Type .

We are trying to call a method on the server which uses a complex type as the first argument. The code we are trying is as follows:


when attempting to execute that block, there is always an exception thrown when the CallMethod tries to happen. Exception is a System.ArgumentException:



We have had plenty of success calling methods on the server that only take simple types as the arguments. Wondering if there is something you can pointto in our code on what might be causing these issues.

Thanks

Online help - Quick response - by: Enrico

$
0
0
Hi,

sorry I didn't find the right category. It's about the quick response in the forum. When I use the 'quick response' to answer and press the 'submit' button when I'm finished, I end up on a page that ask me for further detail my search. Which seems to be strange and also my response is not submitted. I tried this from two different computers, the same behaviour.

All the best

How to call a method with complex type arguments - by: cadomanis

$
0
0
This is something of a follow-up to the issue in How to Create and Write a Simple Complex Type .

We are trying to call a method on the server which uses a complex type as the first argument. The code we are trying is as follows:


when attempting to execute that block, there is always an exception thrown when the CallMethod tries to happen. Exception is a System.ArgumentException:



We have had plenty of success calling methods on the server that only take simple types as the arguments. Wondering if there is something you can pointto in our code on what might be causing these issues.

Thanks

Exceptions calling CallMethod - by: sjscheider

$
0
0
We have code that has been running for 6+ months that using CallMethod() to call a method on the OPC-AU server. Recently we received a new version of the OPC-UA server and now the call fails using the same code as before. If we attempt to make the call in UaExport, the method works on the old and the new OPC-UA server. So I'm wondering if there is something that I'm going wrong.

All 3 of the calls work against the old server. All of these call are calling the same method just with different parameters.


On the new server, if I run the first option, I get the following exception:


With the 2nd and 3rd, I get this exception.


The signature of the method is the same on both servers. The code is identical.

Can you shed some light on what these exceptions mean? Do you have any suggestions on what the issue may be? Do you have any documentation on what the 2 parameters 'objectNodeDescriptor' & 'methodNodeDescriptor' should be? I looked and didn't see anything that made it evident to me what these values need to be.

Any help you can provide is greatly appreciated.

Mapping ( and Reading) objects within arrays using BrowsePaths - by: cadomanis

$
0
0
I am experiencing issues when trying to use mapping with object that are contained within an array in the server. In my testing, I found I was having similar issues simply trying to read those same variables. Through the simplified read testing, I believe it may have to do with the [] characters needed for the array index when used in the browse path. I have tried escaping those characters, but end up with the same result. As the read example seems easier to follow, I thought I would post those results and am hoping they would help with the mapping issues as well.

The server setup for these tests is illustrated in the attached ServerConfig.png3. This is the same server reference in the Calling Methods with complex types that you resolved so quickly, and should still have access to if needed. The following is the code I have been testing with:

As written, all of the variables will return good results. Note the first ReadArgument is using a string NodeDesciptor as opposed to the BrowsePathParser. If I change the code to use the BrowsePathParser that is commented out ( and comment out the node desciptor string), I get the following exception thrown:


What is unclear to me is that the two different methods seem to result is what I understand to be equivalent results when I look in readArgumentsArray and inspect the Node Descriptor
Results when using the BrowsePathParser:

Results when using the NodeDesciptor string:


To try and help confirm this, I made an instance of an identical object not contained in an array. This is the second item in the readArgumentArray. This always works with the BrowsePathParser with good result and a Node Descriptor of:


As I will eventually be trying to look at these variables through LiveMapping, I believe that I need the BrowsePath approach to make that work? I have been successful in attaching and reading with a Mapper on the object not in the array - [ObjectsFolder]/PLC1/OpcCommunication.OpcEffect.stStatus - but have had similar problems in the mapper as in the read example above with the objects in the array.

Any help or suggestions are greatly appreciated. We are really hoping there is a way to use the array version of the variables.

AMapping ( and Reading) objects within arrays using BrowsePaths - by: cadomanis

$
0
0
I am experiencing issues when trying to use mapping with object that are contained within an array in the server. In my testing, I found I was having similar issues simply trying to read those same variables. Through the simplified read testing, I believe it may have to do with the [] characters needed for the array index when used in the browse path. I have tried escaping those characters, but end up with the same result. As the read example seems easier to follow, I thought I would post those results and am hoping they would help with the mapping issues as well.

The server setup for these tests is illustrated in the attached ServerConfig.png3. This is the same server reference in the Calling Methods with complex types that you resolved so quickly, and should still have access to if needed. The following is the code I have been testing with:

As written, all of the variables will return good results. Note the first ReadArgument is using a string NodeDesciptor as opposed to the BrowsePathParser. If I change the code to use the BrowsePathParser that is commented out ( and comment out the node desciptor string), I get the following exception thrown:


What is unclear to me is that the two different methods seem to result is what I understand to be equivalent results when I look in readArgumentsArray and inspect the Node Descriptor
Results when using the BrowsePathParser:

Results when using the NodeDesciptor string:


To try and help confirm this, I made an instance of an identical object not contained in an array. This is the second item in the readArgumentArray. This always works with the BrowsePathParser with good result and a Node Descriptor of:


As I will eventually be trying to look at these variables through LiveMapping, I believe that I need the BrowsePath approach to make that work? I have been successful in attaching and reading with a Mapper on the object not in the array - [ObjectsFolder]/PLC1/OpcCommunication.OpcEffect.stStatus - but have had similar problems in the mapper as in the read example above with the objects in the array.

Any help or suggestions are greatly appreciated. We are really hoping there is a way to use the array version of the variables.

Version differences - by: ted

$
0
0
Trying to evaluate QuickOpc on Windows / Net Core 3.1.201 / Rider 2020.1
I ran the QuickOpc installer and unpacked the examples fetched from
opclabs.doc-that.com/files/onlinedocs/QuickOpc/2020.2/User%2...NET%20Standard%20Examples.html
"C# examples for .NET Core". This is the build output: (see below)
The problem seems to be that the project expects version 5.58.184, but Nuget only has 5.58.151.
After downgrading to 5.58.151 I can run both "MultiTargetDocExamples" and "MultiTargetUADocExamples"
However, the last one, after choosing point 1 (Main), then point 1 (UADocExamples._EasyUAClient.BrowseDataNodes.Overload1"), it crashes with this error:
Where should this dll be installed from?
Goal is to the the communication going using the OPC-UA Demo Publisher 5.58.184.1


Update to Version 2020.2 - by: Enrico

$
0
0
Hello,

I updated from version 2018.3 to version 2020.2. With version the 2018.3 the connectivity explorer was running fine (even today). After the update I get the following error message (see attachment) when trying to start.

I checked the current .net version. Shouldn't be a problem. See the attachment.

I also attach the setup log, I don't see any obvious problems there.

Any idea?

All the best from sunny Bremen

AMapping ( and Reading) objects within arrays using BrowsePaths - by: cadomanis

$
0
0
I am experiencing issues when trying to use mapping with object that are contained within an array in the server. In my testing, I found I was having similar issues simply trying to read those same variables. Through the simplified read testing, I believe it may have to do with the [] characters needed for the array index when used in the browse path. I have tried escaping those characters, but end up with the same result. As the read example seems easier to follow, I thought I would post those results and am hoping they would help with the mapping issues as well.

The server setup for these tests is illustrated in the attached ServerConfig.png3. This is the same server reference in the Calling Methods with complex types that you resolved so quickly, and should still have access to if needed. The following is the code I have been testing with:

As written, all of the variables will return good results. Note the first ReadArgument is using a string NodeDesciptor as opposed to the BrowsePathParser. If I change the code to use the BrowsePathParser that is commented out ( and comment out the node desciptor string), I get the following exception thrown:


What is unclear to me is that the two different methods seem to result is what I understand to be equivalent results when I look in readArgumentsArray and inspect the Node Descriptor
Results when using the BrowsePathParser:

Results when using the NodeDesciptor string:


To try and help confirm this, I made an instance of an identical object not contained in an array. This is the second item in the readArgumentArray. This always works with the BrowsePathParser with good result and a Node Descriptor of:


As I will eventually be trying to look at these variables through LiveMapping, I believe that I need the BrowsePath approach to make that work? I have been successful in attaching and reading with a Mapper on the object not in the array - [ObjectsFolder]/PLC1/OpcCommunication.OpcEffect.stStatus - but have had similar problems in the mapper as in the read example above with the objects in the array.

Any help or suggestions are greatly appreciated. We are really hoping there is a way to use the array version of the variables.

Timeout error - by: chrisachern

$
0
0
Hello,

i have an simple service with an EasyUAClient version5.51.465.1.

There is a timer which reads value each 60seconds. The code looks like this.


Sometimes after a while, i get the following error message and the service stops writing the values to the database. What can i do to solve the problem?

Timeout connecting the OPC-UA client session. The total timeout value was 60000 milliseconds, and we have waited for 0 milliseconds. The actual waiting time is lower than the total timeout (or even zero) if the connection operation has already started earlier.

Best Regards,
Chris

Using CallMethod in VBA - by: gkalipershad

$
0
0
Hello,

I am working with a customer who is using methods in OPC UA. Initially, we had tried to steer him towards the Excel Add-In, but he preferred to work with VBA due to comfort. This issue is the only thing holding up a license purchase. They are testing with 2020.2.

One of the UA Methods that the customer is using does not have any InputArguments, and therefore, I would expect them to use the overload that omits the input and type, since they are optional arguments. However, in VBA, when these are omitted, we see an "Argument not optional" error.

docs.microsoft.com/en-us/office/vba/Language/Reference/User-...rgument-not-optional-error-449

So my question is, how do we declare arguments of the CallMethod function as optional when the function is not user-defined? Alternatively, is there a way to pass null entries instead?

The customer does have other UA Methods that include inputs, so he does have arrays configured for the inputs and typeCodes. One thing that I suggested he try is include "inputs(0) = False" and "typeCodes(0) = 0 'TypeCode.Empty" as part of his arrays and pass those as the arguments, but that results in the attached error.

Any help would be much appreciated.

XML-DA. Subscription is canceled unexpectedly - by: Andriy

$
0
0
Hi,

While investigating a communication between my application and Siemens OPC XML-DA Gateway server, I found a lot of subscription cancellation requests. They happen immediately after receiving a response to the subscribe request . The response of the OPC server is very slow. I don't know what is wrong. Could you help me?

QuickOPC 5.58.151
Isolated = true
IsolatedParameters.UseAdvancedPolledRefresh = false

1. Subscribe request


2. Subscribe response


3. Next 2 telegrams are related to "GetStatus" call

4. Subscription cancel request

XML-DA. Change subscribe parameters - by: Andriy

$
0
0
Hello,

Is it possible to set "RequestedSamplingRate" , "SubscriptionPingRate" attributes of a Subscribe request and call SubscriptionPolledRefresh at a rate different from a value of "SubscriptionPingRate"?
e.g RequestedSamplingRate = 2000 ; SubscriptionPingRate = 10000; call SubscriptionPolledRefresh each 5 sec

Regards

Trying out Live Binding - by: Plcjc

$
0
0
Hello I have downloaded the trial to connect to my server (Kepware) to verify operation. How can I make the Point editor in my Visual Basic(2019) have the any host or double click to add endpoint like it does in the connectivty explorer ? or how can I add my endpoint to the well know like your demo server is there.

Thanks
Viewing all 1794 articles
Browse latest View live