This example details how to change the data source of a Data link in the run-time environment using the Format object.
To change the data source of a Data link using the Format object:
- Create an AI block with RA as the I/O address, and a DO block in the database.
- Create a Data link and connect it to the AI block.
- Right-click the Data link and select Edit Script from the pop-up menu.
- Enter the following code in the Data link's Click event:
DataLink1.ContainedObjects.Item(1).Source = _
"Fix32.Thisnode.DO.F_CV"
- Initialize the DO block, switch to the run-time environment, and click the Data link.
The caption of the Data link changes to the current value of the DO block.
See Also
Creating a Direct Connection to an Object
Changing a Text Object's Caption
Changing a Variable Object's Current Value