Home / FactoryTalk Optix / Alarms, Trending, and Data Loggers
Description
The Advanced Trend for DataLogger widget is available in the FactoryTalk Optix Studio template library. The advanced trend widget provides for advanced controls of trend charts when using data from a data logger.
This video provides a demonstration of using the standard trend object as well as the advanced trend widget.
Contributed by Wayne Welk – YouTube – LinkedIn – GitHub
Transcript
(00:01) Okay, I want to come back to the trend chart in optics just to show some some additional features. Um, I’ve already kind of set up a little something here to get our demonstration going. Um, basically creating some simulated variables. There’s a a net logic um of code that’s in the template library that essentially just creates a sine wave, a cosine wave, and a ramp.
(00:27) And uh there’s a a run uh simulator enable bit here that you have to turn on and off. Uh so we’re just going to use that simulator data. And uh back here on this screen one, I have the standard trend chart. Um, and uh, one other thing that I’ve set up ahead of time was I set up a data logger and I set it up a uh, embedded database to store that sign, cosine and ramp um, variable to the database.
(01:03) And the reason why I kind of do this is I want to show you that uh, you know there are some some properties to this trend chart that you can kind of tweak with. Not a lot. Um, but then there’s something in the template library that is an advanced trend widget that that I will show you. Um, but to kind of just show the basic trend, you know, what I’ve done is, you know, we put a trend object here on the screen.
(01:29) And again, to find that, you can go to new and then data controls and then there’s trend and put that on there. Um and then uh under the trend properties I I uh linked the model to the data logger that I created. So I have a data logger called data logger one. I just basically connected uh made a dynamic link to that data logger one for the model.
(02:04) When you do that, uh the pins automatically populate for the three variables that I am currently trending. So pin one will be our sign, pin two will be our cosine and pin three will be our ramp uh value and they will be coming out of the out of the data logger. So this will be acting as a historical trend. Now, what I want to show you is that um you do have a couple of you know uh properties to each pin such as the thickness, the title, the threshold, the color, and if it’s enabled or not.
(02:42) And each of these objects um the title, the thickness, the color enabled, they are all dynamic links. So, I’ve made a u to kind of just build a little custom uh kind of trend. I I’ve I’ve added a couple of little sliders and um so that if I, you know, if I change the state of this uh little switch here, I’m going to enable or disable the pin.
(03:17) So, uh we’ll just see this actually happen once I start the emulator. So the emulator uh comes up into the window. So first I need to start the simulator. So the simulator is now running. And now let’s enable our pins. So if I wanted to control what I want to show on this screen, I can basically have a little switch here that will enable or disable each pin, right? So I can completely control what I’m what I’m going to um show here.
(03:56) So that’s just the what the basic um basic trend object. But what I want to show you is if I go to I’m going to go to screen two which is a blank screen. If we go to the template library and if we click on widgets. So, there’s a whole kind of folder here or a library of widgets that come with optics. Um, I invite you to look at all these widgets because there’s a lot of different ones that can solve some various um, you know, little um, issues or problems you might be facing.
(04:29) But the very first one is an advanced trend for data logger. And basically this there’s a description down here that says this allows you to display interact with a data logger using some advanced trend capabilities. It enables extracting statistical data from ranges interact and uh with displayed pens and much more.
(04:48) So instead of having to go build your own kind of custom trend like I was just doing there uh on screen one, we can use this advanced trend uh from the uh from the widget uh library. Now, to use the widget, I’m going to come back here to my project view, and I’m going to just take this. This is a folder, the little folder symbol.
(05:10) So, I’m going to take this. I’m going to drag it. I’m going to drag it to the UI folder. And when I do that, it puts the advanced trend as a folder underneath UI. Close the tempo library. So, here I am on screen two. So to use this on screen two, I’ll rightclick. I’ll say new. And now I have advanced trend as one of my options to choose from.
(05:39) And then I have components which are kind of the individual pieces of this or just the advanced trend main. And that’s what I want to put here is the advanced trend main. So this is the widget. Now, it’s a little bigger than my um canvas. So, I’m just going to take the corner there and resize this.
(06:07) So, to use this is essentially all I need to do is tie the data logger that I want to put the data from to this widget. So, there’s already a pull down menu here and it will basically find all the data loggers that I have created. And I’ve only got one right now. So I’m going to choose data logger one. The only other options we have here are if it’s visible, if it’s enabled, opacity, rotation, um, hit test and move target.
(06:43) So um, and as well as sizing properties. And that’s pretty much all there is to do for this widget. The widget will do everything else. Now let’s start the emulator one more time. All right. So here’s our screen one. I will enable the simulator and I’m going to go ahead and just show that we are getting data.
(07:10) Now if I come back to screen two, here is the advanced trend uh widget. Now, it already had some historical data, you know, from before. That’s what this is. And here’s our our kind of recent sine waves and cosine waves that we created. Now, just like I had a minute ago, um I can control which pins I want to see on this advanced trend object.
(07:37) Um, so some of the things I can do here too is I can I can change thresholds as well as change the color of the pins dynamically and the thickness. So if I want to increase thickness on my sine wave, I can do that. If I want to change the color, then I can use this uh kind of slider uh to define my RGB color. So now it’s going to be red.
(08:10) Maybe we make our cosine um green and let’s make our ramp um blue. All right. So I can change colors dynamically with the sliders. I can change thickness and control if I want to view that data or not. Now the other uh items have we have here are things like the range, our start date and end date um as well as our settings um icon which brings us to you know the types of modes and um and additional um settings here.
(08:54) Do we want to um this you know this the the time window this is the last five minutes. We can change the time window to the last um minute instead. Uh can do trace time range or normal mode. We can change our min and max uh values. Uh right now it’s set to autoscale, but if we wanted to change it on our own, we can take it out of autoscale and change the range, uh the position left or right for our our y-axis.
(09:32) And then we can also, you know, turn off legends and all this. So we can tweak our our trend chart um without having to go build all this up on our own. Right? So basically that’s it. I want to show that. Um, and uh, you know, so again, you’ve got the, uh, the basic trend, which of course you can somewhat customize with your own controls, or we can use our um, advanced trend widget that comes right out of the template library.
