Passa al contenuto principale

Class DynamicLinkExtensions

Namespace: TecnoPack
Assembly: CO0002_Templ_FlowpackHMI_V00_26_M.dll

Provides extension methods for dynamically linking UA variables to sources, including support for array indices and subarray indices.

public static class DynamicLinkExtensions

Inheritance

object ← DynamicLinkExtensions

Methods

SetDynamicLink(IUAVariable, IUAVariable, DynamicLinkMode, uint?, uint?)

Creates a dynamic link from a target variable to a source variable, optionally specifying array indices.

public static void SetDynamicLink(this IUAVariable variable, IUAVariable source, DynamicLinkMode mode, uint? sourceArrayIndex = null, uint? sourceSubArrayIndex = null)

Parameters

variable IUAVariable

The target variable to link.

source IUAVariable

The source variable providing the value.

mode DynamicLinkMode

The dynamic link mode to apply.

sourceArrayIndex uint?

Optional. The index of the element in the source array to link. If not specified, the whole variable is linked.

sourceSubArrayIndex uint?

Optional. If the source is a multidimensional array, specifies the subarray index.

Remarks

This method automatically creates a object for the target variable if one does not already exist. It also handles references, converter cleanup, and ensures the dynamic link starts if the target variable is in a started subtree.

Exceptions

ArgumentException

Thrown when:

  • The source variable is not an array but an array index was specified.
  • The provided sourceArrayIndex exceeds the source array bounds.
  • The provided sourceSubArrayIndex exceeds the element size in bits.
  • The source variable value is null.

  • Methods
    • SetDynamicLink(IUAVariable, IUAVariable, DynamicLinkMode, uint?, uint?)