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
serverTagstringThe dot-delimited server tag reference (e.g., "Channel1.Device1.Tag1").
parentAgentIotAgentThe parent agent that will own the IoT Item.
propertiesIDictionary<string, object>Optional properties to set on the IoT Item.
cancellationTokenCancellationTokenThe cancellation token.
Returns
Exceptions
- ArgumentException
Thrown when the server tag is null or empty.
- ArgumentNullException
Thrown when the parent agent is null.