Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Download the Solution Example here: HistorianToCSV.dbsln

Solution Name: HistorianToCSV

Software Version: 10.1


Summary

This solution example shows how to Export Historical data to a CSV file.


Technical Information

This solution project uses the TrendChart for visualizing tags tag values that are changing change over time when the solution is running. Each Pen (Tag value) has a different color in the graph that , which you can configure as you wantlike, such as including a legend that whose position you can modify its position. All the graph information will be saved in a file with the default extension as .csv.
In TWebBrowser, it is possible to view the content of the file, and in the settings, you can configure the Url URL of the exported file exported, through this url . Through this URL, the WebBrowser can access the path of the file and show display its content in display. BesidesAdditionally, the file will be saved in the same path as your solution, but you can change that , by going to Displays → MainPage → CodeBehind, and change 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);



References Information

→ Learn more at Historian (Time-Series Data).


In this section:

Page Tree
root@parent
spacesV10