Indirect Easy Chart Template

Hi all,

Currently setting up some trends, using the Easy Chart component. On FTView SCADA, there’s a trend template functionality, which basically means I can set up a trend with all my pens, all my axes, all my other parameters etc etc, and then save it as a template. Rinse and repeat. So then, I create one window with a trend object, and just give the user a means of selecting between multiple templates.

In ignition, I know I can use cell update binding to dynamically select pens, or axes, or whatever. But I’m not sure of the best/simplest way to achieve the same “template” functionality.

So far, my best idea is to create a custom property for each parameter that needs to be loaded as part of the template. Then when I click a button to select a different trend, I run a script to modify the custom parameters. I’m sure I could make this work, but it seems like a lot of effort, and not especially intuitive to add new trend “templates” as I’m basically editing a script freehand to do so, rather than using a normal-looking configuration window and then clicking “Save As”, a la FTView. It also means that certain things, e.g. the max number of pens, would have to be fixed rather than completely dynamic.

Any other ideas?

If you want the number of axes or number of pens to be dynamic, don’t use cell bindings. Bind the pens, tagPens, and/or axes datasets themselves, or script the updates to them from the templates parameters. runScript() is your friend.

Sorry, not sure what you mean. Can you elaborate just a little more?

Edit: Okay, had the facepalm moment.

Make the trend object a template (with all my talk of FTView templates, I forgot about Ignition templates for a minute there). The trend can have datasets as a custom property. Make one custom dataset property for pens, and one for axes. Copy and paste the dataset from the trend object to the custom property to get the structure the same.

I think I’ll still have to create a separate window for each trend, but since the only thing on each window will be a template, it’s not a major hassle. Since ignition doesn’t use window-count licensing, this isn’t as big a deal as it is on FTView.

Or maybe I’ll have another facepalm moment shortly and realise there’s an easy way to load pre-configured datasets into the custom property…

If you put your trend in a template, just create a number of dataset template parameters, then bind these to the appropriate trend property datasets. This allows you to open the template and pass in the datasets you want at run time, so your trend can display any set of tags you want.

If you have a dedicated trending window you can achieve the same thing with window parameters. You don’t need multiple windows, just pass in datasets containing the correct data.

Current plan is to do this without using a template - just using window parameters as you suggest. A couple of questions that I’m currently trying to work out…

  1. Presumably the easiest way to pass the dataset is to create a memory tag of type dataset, input all the data into the tag, and then pass that tag. Is there any other way? The tag method is working, but just curious.
  2. My trend window is a full-screen window. To switch between trend templates, I write a script to copy the new dataset tag to the window property. This works, but could I also achieve it by calling a window swap and then specifying the same window to swap to, passing in a different tag? This would allow me to use the pre-built “swap to window” functionality instead of freehand writing the script, and also leads to my next question…
  3. Could I use a tab strip navigation object to do this switching? I’ve got two monitors with graphics on one and trends on another. If I had a tab strip down the left of the left monitor to navigate the graphics, and another tab strip down the right of the right monitor to switch trends, it’d look really neat! But my initial testing seems to indicate that I can’t specify the same window for each tab on the tab strip.
  1. To use window parameters you would normally create a dataset in a script on the button you press to navigate to the window using system.dataset.toDataSet. You would then pass this to the system.nav function in a dictionary (see system.nav.swapTo for examples).
  2. I would just load a new dataset into the custom window property using a button and let binding do its thing, I wouldn’t try to trigger this by reloading pages.
  3. A tab strip would work, but only by turning off navigation and putting code into the propertyChange event, making sure to check that the name of the event is selectedTab. You would then load the correct dataset into the custom window property depending on what button had been pressed.
  1. Had a look at system.dataset.toDataset but I think in this case I’ll stick with the tag method - it just allows me to create the trend data in a more intuitive table format, instead of freehand scripting it. It also means I can just set up a trend using the inbuilt trend tools, test it and get it looking exactly how I want it, and then copy and paste the resulting dataset straight across to a tag. Good to know about the system.dataset option though because I can definitely see it being useful in other areas.
  2. Agreed
  3. I had a play with putting a tab strip in disabled mode, but what I found was that if you have the same window name defined for any two tabs (even if that “same window name” is blank), it picks both tabs when you select any one tab. I guess I can just put some generic window names in each tab (even just “tab 1”, “tab 2”, etc), and since navigation mode is disabled it won’t cause any problems with trying to reference a window that doesn’t exist?

When you use the tab strip with navigation disabled, you are looking for which tab the user clicked on (the selectedTab property). This is set to the Window Name of the tab, so these should always be distinct. I normally end up making them similar to the text being displayed on the tab to reduce confusion.

1 Like