Just wondering what the options for trending on perspective are right now/what is planned for the full v8 release. Just trying to migrate my PID popup to Perspective, and it has a small SP/PV/CO trend to help with tuning. I found this thread which gives some information on how to achieve this using an XY chart, but noted that it’s quite complex and would eventually be superseded. Just trying to work out whether it’s worth putting the effort in to get it working now, or if I’d be better off leaving it on the back burner for a short time until a less complicated method is available?
You can bind an XYChart to a historical log on a tag. I would get it working with static tags first and then if you’re feeling ambitious you can try to make it dynamic.
I’ll assume you have historical logging on some tags you want to trend.
Click on your XYChart Instance. Under “Datasources” you will see a property called “example”. Click the binding chain on the “example” property and bind that to the tags. Enter an alias for your data points (I usually take a picture with my phone so I don’t have to remember the aliases).
Ok, that’s what you do to set up the data source. It’s a little confusing because you’re binding to the “example” property; not the datasource property.
Now, go down to “series” and expand it. Inside there you will see a “data” property that is sourced to “example”. Change the “y” property within that property to whatever alias you assigned to the data point.
After those steps you should see a line on your chart.
The “label” property on the “series” determines the label that displays on the chart for that series. You can also name the series but that doesn’t seem to impact anything as far as I’ve seen. You will also see that the “yaxis” property has text in it. That name will correspond to one of the axes (by default) that is defined by the “yAxes” property.
One really big time saver is that you can copy/paste the heirarchy of properties that correspond to a series or axis to duplicate the look/feel you have on other pens in your series. I think you need to create a base structure first so I typically go to the last series on my chart and click “add array element” at the bottom of it. Then I copy/paste one of the series I already configured to get the properties roughly similar to the rest of my chart (time saver). The chart will auto-pick line colors for a series if you don’t specify. If you want to specify; simply drill down to “line.appearance.stroke” to specify a color. From there, you simply assign the series to one of your data point aliases and it appears on the chart.
Thanks Steve, that’s a really helpful rundown!
I was hoping that some of the developers might also chime in with a status update on what’s planned for release 8.0 - if there’s going to be a much easier way to do all this next month, then maybe I’ll just put that part of my development on the back burner until then
You might also want to look at this thread
props to @cmallonee for his help.
There’s another thread somewhere in here where I asked about the coming changes to charting in Perspective. I can’t find it right now but some developers responded stating that they are still fleshing out their options for charting in Perspective.
My key take away from the discussion was that Perspective charting is going to improve at some point in the future but we don’t have an ETA yet. It is something they are actively evaluating.
There’s also another thread a while back where someone asked them if they were planning to implement some of the poster’s favorite Vision controls in Perspective. The response was that they plan to implement everything Vision can do and more. Perspective is in the really early stages. They’re actively focused on building a solid foundation and then later building onto that foundation.
I got the example working and thought it would be good to explain the one configuration point to those who are new to the Ignition 8 file structure.
Ignition now stores your project files in your install location. Default location for Ignition projects on Windows is:
C:\Program Files\Inductive Automation\Ignition\data\projects\
So what you want to do is:
create a project or use an existing one
add a perspective view to it to create the folder that views are stored in.
Import the demo tags (the json file) into a tag folder called “Experimentation” (see the binding on the chart control).
After that you want to:
close the designer
navigate to the place Ignition stores your views
Create a folder in windows for your new view
unzip the 3 files in the TabulaRasa.zip to that folder
The designer will recognize the screen when it loads. You might be able to just refresh the list. I didn’t try that.
That will get you set up with the example.
The onClick event for the button looks at which data points are selected and sends them to the “XYDATACHANNEL” message handler. You’ll find the handler for that by right clicking on the chart and viewing scripts.
This is a great example to get some level of understanding of how to use message handlers (was helpful to me at least). It also shows you how to plug in the stuff you want to the appropriate properties.
For what it’s worth - adding the files to the filesystem, waiting a few seconds, then selecting ‘Update Project’ from the designer menu would also work; the gateway doesn’t (cannot) really differentiate between its own changes and external changes, since everything’s on the file system, so it has to be aware of those changes all the time.