Changing the Data Source of a Data Link

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:

  1. Create an AI block with RA as the I/O address, and a DO block in the database.
  2. Create a Data link and connect it to the AI block.
  3. Right-click the Data link and select Edit Script from the pop-up menu.
  4. Enter the following code in the Data link's Click event:

DataLink1.ContainedObjects.Item(1).Source = _

"Fix32.Thisnode.DO.F_CV"

  1. 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

How Do I...