One graph for many tanks

I have four tanks for which I would like to graph a few attributes (level, temperature, pressure, etc.). Rather than making four graphs, I would like to have a drop down list or radio button array or something where the user can select a tank, and have the graph refresh with that tank’s data. Any thoughts on how to do this? TIA D. Lewis


A dropdown would be the easiest way of accomplishing this. It is really quite simple.

Place a new dropdown onto your graph screen. Edit its dataset so that it looks like:

1, “Tank 1”
2, “Tank 2”
3, “Tank 3”
4, “Tank 4”

(Dropdown datasets should have two columns - the first one should be Integer, the second String. The string values will be displayed in the dropdown, and the Integer values will be used for the dropdown component’s selectedValue property)

Now, bind your graph’s datasets to queries like:

SELECT t_stamp, level, temperature, pressure FROM TankHistory WHERE TankNum = {Root Container.Dropdown.selectedValue} ORDER BY t_stamp

OR if your histories are in different tables, it might look like:

SELECT t_stamp, level, temperature, pressure FROM TankHistory{Root Container.Dropdown.selectedValue} ORDER BY t_stamp

Any SQL query binding can include text from properties on the window. This is a great source of flexibility in FactoryPMI.

Note- if you are using the Graph goodie window from our website, the technique is slightly different. Respond back if this is the case.