Info |
---|
Download the |
solution HistorianToCSV.dbsln |
Solution Name: HistorianToCSV
Software Version: 10.1Built 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
This solution uses the TrendChart
for visualizing tagsto visualize tag values that
are changingchange over time
whenwhile the solution is running. Each
Penpen (
Tagtag value)
hasis displayed in a different color
inon the graph
that, which you can
configure as you want, such as a legend that you can modify itscustomize, along with the legend position. All
thegraph
information will be saved indata is saved to a file with the default extension
asof .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
exported, through this url. Through this URL, the WebBrowser can access the path of the file and
showdisplay 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
changemodifying 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 at Historian (Time-Series Data).
In this section:
Page Tree | ||||
---|---|---|---|---|
|