Hemendra Posted September 6, 2017 Share Posted September 6, 2017 Hello, I am using Data logging function; generating new .csv file every hour having data sampling at 10 second interval. first raw of file have Channel names. i want to keep my selection of name instead of Channel name here. please guide. Thank you, Link to comment Share on other sites More sharing options...
AzeoTech Posted September 7, 2017 Share Posted September 7, 2017 You can't with a logging set alone. You can with an export set, or by using file. functions to do the logging yourself. You also can create the file before starting the logging set by using file. functions to create the file and write the first line, then start the logging set. You'll have to change the logging set to not Include Headers. Link to comment Share on other sites More sharing options...
Hemendra Posted September 14, 2017 Author Share Posted September 14, 2017 hi Guru, with your further help and guidelines it was made ok with below code; while(1) private string newFileName = "C:\DATA\DAQ\Test programs\DATA_" + FormatDateTime("%y_%m_%d_%H.csv", systime()) if (logging.L2.strFileName != newFileName) endlogging(L2) Private FileHandle = File.Open(newFileName,0,1,0,1) Private string strText = "TheTime,Pressure,Temp D55,KWH,NA0H" File.Write(FileHandle,strText) File.Close(FileHandle) logging.L2.strFileName = newFileName endif delay(1) beginlogging(L2) endwhile Thank you Link to comment Share on other sites More sharing options...
AzeoTech Posted September 15, 2017 Share Posted September 15, 2017 Great. Notice how I created the file first before updating the logging set with the new file name. Otherwise, the logging set will create the file, locking it, and write data before you get to write your header. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.