Get files and send them to excel

Hello, good morning. How are you?

I would like, while my application is running, to create an excel file capturing all the values ​​that are happening, such as “Speed”, “Temperature”, every second it is updated, I tried using C# and was not successful, could I to help?

Hello Thaylor,

You can utilize the historian features available in Factory Studio. Simply add the tags you wish to save to an Excel file in a historian table. Then, you can use the ‘SaveToTextFile’ method in the ‘T.Modules.Historian’ namespace, within the ‘HistorianTable’ class, to export this historian table to a .csv file.

Here’s an example:

public void Main()
{
bool ret = @Historian.Table.Table1.SaveToTextFile(“06/04/2022 2:10:00 PM”, “27/04/2022 5:00:00 PM” ,@“C:\Users\User\Documents\test.csv”, “,”, true, true, false, 2, null);
return;
}

Also follow the link for our documentation:
https://docs.tatsoft.com/display/DOC91/Namespaces

If you have any further questions, feel free to ask!

Best Regards,
Tatsoft team.