QuickOPC User's Guide and Reference
TopicWrite Property (_EasyDAClientHoldPeriods)
Example 



OpcLabs.EasyOpcClassic Assembly > OpcLabs.EasyOpc.DataAccess.Engine.ComTypes Namespace > _EasyDAClientHoldPeriods Interface : 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
 
Property TopicWrite As Integer
'Usage
 
Dim instance As _EasyDAClientHoldPeriods
Dim value As Integer
 
instance.TopicWrite = value
 
value = instance.TopicWrite
int TopicWrite {get; set;}
property int TopicWrite {
   int get();
   void set (    int value);
}
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.

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);
            }
        }
    }
}
' This example shows how the OPC server can quickly be disconnected after writing a value into one of its OPC items.

Imports OpcLabs.EasyOpc.DataAccess
Imports OpcLabs.EasyOpc.OperationModel

Namespace DocExamples.DataAccess._EasyDAClientHoldPeriods
    Friend Class TopicWrite
        Public Shared Sub Main1()
            Dim client = New EasyDAClient()

            client.InstanceParameters.HoldPeriods.TopicWrite = 100 ' in milliseconds

            Try
                client.WriteItemValue("", "OPCLabs.KitServer.2", "Simulation.Register_I4", 12345)
            Catch opcException As OpcException
                Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message)
            End Try
        End Sub
    End Class
End Namespace
Requirements

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

See Also

Reference

_EasyDAClientHoldPeriods Interface
_EasyDAClientHoldPeriods Members