Table of Contents

Method CreateIotItemAsync

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

CreateIotItemAsync(string, IotAgent, IDictionary<string, object>?, CancellationToken)

Creates a new IoT Item for the specified server tag under the given parent agent. The IoT Item name is derived from the server tag by replacing dots with underscores and stripping any leading underscore.

public Task<IotItem?> CreateIotItemAsync(string serverTag, IotAgent parentAgent, IDictionary<string, object>? properties = null, CancellationToken cancellationToken = default)

Parameters

serverTag string

The dot-delimited server tag reference (e.g., "Channel1.Device1.Tag1").

parentAgent IotAgent

The parent agent that will own the IoT Item.

properties IDictionary<string, object>

Optional properties to set on the IoT Item.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IotItem>

The created IotItem, or null if creation failed.

Exceptions

ArgumentException

Thrown when the server tag is null or empty.

ArgumentNullException

Thrown when the parent agent is null.