Trending and Data Logging

Home / FactoryTalk Optix / Alarms, Trending, and Data Loggers

Unlock Your Data: Easy Trending and Logging with FactoryTalk Optix!

Ever wondered how to keep a close eye on your industrial data, not just in real-time but also historically? This “Trending and Data Logging with FactoryTalk Optix” video demonstrates just how incredibly easy it is to set up robust trending and data logging features within FactoryTalk Optix.

The video picks up from a previous project, featuring a pump (Pump 101) with an animated yellow indicator and associated data, using Logix Echo and Studio 5000 for emulation. The main goal is to add a real-time trend and a data log to the Pump 101 screen.

Step 1: Setting Up a Real-Time Trend

First, the video guides us through creating a real-time trend.

  • Navigate to your desired screen (e.g., Pump 101 screen).
  • Right-click, select “New,” and then “Data Controls”. This is where you’ll find various data-related options like Combo Box, List Box, Data Grid, and importantly, Trend.
  • After adding the Trend object, you can resize and position it.
  • In the trend properties, you can re-scale the Y-axis (e.g., from -100 to 100 to 0 to 100) to match your data range.
  • To add a data point (a “pen”), you simply browse your communication drivers, tags, and select the desired variable (e.g., Flow from Pump 1’s controller tags).
  • Once configured, running the emulator shows the real-time trend, allowing you to click, move around, zoom, and see timestamped values.

A key insight: While useful, a real-time trend has a limitation – if you navigate away from the screen and return, the trend clears out and starts over. This is where historical data logging becomes essential!

Step 2: Enabling Historical Data with a Data Log

To achieve historical trending, you need to set up a Data Log. The easiest way to do this is by using the wizard on the dashboard.

  • The wizard guides you through the process, starting with naming your Data Logger (e.g., DataLogger1 for Pump 1).
  • You choose a sampling mode: Periodic Sampling (e.g., every 1 second) or Change in Value.
  • Next, you configure the database. The video uses the embedded Optix database, but you also have the option to tie into an external database. Be aware that creating this database at runtime requires one token, and an ODBC connection also takes a token.
  • Finally, you select the variables you want to log (e.g., just Flow for Pump 1, though you can log more). The wizard confirms successful configuration.

Step 3: Displaying Logged Data with a Data Grid

Once the Data Logger is set up, you can display the logged information.

  • Back on your screen (Pump 101), right-click, go to “Data Controls,” and select “Data Grid”.
  • To link the Data Logger to the Data Grid, simply drag and drop the Data Logger from the “Loggers” folder in your project view onto the Data Grid.
  • The Data Grid will show logged data, including a Universal Time Timestamp and a Local Timestamp (tied to your computer’s time zone). You can further customize its properties.

Step 4: Connecting the Trend to Historical Data

This is where the magic happens for historical viewing!

  • Click on your existing Trend object to bring up its properties.
  • Under “Trend properties,” there’s a “Model” section. Drag and drop the Data Logger you created onto this “Model”.
  • Crucially, this action changes the pen’s source from directly reading the controller tag to being tied to the tag within the Data Logger.

The Result: Real-Time View with Historical Persistence!

When you start the emulator now, you’ll see:

  • Your Data Grid actively receiving and displaying new data points.
  • Your Trend chart displaying historical data.
  • The most significant benefit: If you navigate to other screens and then return to Pump 101, the trend data persists – it does not clear out or reset!. This means you can scroll back and analyze historical trends without losing data.

This setup allows you to view logged data, which can even be exported to a CSV file, and get a continuous historical view in your trend chart. The video concludes by emphasizing that trending and data logging are “incredibly easy to set up here in Optix”.


Transcript
(00:01) in this video I want to show some of the features of trending and data logging in Optics and I’ve kind of taken a previous project that I had started in some other videos and I’ve kind of cleaned it up a little bit I’ve uh you know in some previous videos I had kind of made a face plate um and I I I was able to kind of deploy that face plate and tie it to UDT and the Logics controller we still have that going on if I were to start this pump 101 see it kind of animates to a yellow indicator and I’ve got a little
(00:37) bit of data going here um I actually have U logic’s Echo running in the background and some and some logic uh in my uh Studio 5000 emulating a control Logics so what I want to do is I want to come to this pump 101 screen I’m going to add a a real-time Trend and I want to add a data log uh to this page so I’m going to turn off the emulator here so first part will just be um a trend and that’s fairly straightforward so uh I I’ve created uh a couple screens ahead of time I got this pump 101 screen right here if I right click on the pump
(01:19) 101 uh screen or page I’m going to say new and I’m going to go to data controls so in the past we’ve been going to base controls and finding all things such as LEDs and buttons and whatnot and we’ve gone to containers to add panels or screens this time we’re going to go to data controls and we see we have some options here for combo box list box data grid Trend and even some chart features like XY and pi and histogram and the new spark line is a part of a 1.
(01:54) 3 release is also here under data controls I want to do a trend first I going to go with Trend and going to kind of just fit this into the space a little bit and doesn’t really matter what we do there but we’ll kind of resize a little bit so properties of the trend of course will be over here and if I scroll down a little bit we can see that the uh we have a pen y AIS and it shows us a minimum value of minus 100 and a maximum of 100 I can go ahead and rescale this to zero because in this example my um my logic actually is going to run from 0 to
(02:36) 100 so that’s my range and then for pens we I have one pen here already created by default I can create multiple pens by hitting this uh plus symbol add additional pens but for right now I just want to Trend the flow which was coming from the UDT from the uh from the Logics controller so if I scroll down and find my com drivers my ra ethernet driver my echo CPU and then my tags controller tags pump one and finally flow and hit select and that’s pretty much it so we’re going to this will just basically be a real-time
(03:19) Trend and uh so let’s go ahead and uh put this in the emulator and see what it does all right so we come to pump 101 screen if I go ahead and start my pump we’ll see we have some data that’ll get generated here now uh this little feature here in the widget is the spark line the new spark line feature so it it kind of gives a a little Trend as well this is this is but this is the true Trend um object right here now if I were to click on in in the space we see that we can actually kind of move move around and click and and get a value so a time
(04:08) stamp and a value so that that’s good we can kind of zoom out a little bit zoom in a little bit and uh and see but this is a real-time Trend meaning that if I were to go back to my summary page and I come back to my pump 101 the trend kind of clears out and starts over again all right so real-time Trend now to do uh historical trending we’ll need to set up a data log first so I’m going to go ahead and uh might scrunch that down just a little bit so we’re going to add a data log here or create a data log first so the easiest
(04:48) way to create a data log or a Data Logger is to go back to our dashboard and use the wizard that’s here on a dashboard to configure a Data Logger um the Wizard’s nice because it’s going to kind of Step us through and we don’t forget about creating U you know creating all the things we need so first uh new Data Logger uh by default it’s Data Logger one I think that’s fine for me because this will be tied to pump one and I’ll leave it as you know one for pump one your options here are periodic sampling or change in value or of course
(05:25) none uh but change in value or periodic I think I’ll go with period iotic and leave it for one second um just for example purposes uh and we’ll hit next so just kind of affirms what we’ve done so far we’ve G we can you know change the name if we still want to and we could change the sampling mode if we want to as well as a sampling period right now it’s set to 1 second going to hit next because it’s going to ask about the database so we’re going to create a database now we have the ability to use the embedded database this will be in
(06:02) you know embedded Optics database or we could tie it to some sort of external database but uh we’ll go ahead and use the embedded now note that when we go to runtime with this to create this database would require one token from our runtime um tokens as well as if we’re going to tie to an OD obbc connection that would also take a token so I’m going to go ahead and call it embeded database 1 I’ll leave it as default as well we’ll say next and uh in memory properties false or true we’ll leave it false and uh we’ll say
(06:47) next now next is actually lets us go and select our variables so being that this will be tied to pump one I’ll come down here to com drivers ra ethernet IP Echo tags controller pump one I’m just going to log the flow I could could of course log additional variables here but I’m just going to go with flow for the moment hit next so right now everything’s uh it’s done successfully configured and we’ll say exit if I come back to my pump [Music] 101 um first we’ll we’ll uh before I go back can change the the the trend I want
(07:33) to also add a a data um view or data log window here on the screen so back here on pump 101 I can rightclick I say new go to data controls and I could say a data grid and we’ll just kind of go ahead and stretch that to kind of fit in the space go with bit bigger there so all we got to do now is tie the Data Logger to this data grid and to do that we can uh come down we see in our our project view we have a a loggers kind of folder and we this Data Logger one that we just created so I could take this and drag it
(08:20) and drop it into the uh the data grid now there are some um you know options to this data grid that we can change uh if we want here in the properties um it does show a Tim stamp and a local Tim stamp so the the time stamp itself is is a universal time whereas the local time stamp is uh tied to my computer and my my um um you know time zone and we can control some other you know other um just features through this uh property so you can kind of scroll through this and set it up to your liking um now if uh to tie the the trend chart we created
(09:09) back a few moments ago to the historical data versus the realtime data I’m going to click back on this on the U Trend get the properties for the trend back up here again so we have this model up here under Trend properties I’m going to take the Data Logger that I created earlier drag it and put it onto the model now when I when that happens the the flow last value now changed here under the pen so the before the pen was tied to the um to the tag uh from the uh controller now it’s tied to the the tag and the Data Logger all right so now
(09:58) when I go back into the uh em we’ll be we’ll get data here in our time in our data grid we’ll also get the historical data in our Trend so we go ahead and start the emulator all right so I left my pump running uh before so it’s still running now so we see that we we’re getting data in our in our data grid down here we’re also getting historical data right now in our Trend chart and the same thing here I can scroll back and look now of course you know just started the emulator a few moments ago so so it only went back a few moments but here’s the
(10:40) difference if I go back to my other screen and then jump around to some other screens if I come back to pump 101 my data is still there so it did not lose lose the data it did not reset the trend chart so by creating in an embedded database by creating a Data Logger um you know one I can I can get a uh you know a data view down here and I am actually logging this data where I could you know export this to a CSV file um but I’m also getting the uh the historical view in this trend chart all right so trending and uh data logging
(11:24) are very incredibly easy to set up here in Optics