Professional Communication
Software 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.

Allen Bradley & Kepware UA Client sample for C# Winforms

More
10 Oct 2025 14:28 #14406 by support
Hello.

Ad 2. QuickOPC *does* support complex data types. If you are getting null reading CYCLE_COUNT, but no error, then most likely Kepware does not expose CYCLE_COUNT as a structure. There are multiple ways to confirm this. For start, do you have UaExpert? If you can read CYCLE_COUNT using UaExpert as a single structure value, then we need to look into why QuickOPC does not do it. But, as I wrote, most likely KepServerEX does not expose the value in this way - and then there would be no way around it.

Best regards

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

More
09 Oct 2025 20:41 #14405 by AQO
1.  i changed Kepware Protocol from "Logical Blocking" to "Logical Non-Blocking" and my speed improved significantly.

2. should i be able to read a complex data type from Kepware using a single tag?  For example, i have a PLC counter called CYCLE_COUNT.  Inside of its strucure there are a handful of tags (acc, pre, dn, etc.).  It would be nice to be able to read the single CYCLE_COUNT tag and then separate the data in the PC application.  i have included a screenshot from Kepware to add clarity to my description.

i have tried this numerous ways and it does not raise a fault, however the "Value" returned is alway null.
Attachments:

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

More
09 Oct 2025 05:30 #14404 by support
Hello.

1. This will need more investigation/additional information. There can be many reasons. For example, the server might have limitations on number of items in one Read, forcing QuickOPC to do multiple roundtrips. But there are other reasons too.

1.1. Do you specify the "value age" (a specific number of milliseconds, or Device, or Cache) with the Read, or are you keeping the default behavior in this respect?
1.2. When you talk about about receiving "less data", what data do you mean? What is the "extra" data that you are receiving but do not need?

2. This error is related to connections - or reconnections - to the server. It should not happen unless there are server/communication problems, or under high load. Is there a reproducible scenario that we can test here and analyze?

BTW, doing frequent repeated reads for the same data is strongly discouraged in OPC world (for load/performance reasons). This is what subscriptions are for.

Best regards
 

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

More
08 Oct 2025 14:20 #14403 by AQO
Greetings,

1.  I am using the uaClient.ReadMultipleValues command with 900 tags and it takes around 2 seconds to get the data.  if i expand my dataset to 2700 tags (just more of the same data types) it takes 15 seconds to get the data.  All i really need in the dataset that is returned is the data and the "quality" to know that the read was good.  Is there another command that i should be using to provide faster performance and return less data about each tag read?  

2.  when i was doing some back to back single tag reads (with a 50ms thread sleep between), i would sometimes get the following fault: failure: "cannot lock the opc-ua client session because it is not available".  What does this mean and what should i do to avoid it in the future?   

many thanks,

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

More
03 Oct 2025 14:24 #14390 by support
Hello.
Your code is fine.

The slowness is probably a combination of two factors:

1. Very first time performing the Read requires a lot of code to be compiled by .NET from MSIL to machine instructions (JIT: just-in-time compiling). Doing it the second time in the same process, this delay will be eliminated.

2. QuickOPC makes the OPC operations appear connection-less, but they still require a connection under the hood. And if the connection is not open, it takes some time to establish it. Users of GUI-based tools usually do one action to do the connection, the connection is established while they are deciding what to do the next, and when they then do the Read, it is *just* the Read timing that they observe. QuickOPC then keeps the connection open for a configurable time (I think 5 seconds by default), so subsequent Read-s should be quite fast. If the connection gets closed, the delay to open the connection will kick in again.

If you do any subscription, this effectively keeps the connection open (as opposed to just Read-s, Write-s etc.) until you explicitly unsubscribe.

You can also do it the way described here:  opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Late...tion%20Control%20Services.html

(QuickOPC Operation Control Services -> Connection Locking).

Best regards
 

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

More
02 Oct 2025 21:15 #14388 by AQO
thank you for your prompt response.  i did get the application working, however it is extremely slow (code attached).  it can take upwards of 5 seconds to read or write a single integer tag.  the entire application is nothing more than a single read or a single write. The Kepware connection to the PLC is quite fast as witnessed with the Kepware OPC_Client.

1.  can you provide any insight as to why it would be so slow?
2.  isn't it possible to have my application connect to the server and leave the connection open whilst my application is running?
Attachments:

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

More
02 Oct 2025 16:20 #14385 by support
Hello,
thank you for your interest in our products.

Example - read tag:  opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Late...Read%20a%20single%20value.html  

Example - write tag:  opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Late...rite%20a%20single%20value.html

Example: - subscribe:  opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Late...de%20for%20data%20changes.html

Please clarify what you mean by "i cannot get the existing sample code to function properly.  " - which sample code are you referring to? 

"Endpoint does not support the user identity type provided." may be caused, for example, that you are using an unauthenticated user (as in all examples above|), while the server is only configured to accept username/password. In such case, you need to add the username/password to your client code. An example of how this is done can be seen e.g. here:  opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Late...date%20GDS%20registration.html
- notice the use of .WithUserNameIdentity(..., ...) method.

If you keep getting problems, please post the code you are using, and if possible, also the server configration, or a screenshot of its endpoint configuration dialog(s).

Best regards
 

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

More
02 Oct 2025 15:04 #14384 by AQO
i am a long time user of ClientAce and Kepware and have been having difficulty getting your product to work.  Would you happen to have a C# sample project to read/write a tag and add a subscription.

As mentioned in the subject line, i am working on a C# Winforms application as a UA client to Kepware that is communicating with an Allen Bradley PLC.  My OS is Windows 11. For some reason, i cannot get the existing sample code to function properly.  i typically get the following fault:  - {BadUserAccessDenied}. Endpoint does not support the user identity type provided.

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

Moderators: supportvaclav.zaloudek
Time to create page: 0.154 seconds