Table of Contents

Method GetOrCreateChannelAsync

Namespace
Kepware.Api.ClientHandler
Assembly
Kepware.Api.dll

GetOrCreateChannelAsync(string, string, IDictionary<string, object>?, CancellationToken)

Gets or creates a channel with the specified name and driver.

public Task<Channel> GetOrCreateChannelAsync(string name, string driverName, IDictionary<string, object>? properties = null, CancellationToken cancellationToken = default)

Parameters

name string

The name of the channel.

driverName string

The name of the driver.

properties IDictionary<string, object>

The properties to set on the channel.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<Channel>

A task that represents the asynchronous operation. The task result contains the created or loaded channel.

Exceptions

ArgumentException

Thrown when the channel name or driver name is null or empty.

InvalidOperationException

Thrown when the channel cannot be created or loaded.