Table of Contents

Method CreateDeviceAsync

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

CreateDeviceAsync(Channel, string, string?, IDictionary<string, object>?, CancellationToken)

Creates a new device with the specified name and driver in the specified channel.

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

Parameters

channel Channel

The channel to which the device belongs.

name string

The name of the device.

driverName string

The name of the driver.

properties IDictionary<string, object>

The properties to set on the device.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<Device>

A task that represents the asynchronous operation. The task result contains the created device, or null if creation failed.

Exceptions

ArgumentNullException

Thrown when the channel is null.

ArgumentException

Thrown when the device name is null or empty.