Info |
---|
...
title | info |
---|
...
Download the |
...
Solution Name: HistorianToCSV
Software Version: 10.0.6
Keywords: HIstorian. Export. CSV.
...
solution HistorianToCSV.dbsln Built with v10. This solution example shows how to Export Historical data to a CSV file. |
Summary
This solution example shows how to Export Historical data to a CSV file.
Technical Information
Data Logging is the generic term that refers to the process of collecting and storing data over a period of time. The data is typically use to plot trend charts, data analytics, performance monitoring, regulatory compliance, process controls and operations management.
This solution example presents an out-of-box solution for Export the Historical data to CSV files. Certainly, it's also possible to add in your solution additional data logging procedures, using the Modules Scripts (.NET programming) and Datasets (SQL storage), but the vast majority of the typical requirements on data logging are covered using the standard configuration tools of Historian Module.
References Information
See the Historian section.
This solution uses the TrendChart to visualize tag values that change over time while the solution is running. Each pen (tag value) is displayed in a different color on the graph, which you can customize, along with the legend position. All graph data is saved to a file with the default extension of .csv.
In TWebBrowser, it is possible to view the content of the file, and in the settings, you can configure the URL of the exported file. Through this URL, the WebBrowser can access the path of the file and display its content.
Additionally, the file will be saved in the same path as your solution, but you can change that by going to Displays / MainPage / CodeBehind, and modifying the lines of code as in the example below:
Code Block |
---|
@Tag.SelectedFileName = "";
@Tag.SelectedFileName = @"Path" + @Tag.OutputFilename;
bool ret = @Historian.Table.Table2.SaveToTextFile(@Tag.StartDateTime.LocalDateTime, @Tag.EndDateTime.LocalDateTime, @Tag.SelectedFileName, ',', true, true, true, 6, null); |
Note that, in this code example, 'ret' stores the return of the SaveToTextFile method, indicating success (true) or failure (false).
References Information
→ Learn more at Historian (Time-Series Data).
In this section:
Page Tree | ||||
---|---|---|---|---|
|
...