5/22/2011

Cimplicity Trending Logged Data

http://www.cadfamily.com/HTML/Article/Cimplicity%20Trending%20Logged%20Data_538.htm

Now we move on to create a trend chart based on historical information. Let’s recap to make sure we are all together. First, we made a screen using SmartObjects to save time. Then we built a trend chart to see the data coming in from the Cimpdemo points of the demonstration project. Then we turned on logging so that some of the data would get recorded into a database table. Now we can build a trend chart that displays that logged data. This is sometimes called “historical trending” since it shows us the history of a process.

Before we build the screen, make sure the demo project is running. You can use the CIMPLICITY Workbench to start it if needed. Then, start the demo points by setting DEMO_POINTS_START_STOP to 1 using the Point Control Panel. Why? Because if we don’t start it running, there will be no data to see!!

Many of the steps are the same as when we first built a trend chart. In fact, you may want to re-check those notes if you get stuck. First, we create a new screen by opening up CimEdit from the CIMPLICITY Workbench. Then we insert an OLE object. Next we choose the “CIMPLICITY Trend Control” and add that in. Then we re-size it to fill our screen. It should look something like this:

As before, we double-click on the trend chart to access its properties. The Properties pages let us vary all the parameters of a trend chart. Under the Lines tab, click on the “New” icon to make a new line. This time, change the Line Type from Point to Line Type “Logged.”

Under Data Source, we will use CIMPLICITY Point Logging. This should be the default.

Click the browse button to the right of the Table ID field. All the logged points will be displayed. Notice that we can limit this to a particular table with the above search fields. If there are lots of points defined for logging, you can enter the name of the table we want – DEMO.

Double-click on one of the points. Let’s use DEMO_SAWTOOTH. It will be added to the list of lines. Notice that we could choose to just enter the point name as the Column ID. The Line ID will automatically be set to the point name to serve as the line’s label for the chart.

You have seen both “Logged” and “Logged Point” in the Line Type field and are probably wondering what the difference is between the two. Logged Point will allow you to have a combination of both Logged and Current data within the chart for that point.

Now close Help. Let's add more lines to the trend chart by repeating the above process. Add the following points: DEMO_COSINE and DEMO_SINE. Select Logged for the line type of each Point.

Click OK to close out of Trend Control Properties. Now let’s test your screen. Remember how? Use the Test Screen icon - the little light bulb on the toolbar. What you will see depends on how long the DEMO points have been running! (Make sure that the DEMO_POINTS_START_STOP point is set to 1 through the Point Control Panel.) Remember the logging defaults we took? Go ahead and look back - we let it sample every five seconds - so it will take a while for a few points to come in and get into the database.

Now there should be at least some data on the chart. Notice that you can use the scroll buttons to scroll backward and forward in time to view your logged data just like you could do with a current trend chart. And the legend will tell you the date & time of the data samples and their values at that time.

But what if it scrolls too much or too little? After all, how much “enough” is depends a lot on your data. Check it out in the Trend Control Properties in the Chart Tab. Click on the Advanced button. Change the scroll percentage.

Don’t forget that you can print the screen. Then you can take a hardcopy over to someone else to discuss what's going on. And color printers are supported! In fact ANY printer supported by Windows can be used. Of course, if you find yourself sharing color data with another person on a regular basis you may want to consider setting that person up with a CIMPLICITY HMI Viewer so that they can see the exact same data on their PC whenever they need to!

Ok, now close the test screen. We want to use this screen again in a later lab, so save it as “TrendHistory.cim.”

If you are not going to proceed with the following sections, you need to stop the logging to prevent you from using up unnecessary disk space everytime you run the demo project. Go back to the Workbench and double-click on the Database Logger icon to bring up the CIMPLICITY Database Logger Configuration dialog box. Select the DEMO table and delete it to stop the logging of the DEMO points. Don’t worry – you will still be able to chart the historical data even without the table!

No comments: