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.
- Forum
- Discussions
- QuickOPC-UA in .NET
- General Issues, Building
- Timeout during WriteMultipleItemValues
Timeout during WriteMultipleItemValues
Ad 1. opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Late...ameters~TopicRetrialDelay.html . This has nothing to do with the timeout problem you reported. Recommended value is the default which is 10 minutes.
Ad 2.This is weird. When the timeout is set to the Int32.maxValue, it should not occur. It looks like that the setting you made is not being picked up by QuickOPC. And there is the other setting (#3 below - EnableXXXXClient) which is not being picked up either. I need to get to the bottom of this, because obviously, if the settings are being ignored, playing with them is not going to help. Which version and build of QuickOPC are you using? I will test with it then.
Ad 3. I understand. The advise was sound, but as I explained above, for some reason it has no effect and we need to find out why.
Are you actually using the very same instance EasyDAClient object later in the code? Because these setting apply to the concrete instance only.
Ad 4. (covered by 2, 3).
Do you have any results with the OPC Analyzer?
Best regards
Please Log in or Create an account to join the conversation.
What is the recommended value and is there a documentation?1. Please do not set EasyDAClient.SharedParameters.TopicParameters.TopicRetrialDelay to zero. It can create too much load. Topic retrials are rare but if they happen, they are related to OPC server configuration thus no need to pick the new settings up in matter of milliseconds.
So if I already have the maximum write timeout value, does that mean the timeout issue that I have is not related to OpcLabs library but has something to do with modbus or the device itself?2. The opcClient.InstanceParameters.Timeouts.WriteItem is the right place to set the timeout for Writes. Although int.MaxValue is not incorrect, I recommend to use some judgment and put there is a reasonable amount - several minutes should be enough for any practical use.
I had an issue with .Net and I think it was recommended to enable it. Here is the link to the post I created3. Why do you have this? : opcClient.InstanceParameters.EnableNetApiClient = true;
Yes, these are the same settings I have been using for over 2 years.4. There is something very weird. I have hard time believing that you get the error mentioned in the original post (Write not completed) with the setting mentioned in #3. Because, with the setting in #3, the error message would be/should be different. Is the error message truly with the code you listed ?!
Please Log in or Create an account to join the conversation.
Replace "Kepware.KEPServerEX.V6" by "OpcTestLab.OpcAnalyzer.1". Address and everything else stays the same.
Best regards
Please Log in or Create an account to join the conversation.
For the OPC Analyzer, I will send you the link by email.
The way I build DAItemValueArguments object is as following:
new DAItemValueArguments(address, identifier, tagName, val)
new DAReadItemArguments(new ServerDescriptor(address, identifier), new DAItemDescriptor(tagName), new DAReadParameters { DataSource = DADataSource.Device });
when address is 127.0.0.1, identifier is "Kepware.KEPServerEX.V6", example for a tagName is "ChannelR-30iBMate.DeviceR-30iBMate.CURPOS_J4"
So, how do I now connect to the OPC Analyzer? The document says "The ProgID of the OPC Analyzer is "OpcTestLab.OpcAnalyzer.1". So, should I use OpcTestLab.OpcAnalyzer.1 for the address or identifier or some other way?
Please Log in or Create an account to join the conversation.
Comments to your code:
1. Please do not set EasyDAClient.SharedParameters.TopicParameters.TopicRetrialDelay to zero. It can create too much load. Topic retrials are rare but if they happen, they are related to OPC server configuration thus no need to pick the new settings up in matter of milliseconds.
2. The opcClient.InstanceParameters.Timeouts.WriteItem is the right place to set the timeout for Writes. Although int.MaxValue is not incorrect, I recommend to use some judgment and put there is a reasonable amount - several minutes should be enough for any practical use.
3. Why do you have this? : opcClient.InstanceParameters.EnableNetApiClient = true;
4. There is something very weird. I have hard time believing that you get the error mentioned in the original post (Write not completed) with the setting mentioned in #3. Because, with the setting in #3, the error message would be/should be different. Is the error message truly with the code you listed ?!
Regards
Please Log in or Create an account to join the conversation.
Regarding the logs: Only very limited set of log entries is generated for OPC-DA. One of them is the message you are seeing, and also there would be messages related to "queue overflow". So in this respect, everything is OK, as long any "queue overflow" message is not present - which is what I wanted to check.
The message about COM security initialization is likely not related to the problem.
For the OPC Analyzer, I will send you the link by email.
I will write a separate post about the timeout settings later.
Best regards
Please Log in or Create an account to join the conversation.
So, it is necessary to have the whole record of all log entries to rule out the queue overflow. Please check it, or post it here or send to support09 (at) opclabs.com.
This is the code how I subscribe to log and start the opc client
private static EasyDAClient Create()
{
EasyDAClient.LogEntry += EasyDAClientOnLogEntry;
EasyDAClient.SharedParameters.TopicParameters.TopicRetrialDelay = 0;
var opcClient = new EasyDAClient();
ApplyOpcLabsLicense(opcClient);
opcClient.InstanceParameters.EnableNativeClient = false;
opcClient.InstanceParameters.EnableNetApiClient = true;
opcClient.InstanceParameters.Mode.AllowAsynchronousMethod = false;
opcClient.InstanceParameters.Mode.DesiredMethod = OpcLabs.EasyOpc.DataAccess.Engine.DAReadWriteMethod.Synchronous;
opcClient.InstanceParameters.Timeouts.BrowseAccessPaths = int.MaxValue;
opcClient.InstanceParameters.Timeouts.BrowseNodes = int.MaxValue;
opcClient.InstanceParameters.Timeouts.BrowseProperties = int.MaxValue;
opcClient.InstanceParameters.Timeouts.BrowseServers = int.MaxValue;
opcClient.InstanceParameters.Timeouts.GetProperty = int.MaxValue;
opcClient.InstanceParameters.Timeouts.ReadItem = int.MaxValue;
opcClient.InstanceParameters.Timeouts.WriteItem = int.MaxValue;
return opcClient;
}
private static void EasyDAClientOnLogEntry(object sender, LogEntryEventArgs args)
{
//write to file
}
Below is the log entries that I got:
As you can see, logs were only created while the license was being applied. Do you have any idea why no logs were produced after that?
2025-01-20 13:58:33.5866|Information(1201): Licensing for EasyDAClient component started, license serial number *******, issuer name "*******", subject name "********".
2025-01-20 13:58:33.6786|Error(2): COM security initialization (process name "********", Id 20820) for requestor 'ComSecurityInitializingEasyDAClient' failed; the initialization object was: (Default).
CoInitializeSecurity failure (0x80010119): Security must be initialized before any interfaces are marshalled or unmarshalled. It cannot be changed once initialized.
+ This error (RPC_E_TOO_LATE) is not uncommon in hosted .NET applications. Depending on various factors, it might be possible to prevent it, or safely ignore it (if COM works as intended). Consult the product documentation.
+ Current thread name: "", from thread pool: yes, managed thread Id: 9, apartment state: MTA.
Please Log in or Create an account to join the conversation.
1) Try to increase the timeout (I can give instructions on how to do that), or
2) Try to use OPC Analyzer to analyze the communication between QuickOPC (your app) and the Kepware server. That would tell us whether it is the Kepware server not returning the "write" result in time, or some issue on QuickOPC side. Again, I can give some instruction on this if you like.
It would be great if you could give me instructions on how to increase the timeout and also what kind and how to use OPC Analyzer.
Please Log in or Create an account to join the conversation.
Thanks for the info. I am slightly concerned about the fact you worded your response. You wrote "I do see some log entries when I apply the license but I don't see any log entries when this error happens". If there truly was a queue overflow (which is what I am trying to determine), the log entry for that would *not* be when the :Write not completed" error occurs. It would be somewhere before it (even a long time before it). So, it is necessary to have the whole record of all log entries to rule out the queue overflow. Please check it, or post it here or send to support09 (at) opclabs.com.
In case the queue overflow is not the cause, it can then be truly the case that the server has not reported the outcome of the "Write" operation in time. And yes, that may have to do with the fact it is Modbus - perhaps even the actual device had not responded at all (or not in time). I think the default timeout now is 20 seconds. You can either
1) Try to increase the timeout (I can give instructions on how to do that), or
2) Try to use OPC Analyzer to analyze the communication between QuickOPC (your app) and the Kepware server. That would tell us whether it is the Kepware server not returning the "write" result in time, or some issue on QuickOPC side. Again, I can give some instruction on this if you like.
Best regards
Please Log in or Create an account to join the conversation.
Attachments:
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-UA in .NET
- General Issues, Building
- Timeout during WriteMultipleItemValues