OPC Studio User's Guide and Reference
TopicWrite Property (EasyDAClientHoldPeriods)
Example 



View with Navigation Tools
OpcLabs.EasyOpcClassicCore Assembly > OpcLabs.EasyOpc.DataAccess.Engine Namespace > EasyDAClientHoldPeriods Class : TopicWrite Property
After an item write call, connection to an OPC item will be maintained at least for the time period specified here.
Syntax
'Declaration
 
<DataMemberAttribute()>
<ValueRangeAttribute(0, 2147483647)>
Public Property TopicWrite As Integer
 
'Usage
 
Dim instance As EasyDAClientHoldPeriods
Dim value As Integer
 
instance.TopicWrite = value
 
value = instance.TopicWrite

Property Value

Valid values of this property are in the range from 0 to 2147483647 (Int32.MaxValue).

The default value of this property is 30000.

Exceptions
ExceptionDescription

The value of an argument is outside the allowable range of values as defined by the invoked method.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

Remarks

This property is used by following client implementations:

Example
// This example shows how the OPC server can quickly be disconnected after writing a value into one of its OPC items.
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
// OPC client and subscriber examples in C# on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-CSharp .
// Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own
// a commercial license in order to use Online Forums, and we reply to every post.

using System;
using OpcLabs.EasyOpc.DataAccess;
using OpcLabs.EasyOpc.OperationModel;

namespace DocExamples.DataAccess._EasyDAClientHoldPeriods
{
    class TopicWrite
    {
        public static void Main1()
        {
            // Instantiate the client object.
            var client = new EasyDAClient();

            client.InstanceParameters.HoldPeriods.TopicWrite = 100; // in milliseconds

            try
            {
                client.WriteItemValue("", "OPCLabs.KitServer.2", "Simulation.Register_I4", 12345);
            }
            catch (OpcException opcException)
            {
                Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message);
            }
        }
    }
}
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also