Using script to control embedded trends

I'm trying to build a screen with trends on it that the operator can easily modify.  I'm using the iFix Chart object (because I don't think this can work with the embedded trend) and I have this code that seems to work OK:


Chart1.DeletePen 1

Chart1.AddPen "DVSYS.LI100/AI/OUT.F_CV"

Couple of problems I'm encountering: the trend is real-time only, even though this tag is historized, and the trend defaults to 1-minute duration and I'd like to set it to 30 minutes, without the operator having to manually modify.

Any ideas?  Is there a simpler way to do this?

Thanks!

-Mark

6 Replies

  • not to be a debbie downer but good luck. I've been trying to get emerson to improve trends for years. Compared to all the competitors deltav is great in all aspects except for trends.. Their trends are the worst in the industry
  • In reply to JesseMcNeely:

    thanks. Not sure I can get them to improve anything, but it'd be nice if the VB documentation was a little more thorough. I'm not a master programmer by any means, but it seems like it'd be a simple thing to modify pen settings with visual basic. I can do it on the other DCS system...
  • Ls1m, the trend object your using cannot connect to the DeltaV historian. It is an iFIX object and since DeltaV does not use the iFIX historian, that connection is simply not there. These can only be realtime and rebuild if you leave the display.

    What version of DeltaV are you using? In v12, DeltaV added the Embedded Trend Object. You can only configure it offline in v12. In v13, the Embedded Trend object can be manipulated at runtime to add and remove pens.

    Adding Tags:
    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 Tags:

    EmbeddedTrendControl1.RemoveAllTags 'Removes all tags from the chart
    EmbeddedTrendControl1.RefreshChart 'Updates chart


    There were other enhancements to the embedded Trend in v13.

    Andre Dicaire

  • In reply to Andre Dicaire:

    We have several different systems to put this graphic on, from version 10 to version 12 or 13. I don't suppose the v13 embedded trend ocx can be inserted into a schematic, and then used on an older system?
  • In reply to Andre Dicaire:

    Is there any way I could get a copy of the version 13 control? c:/deltav/bin/EmbeddedTrendCtrl.ocx
  • In reply to ls1m:

    Have you considered just using the Chart Builder functionality (not sure about in v10 though) which allows the operator to right click on dynamo (to select the object) and select from predefined selections (SP, PV, OUT) depending on the module type. It allows up to 6 items and then they can select some options and then click Build Chart.

    Here is a sample screen shot of the chart builder interface.