A new feature, called TrendAnalysis, has been available for Elipse E3/Power since its version 6.0. This article will first present this new tool, and then show how it can be used in a demo application.
TrendAnalysis is a tool for displaying history data that uses tags provided by Elipse E3‘s automatic history service (the tag being used must be stored in a Historic). Therefore, the main resources from TrendAnalysis are:
- Capacity for large amount of data
- Clear time scale visualization for any zoom level
- Scrolling and zooming by escale or by area
- Searches by previous, next, or interpolated value
- Automatically updated displays
- Points can be viewed per quality or null values
- Permanent pens framework by axis
This tool is available both via GetTrendAnalysis method, for adding and editing, and ShowTrendAnalysis method (E3 Viewer), for viewing. The resulting window is in the figure below:
The options for setting up the tabs on TrendAnalysis are:
Displays tab
This tab shows the pens corresponding to the data available at Connections tab. Thus, the options available via right-clicking the Display are in the table below.
Option |
Description |
Select columns |
Allows selecting which columns will be displayed for the Pens |
Automatic update | Enables or disables automatic update mode |
Show rows in the grid | Shows or hides grid rows in the Pens area |
Show min./max. points | Shows or hides the Pens’ min./max. points |
Show local subtitle | Shows the subtitle with the Pen’s name and its respective color |
Interpolate | Uses interpolation to draw the Display |
Bookmarks tab
This tab allows adding a bookmark to a certain time period in a Pen. To do so, right-click the tab area and select New Bookmark to open the following window.
Connections tab
This tab shows the connection between Elipse E3 and the available tags in use for Displays. To add a Pen, drag a tag to the Displays area or then right-click a tag and select Add.
Displays area
The title bar in a Display will show an icon to represent the Displays’s reproduction mode, which can be either playing or paused .
When in playing mode, the Time Scale moves to the future, thus allowing you to track values in real time. Therefore, moving a Time Scale to the past or zooming it will not change the Scale’s direction.
So, for further details about the object’s settings, check the item TrendAnalysis our documentation.
Demo application
In order to demonstrate how a TrendAnalysis window loads previously saved settings (size and position), we used the following script:
Sub CommandButton2_Click() Application.ShowTrendAnalysis "TrendAnalysis Window", , _ , Application.GetObject("Dados.TagTrendSave").Value Set TA = Application.GetTrendAnalysis("TrendAnalysis Window") TA.SetWindowPlacement 400, 150, 800, 500 End Sub
If you wish to view a window with no pre-defined settings, use this script instead:
Application.ShowTrendAnalysis "TrendAnalysis Window", 200, 200, ""
To persist the object’s contents, there is a CommandButton on the initial screen whose job is to show a TrendAnalysis window and then load (via Load method) the TrendAnalysis’ settings:
Sub CommandButton1_Click() Set TA = Application.GetTrendAnalysis("TrendAnalysis") if (not Application.GetObject("Dados.TagLoaded").Value) then TA.Load Application.GetObject("Dados.TagTrendSave").Value, ConfigStatus If ConfigStatus <> 0 Then MsgBox "Error " & CStr(ConfigStatus) & " when loading configuration!" End If Application.GetObject("Dados.TagLoaded").Value = true end if Application.GetObject("Dados.Open").Value = true TA.Show End Sub
Additionally, there are two scripts on the initial screen (at OnStartRunning() and OnStopRunning() events) whose goals are, respectively, to add or recover the TrendAnalysis window under the identifier/title “TrendAnalysis”, and then save the settings:
Sub TelaInicial_OnStartRunning() Set TA = Application.GetTrendAnalysis("TrendAnalysis") Application.Item("TagTrendObj").Value = TA Application.GetObject("Dados.TagLoaded").Value = false End Sub
Sub TelaInicial_OnStopRunning() if Application.GetObject("Dados.Open").Value then Set TA = Application.GetTrendAnalysis("TrendAnalysis") Application.GetObject("Dados.TagTrendSave").Value = TA.Save Application.GetObject("Dados.Open").Value = false Application.GetObject("Dados").Save end if End Sub
To close TrendAnalysis window, use this script:
Sub CommandButton3_Click() Set TE = Application.GetTrendAnalysis("TrendAnalysis") TE.Close End Sub
Finally, use the script below to check whether there is a TrendAnalysis window open.
Sub CommandButton4_Click() Set TE = Application.GetTrendAnalysis("TrendAnalysis") MsgBox "TrendAnalysis IsOpened= " & TE.IsOpened End Sub
Attached to this article there is a demo application developed with Elipse E3 v6.0.199.
Attachments:
How can you demonstrate the loading of previously saved settings in a TrendAnalysis window?