The Data Trending feature is used to
 observe and configure the trending status and its variables.
When you select the Data Trending icon from the Workbench left hand pane, the Trends window appears in the right hand pane with a table showcasing all of the current trends and a row of buttons of possible actions.
                                                 
                                            
Within the tab, Retention can be edited.
- 
                                                    Retention: This option defines a schedule of the life-cycle of the Variable Data. Through its definition it is possible to set how many days, weeks, months or years will be the life-cycle of a Variable Data. 
If any change is made to Retention, click the Save Button to save the changes.
Trend Definition
To add a Variable to the Trends pane, it is needed to follow a step by step:
                                                 
                                            
- 
                                                    At the bottom left of the screen, click New, the pop-up bellow will appear prompting you to provide the required data; .png)  
 The configuration parameters are:Parameter Description Variable Name The source Variable Name. Priority(ms) The Priority defines the frequency (ms), that the device variable are read. Retention This option defines a schedule of the life-cycle of the Variable Data. Through its definition it is possible to set how many days, weeks, months or years will be the life-cycle of a Variable Data. Deadband The minimum value change required to record a variation of data. Prevents logging small insignificant variations. 
- Select the Device Variable; 
- Select the Priority in Milliseconds; 
-  Define the Retention; 
-  Finally, choose the Deadband; 
-  At the end, click OK. The new variable will appear on the listing.
Starting Trending
To start a Data Trending it is a pre-requisite to have a Variable that already exists. Only then can the Data Trending be started.
To start, click the button "Start" at the bottom left, on the Trends pane, the trending status will then be changed to "Started". It is also possible to right-click the specific Variable and choose the Start option on the list that opens.
                                                 
                                            
Stopping Trending
To stop the Data Trending, click the second button from the bottom left, on the Trends pane, which says "Stop". The trending status will then be changed to "Stopped".
                                                 
                                            
Deleting Trending
To delete a Trending, select the Trending Variable from the table and press the button "Delete" at the bottom of the tab.
                                                 
                                            
A confirmation pop-up will appear, asking if the deletion is supposed to proceed. Click Yes and the selected variable will be deleted.
                                                 
                                            
Service Input / Output JSON
| Command Name | Input/Output | Service Name | JSON Format | Description | 
|---|---|---|---|---|
| trend.service | Input | start | {"cmd": "start","variable":"*"} | "*" All Variables | 
| Output | {"Status":"OK"} | |||
| Input | stop | {"cmd": "stop", "variable": "*"} | "*" All Variables | |
| Output | {"Status":"OK"} | |||
| Input | start | {"cmd": "start","variable":"simulationDev.Random.INT1"} | Starting Specific Variable | |
| Output | {"Status":"OK"} | |||
| Input | stop | {"cmd": "stop","variable":"simulationDev.Random.INT1"} | Stopping Specific Variable | |
| Output | {"Status":"OK"} | |||
| Input | list | {"cmd": "list","variable":"*" } | List all trending variables | |
| Output | {"TrendVariable":[{"id":1,"name":"SimulationDevice. Waveforms.Sine","createdDate":"2023-02-11 01:04:57","priority":500,"sampleRate":1000}]} | |||
| Input | fetch | {"cmd":"fetch","from_date":"2023-02-06 16:09:05", "to_date":"2023-02-06 16:10:55", "Variable": "simulationDev.Random.INT1", "seed":"0", "max_items":"10"} | Max 10 samples to be fetched | |
| Output | {"tablename":"TREND_2023_02_06","seed":19, "variableName":"simulationDev.Random.INT1", "sampleRate":5000, "dataSamples":[{"ts":"1675699767000", "segment":[-9,90,-31,101]}, {"ts":"1675699793000","segment":[-4,102]}, {"ts":"1675699843000", "segment":[-22]},{"ts":"1675699849000", "segment":[-93,12,-108]}]} | |||
| Input | delete | {"cmd": "delete", "variable":"simulationDev.Random.INT1"} | ||
| Output | {"Status":"Deleted", "variable":"simulationDev.Random.INT1"} | |||
| Input | add | {"cmd": "add","variable":"simulationDev.Waveforms.Sine", "priority":"1000"} | ||
| Output | {"Status":"OK"} |