//CSharp code


string path = Stream.Application.GetAppPath() + @"\Log\data.csv";

string tags = "Data.TS,SIM.Ramp1";


// Write header if new file

if (!File.Exists(path)) {

Stream.FileSystem.WriteTextToFile(path,"TimeStamp,TagName1",true,true);

};


// Get current time stamp

SetValueStr("Data.TS",DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));


// Write data to file

Stream.FileSystem.WriteTagsToFileCSV(path,tags,true,true);