IUAVariable.SetDynamicLinkToAlias(aliasName, path, attributeId, mode)
Set a dynamic link from a variable to a specific OPC UA attribute of a child or
nested node inside an alias.
void SetDynamicLinkToAlias(string aliasName, string[] path, AttributeId attributeId, DynamicLinkMode mode = DynamicLinkMode.Read);
Arguments
- aliasName(string)
- TheBrowseNameof the Alias.
- path
- An array of strings specifying the path to a child or nested node inside the alias.
- attributeId
- The OPC UA attribute to link to. UseAttributeIdenumeration.
- mode(DynamicLinkMode)
- An optional argument that specifies the dynamic link mode.The following dynamic link modes are available:
- DynamicLinkMode.Read(default)
- Read (from source node to parent).
- DynamicLinkMode.Write
- Write (from parent to source).
- DynamicLinkMode.ReadWrite
- Read and write (bidirectional).
- ResourceURI
- A C# object that contains the path indicated in the argument.
Example
Link a variable to a specific OPC UA attribute of an item nested inside an alias:
[ExportMethod] public void CreateDynamicLinkToAliasSubItemAttribute() { // Get the Text variable of a Label var myVariable = Owner.GetVariable("Label1/Text"); // Link to the BrowseName attribute of {MotorAlias}/Configuration/Speed myVariable.SetDynamicLinkToAlias("MotorAlias", new string[] { "Configuration", "Speed" }, AttributeId.BrowseName, DynamicLinkMode.Read); }
Provide Feedback