Closed avnet78 closed 1 year ago
Do you still get a timeout if you set the timeout to TimeSpan.FromSeconds(30)
? Just want to ensure you're not getting real network timeouts.
I noticed that you have libplctag.NativeImport.plctag.ForceExtractLibrary = false;
If you have upgraded your libplctag.Net version recently, you should ensure that your native plctag.dll
is matching correctly. I also had weird timeouts when I upgraded libplctag.Net and was using an older version of plctag.dll
. These issues went away when I used the newest plctag.dll
. We have ForceExtractLibrary as false because the application will be expected to run in Program Files without elevated access, so any attempts to write or overwrite those dlls will fail.
We have a C language library which is able to read about 100+ tags in milliseconds on the same server.
We want to replace that with a .Net reader. So, the timeout error is a bit misleading.
Thanks, Vishal
From: ShadowMarker789 @.> Sent: Wednesday, October 26, 2022 10:08:47 PM To: libplctag/libplctag.NET @.> Cc: AVNet @.>; Author @.> Subject: Re: [libplctag/libplctag.NET] "ErrorTimeout" exception (Issue #301)
Do you still get a timeout if you set the timeout to TimeSpan.FromSeconds(30)? Just want to ensure you're not getting real network timeouts.
I noticed that you have libplctag.NativeImport.plctag.ForceExtractLibrary = false;
If you have upgraded your libplctag.Net version recently, you should ensure that your native plctag.dll is matching correctly. I also had weird timeouts when I upgraded libplctag.Net and was using an older version of plctag.dll. These issues went away when I used the newest libplctag.dll. We have ForceExtractLibrary as false because the application will be expected to run in Program Files without elevated access, so any attempts to write or overwrite those dlls will fail.
— Reply to this email directly, view it on GitHubhttps://github.com/libplctag/libplctag.NET/issues/301#issuecomment-1292908366, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APBE5DFYK6SICIKPVVERZQTWFHW37ANCNFSM6AAAAAARPK6U2Y. You are receiving this because you authored the thread.Message ID: @.***>
We have a C language library which is able to read about 100+ tags in milliseconds on the same server. We want to replace that with a .Net reader. So, the timeout error is a bit misleading. Thanks, Vishal
Did changing your version of plctag.dll
resolve things for you?
Hi @avnet78 - if you weren't able to solve this with @ShadowMarker789 suggestion, could you please help to produce a minimal example for further investigation.
Something like this would be helpful:
var tag = new Tag<RealPlcMapper, float>()
{
Name = "SP_RigWatch_Interface.Read_FLOAT[82]",
Gateway = "192.168.1.195",
Path = "1,0",
PlcType = PlcType.ControlLogix,
Protocol = Protocol.ab_eip,
Timeout = TimeSpan.FromSeconds(10)
};
tag.Initialize(); // produces LibPlcTagException with status ErrorTimeout immediately after calling.
What is the type of Exception you're getting. i.e. is it a LibPlcTagException, or something else?
It would also be helpful if you can attach some debug logs so we can see what is happening inside libplctag. Please study the example here to see how this can be done: https://github.com/libplctag/libplctag.NET/blob/master/src/Examples/CSharp%20DotNetCore/LoggingExample.cs
Below is my sample code. I am trying to read some Float tags from PLC but I am getting "ErrorTimeout" exception. Please help. I don't think Timeout = TimeSpan.FromMilliseconds(500) is the issue. I have tried 10000 milliseconds as well. It goes into the exception block almost immediately after the line - plcTag.Initialize();