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.

SessioneTimeout doesn't work?

More
29 Jul 2021 13:32 #10067 by support
An updated, enhanced Knowledge Base article on OPC UA timeout settings: kb.opclabs.com/QuickOPC-UA_Timeout_Settings .

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

More
01 Apr 2020 17:56 #8343 by support
Hello,

SessionTimeout has a different purpose - please read: opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...Parameters~SessionTimeout.html .

It says (a quote from OPC specification): "Duration. Requested maximum number of milliseconds that a Session should remain open without activity. If the Client fails to issue a Service request within this interval, then the Server shall automatically terminate the Client Session."

What you are looking for might be OperationTimeout (which defaults to 120000 milliseconds). Unfortunately there is no parameter to make it easy to change. It can still be changed, but it requires more work. Please read:

opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...plication%20Configuration.html

For convenience, I am attaching the default configuration, so that you can modify it and then use, according to the article.

Best regards
<?xml version="1.0" encoding="utf-8"?>
<ApplicationConfiguration
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ua="http://opcfoundation.org/UA/2008/02/Types.xsd"
  xmlns:s1="http://opcfoundation.org/UA/Sample/Configuration.xsd"
  xmlns:s2="http://opcfoundation.org/UA/SDK/COM/Configuration.xsd"
  xmlns="http://opcfoundation.org/UA/SDK/Configuration.xsd"
>
  <!-- A human readable but not necessarily unique name for the application instance -->
  <ApplicationName>Client Application with EasyOPC-UA</ApplicationName>
 
  <!-- A globally unique identifier for the application instance.
       This is overridden with the value contained in the application certificate. -->
  <ApplicationUri>urn:localhost:OpcLabs:EasyOpc:UA:EasyUAClient</ApplicationUri>
 
  <!-- A globally unique URI for the product (usually assigned by the product vendor) -->
  <ProductUri>http://www.opclabs.com/QuickOPC-UA</ProductUri>
 
  <!-- Indicates the type of application (Client, Server or ClientServer). -->
  <ApplicationType>Client_1</ApplicationType>
 
  <!-- Specifies security related configuration information -->
  <SecurityConfiguration>
 
    <!-- The certificate store and the location of the application instance certificate in the certificate store -->
    <ApplicationCertificate>
 
      <!-- The type of store. -->
      <StoreType>Directory</StoreType>
 
      <!-- The location of the store. 
           Windows store must start with LocalMachine, CurrentUser or CurrentService
           The name of the store is appended.
           Note that the names used in code are difference from what appears in the control panel.
           e.g. My == "Personal", Root == "Trusted Root Certification Authorities" -->
      <StorePath>%CommonApplicationData%\OPC Foundation\CertificateStores\MachineDefault</StorePath>
 
      <!-- ReSharper disable once CommentTypo -->
      <!-- The subject for the certificate 
           Note that subject names are complex structures. The text that appears here is the CommonName component.
           A complete distinguished would be something like: 'CN=UA Sample Client, DC=MACHINENAME'
           The first certificate found is used if multiple certificates with the same CommonName exist. 
           The Thumbprint should be specified if the CommonName does not uniquely identify a certificate. -->
      <SubjectName>Client Application with EasyOPC-UA</SubjectName>
      <!-- The SHA1 thumbprint for the certificate.
           The thumbprint uniquely identifies a certificate.
           It should be specified in this file, however, the samples rely on quick and 
           dirty scripts to create new certificate on each machine. A commercial application 
           would generate the initial certificate itself and update the thumbprint accordingly -->
      <!--<Thumbprint>...</Thumbprint>-->
 
    </ApplicationCertificate>
 
    <!-- The list of certification authorities. 
 
         Typical web browsing applications trust any certificate issued by a CA in the 
         "Trusted Root Certification Authorities" certificate store. However, this approach is 
         not appropriate for UA because Administrators have no control over the CAs that get
         placed in that Root store to facilitate web browsing. This means Administrators must
         specify a different store that is used only for UA related CAs and/or they must explicitly
         specify the certificate for each trusted certification authority. -->
    <TrustedIssuerCertificates>
      <StoreType>Directory</StoreType>
      <StorePath>%CommonApplicationData%\OPC Foundation\CertificateStores\UA Certificate Authorities</StorePath>
    </TrustedIssuerCertificates>
 
    <!-- The list of trusted certificates. 
 
         Some UA applications will use self-signed certificates (certificates without a CA)
         which means that every application which communicates with it must be configured to 
         trust it.
 
         Administrators may designate a certificate store that contains trusted UA application 
         instance certificates (this store should not be the same as the store used for CAs 
         certificates). Alternately, Administrators may enter the certificates explicitly in
         this list.
 
         Note that entries in this list may either reference a certificate in the store or
         may contained the entire certificate encoded as base64 data.
         -->
    <!--<TrustedPeerCertificates>
      <StoreType>Windows</StoreType>
      <StorePath>LocalMachine\UA Applications</StorePath>
    </TrustedPeerCertificates>-->
    <TrustedPeerCertificates>
      <StoreType>Directory</StoreType>
      <StorePath>%CommonApplicationData%\OPC Foundation\CertificateStores\UA Applications</StorePath>
    </TrustedPeerCertificates>
 
    <!-- Applications exchange Nonces during the CreateSession. This value specifies the length. Must be >= 32 -->
    <NonceLength>32</NonceLength>
 
    <!-- The directory used to store invalid certificates for later review by the administrator. -->
    <RejectedCertificateStore>
      <StoreType>Directory</StoreType>
      <StorePath>%CommonApplicationData%\OPC Foundation\CertificateStores\RejectedCertificates</StorePath>
    </RejectedCertificateStore>
 
  </SecurityConfiguration>
 
  <!-- Maps different transports onto a .NET implementation of a WCF Binding
 
       WCF bindings are very complex and have many parameters that can be tweaked. To ensure
       interoperability the SDK has defined 3 standard bindings which can be selected with this
       element. Developers may define their own Bindings as well provided the inherit from the 
       Opc.Ua.Binding.BaseBinding type and implement the same constructor as the built-in binding
       provide.
 
       Note protocols other than HTTP or UA-TCP are not considered to be interoperable -->
<TransportConfigurations>
    <!-- This binding wraps the ANSI C implementation of UA-TCP instead of using the C# implementation. -->
    <!--
    <TransportConfiguration>
      <UriScheme>opc.tcp</UriScheme>
      <TypeName>Opc.Ua.NativeStack.NativeStackBinding,Opc.Ua.NativeStackWrapper</TypeName>
    </TransportConfiguration>
    -->
 
    <!-- This binding uses the WCF binary encoded XML over TCP -->
    <TransportConfiguration>
      <UriScheme>net.tcp</UriScheme>
      <TypeName>Opc.Ua.Bindings.UaSoapXmlOverTcpBinding</TypeName>
    </TransportConfiguration>
    <!--
    -->
 
    <!-- This binding uses the WCF binary encoded XML over PIPE -->
    <TransportConfiguration>
      <UriScheme>net.pipe</UriScheme>
      <TypeName>Opc.Ua.Bindings.UaSoapXmlOverPipeBinding</TypeName>
    </TransportConfiguration>
    <!--
    -->
 
  </TransportConfigurations>
 
  <!-- Specifies quotas used to by the transport layer -->
  <TransportQuotas>
 
    <!-- The default timeout in milliseconds for operations (used by clients) -->
    <OperationTimeout>120000</OperationTimeout>
 
    <!-- The maximum length for a string value in any message -->
    <MaxStringLength>1048576</MaxStringLength>
 
    <!-- The maximum length for a byte string value in any message -->
    <MaxByteStringLength>4194304  </MaxByteStringLength>
 
    <!-- The maximum length for any array in a message. 
         Note that some protocols do not distinguish between bytes and arrays. 
         In these cases the binding will choose the larger of 
         MaxByteStringLength or MaxArrayLength-->
    <MaxArrayLength>655350</MaxArrayLength>
 
    <!-- The maximum size of any message -->
    <MaxMessageSize>4194304</MaxMessageSize>
 
    <!-- The maximum buffer size 
         This value controls how big a block of memory the transport layer allocates.
         Setting this value to a large value will reduce performance and use a lot of RAM -->
    <MaxBufferSize>65535</MaxBufferSize>
 
    <!-- The lifetime of a SecureChannel in milliseconds.
         This specifies how long the server will keep a broken channel around while waiting 
         for a client to reconnect.
         Not used by HTTP or .NET TCP bindings -->
    <ChannelLifetime>300000</ChannelLifetime>
 
    <!-- The lifetime of a SecurityToken in milliseconds.
         This specifies how long a security token can be used without renewal. -->
    <SecurityTokenLifetime>3600000</SecurityTokenLifetime>
  </TransportQuotas>
 
  <!-- This element is only required for Client and ClientServer applications -->
  <ClientConfiguration>
    <!-- The default timeout for new sessions -->
    <DefaultSessionTimeout>60000</DefaultSessionTimeout>
 
    <!-- The well-known URLs for the local discovery servers
         URLs are tested in the order they appear in this list. -->
    <WellKnownDiscoveryUrls>
      <ua:String>opc.tcp://{0}:4840</ua:String>
      <ua:String>http://{0}:52601/UADiscovery</ua:String>
      <ua:String>http://{0}/UADiscovery/Default.svc</ua:String>
    </WellKnownDiscoveryUrls>
 
    <!-- EndpointDescriptions for system wide discovery servers -->
    <DiscoveryServers></DiscoveryServers>
 
    <!-- The file used to save the EndpointDescriptions for servers known to the Client -->
    <EndpointCacheFilePath>OpcLabs.EasyOpc.UA.EasyUAClient.Endpoints.xml</EndpointCacheFilePath>
 
	  <!-- The minimum subscription lifetime.
	  This ensures subscriptions are not set to expire too quickly. The requested lifetime count
	  and keep alive count are calculated using this value and the request publishing interval -->
	  <MinSubscriptionLifetime>10000</MinSubscriptionLifetime>
  </ClientConfiguration>
 
  <Extensions>
  </Extensions>
 
  <!--
  Masks supported by the trace feature. 
  Servers will detect changes within 5 seconds.
 
  Do not output any messages.
  None = 0x0;
 
  Output error messages.
  Error = 0x1;
 
  Output informational messages.
  Information = 0x2;
 
  Output stack traces.
  StackTrace = 0x4;
 
  Output basic messages for service calls.
  Service = 0x8;
 
  Output detailed messages for service calls.
  ServiceDetail = 0x10;
 
  Output basic messages for each operation.
  Operation = 0x20;
 
  Output detailed messages for each operation.
  OperationDetail = 0x40;
 
  Output messages related to application initialization or shutdown
  StartStop = 0x80;
 
  Output messages related to a call to an external system.
  ExternalSystem = 0x100;
 
  Output messages related to security
  Security = 0x200;
  -->
 
  <TraceConfiguration>
    <OutputFilePath>%LocalApplicationData%\OPC Labs\Logs\EasyUAClient.log.txt</OutputFilePath>
    <DeleteOnLoad>true</DeleteOnLoad>
    <!-- Show Only Errors -->
    <!-- <TraceMasks>1</TraceMasks> -->
    <!-- Show Only Security and Errors -->
    <!-- <TraceMasks>513</TraceMasks> -->
    <!-- Show Only Security, Errors and Trace -->
    <TraceMasks>515</TraceMasks>
    <!-- Show Only Security, COM Calls, Errors and Trace -->
    <!-- <TraceMasks>771</TraceMasks> -->
    <!-- Show Only Security, Service Calls, Errors and Trace -->
    <!-- <TraceMasks>523</TraceMasks> -->
    <!-- Show Only Security, ServiceResultExceptions, Errors and Trace -->
    <!-- <TraceMasks>519</TraceMasks> -->
  </TraceConfiguration>
 
  <!-- Enables the hi-res clock for the process to allows for shorter (<100ms) publishing and sampling intervals. -->
  <!-- QueryPerformanceCounter does not work on all multi-core machines so enabling the hi-res clock by default is not recommended. -->
  <DisableHiResClock>true</DisableHiResClock>
 
</ApplicationConfiguration>

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

More
01 Apr 2020 12:58 #8339 by Grizzo
Hi, we use READMULTIPLE generalli (cannot use SUBSCRIBE) and need to have a maximum response time of 30 seconds.
Sometimes, probably due to OPCServer not responding, the READMULTIPLE call remains stucked for 2 minutes.
I read the 2 mins is the standard timeout of the library and I tried to set it to 30 secs with SessionTimeout parameters, but it does not seem to work.

Beacuse we do not use Isolated client, the SessionTimeout to set is a property of OpcLabs.EasyOpc.UA.EasyUAClient.AdaptableParameters.SessionParameters.
I tried to set it up before and after instantiating EasyUAClient object and opening connection without any results: the timeout is always 2 minutes.

The documentation and/or search in forums didn't give me an answer. What could be wrong? Some suggestion on How To set up the timeout?
A piece of example code would be appreciated.

Thanks.
Massimo

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

Moderators: support
Time to create page: 0.070 seconds