IUAVariable.SetDynamicLink(source, mode)
Set a dynamic link to the variable source that is passed in the first argument. The second argument is optional and sets the dynamic link mode.
void SetDynamicLink(IUAVariablesource, DynamicLinkModemode);
Arguments
- source(IUAVariable)
- TheBrowseNameof the source variable.
- 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
The following example shows an API that sets a read dynamic link on the
Speed
property (which node is represented by SpeedVariable
) of the Motor1
object. The link source is the Text
property of the SpeedLabel
object:var myObj = Owner.Get<Motor>("Motor1"); var speedValue = Owner.GetObject("SpeedLabel").GetVariable("Text"); myObj.SpeedVariable.SetDynamicLink(speedValue, DynamicLinkMode.Read);
Fornire un feedback