Writing scripts > Working with DeltaV Operate objects

Configuring Embedded Trend Controls for adding or removing pens at run time

Embedded Trend Controls can be configured using VBA script to give the operator the ability to add or remove pens at run time. This is done using the AddTags, RemoveAllTags and RefreshChart methods.

Adding pens

The following script illustrates how to configure EmbeddedTrendControl1 for adding pens at run time.
Dim sTags as string

sTags = "PID_LOOP_1\PID1\OUT.CV, PID_LOOP_2\PID1\OUT.CV" 'Comma separated tags you want to add in the chart’
EmbeddedTrendControl1.AddTags (sTags) 'Adds the tags to the chart
EmbeddedTrendControl1.RefreshChart 'Updates chart

Removing pens

The following script illustrates how to configure EmbeddedTrendControl1 for removing pens at run time.
EmbeddedTrendControl1.RemoveAllTags 'Removes all tags from the chart
EmbeddedTrendControl1.RefreshChart 'Updates chart

For more information on the Embedded Trend Control, refer to The Embedded Trend object. For more information on the methods, see the iFIX Automation Help.