Download the Solution Example here: HistorianToCSV.dbsln
Solution Name: HistorianToCSV
Software Version: 10.0.6
Keywords: HIstorian. Export. CSV.
1
Summary
This solution example shows how to Export Historical data to a CSV file.
Technical Information
This solution uses the TrendChart for visualizing tags values that are changing over time when the solution is running. Each Pen (Tag value) has a different color in the graph that you can configure as you want, such as a legend that you can modify its position. All the graph information will be saved in a file with default extension as csv.
In TWebBrowser, it is possible to view the content of the file and in settings you can configure the Url of the file exported, through this url the WebBrowser can access the path of the file and show its content in display. Besides, the file will be saved in the same path as your solution, but you can change that, going to Displays → MainPage → CodeBehind , and change 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); |
References Information
→ Learn more at Historian (Time-Series Data).
In this section:
Page Tree | ||||
---|---|---|---|---|
|
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 used 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.