To display a trend recording in the visualization, you define which application provides which trend recording. You define the display by means of the “Properties” of the trend element and the controls used.
Defining the application and data source
The visualization task and the trend recording task generally run under the same application. If this is not the case, then the application containing the visualization task requires a data source manager.
-
Select a trend element in the active visualization editor.
The properties of the trend element are displayed on the right side.
-
Double-click the value field “Properties Application”.
-
Use the Input Assistant (
) to select the application. You can also specify the name of the application directly.
See also
Adding a control
-
Select a trend element in the active visualization editor.
-
Click “Visualization Insert Elements for Trend Controlling”.
The “Trend Wizard” dialog opens.
-
Select the desired control. Examples: “Date Range Picker”, “Time range Range Picker”, “Legend”. Click “OK” to confirm.
The selected controls are inserted for the trend element. You can move them to any position you like. In the “Properties” of the trend element, the controls are shown below “Assigned controls”.
Defining the trend recording to visualize
-
Select a trend element in the active visualization editor.
The properties of the trend element are displayed on the right side.
-
Click the value field of “Properties Trend recording”
“Select trend recording” is displayed. The trend recordings available application-wide are listed under “Available trend recordings”.
-
Select a trend record below “Available trend recordings”.
-
Click
.
The trend recording is located under “Selected trend recording”.
-
Click “OK” to confirm the entry.
The selected trend recording is listed in “Values” in “Properties Trend recording”.
See also
Removing a control
A control that was added with the help of the “Trend Wizard” cannot be deleted via the Trend wizard dialog.
-
Select a control of a trend in the active visualization editor.
-
Press [Del] or “Delete” to delete the element.
-
Select the trend in the active visualization editor.
-
Delete the assigned value in “Properties Assigned controls <control>”.
NOTICE
It is absolutely necessary to delete this reference manually. The property is not deleted automatically by deleting the control.
Configuring the coordinate system of the trend diagram
-
Select a trend in the active visualization editor.
-
Use the “Visualization Configure Trend Display Settings” command.
The “Display Settings” dialog opens.
-
Adapt the settings as needed.
Reading a trend value at runtime
-
Open “View Element Properties”.
-
Select a trend element in your visualization.
The properties of the trend element are displayed on the right side.
-
Select the “Properties Show cursor” option and “Show tooltip”.
A cursor is drawn in the coordinate system.
-
Select the “Properties Show tooltip” option.
-
Download the application to the controller and start the application.
-
If the diagram "runs”, then the date range has been placed in such a way that its end time is the current time.
Select the date range so that the diagram does not run. If necessary, drag the scroll bar to an earlier date range.
A cursor is available. The tooltip of the cursor informs you of the trend values. For each trend variable, the legend displays the value at the point in time at which the cursor is positioned.
Deleting the trend recording history
You can insert an input element in the visualization which the operator can use to delete the previous value recording in the trend visualization at runtime. The curve displayed until then is removed and the display starts over.
-
In the application (example: in the program
PLC_PRG
), implement the following code:itfTrendRecording : ITrendRecording; itfTrendStorageWriter : ITrendStorageWriter; itfTrendStorageWriter3 : ITrendStorageWriter3; sTrendRecordingName : STRING := 'TrendRecording'; itfTrendRecording := GlobalInstances.g_TrendRecordingManager.FindTrendRecording(ADR(sTrendRecordingName)); xClearHistoryTrend: BOOL; IF xClearHistoryTrend THEN itfTrendRecording := GlobalInstances.g_TrendRecordingManager.FindTrendRecording(ADR(sTrendRecordingName)); IF itfTrendRecording <> 0 THEN itfTrendStorageWriter := itfTrendRecording.GetTrendStorageWriter(); IF __QUERYINTERFACE(itfTrendStorageWriter, itfTrendStorageWriter3) THEN itfTrendStorageWriter3.ClearHistory(); END_IF END_IF
-
In the visualization of the trend recording, add a button for deleting the previous curve. Configure its “Toggle” property with the variable
PLC_PRG.xClearHistoryTrend
.When
xClearHistoryTrend
is set toTRUE
, the previously recorded curve is deleted. The recording immediately starts again.