File Selection


CFTAndy

Recommended Posts

Hi,

I have managed to get strings logging by using the sequence from the manual, however its hard coded to a specific file.

How can I change this to make it into a user selected file?

 

global string fileLoc
fileLoc = "C:\DAQFactory\Log.txt"

//open file ect
private FileHandle = File.Open(fileLoc,0,1,1,1)
//string format
private string strText = FormatTime(Logset.Time[0]) + "," + DoubletoStr(mean(Mass_Flow[0,5])) + "," + DoubletoStr(mean(Pressure_1[0,5])) + "," + DoubletoStr(mean(Pressure_2[0,5])) + "," + DoubletoStr(mean(Pressure_3[0,5]))
//write data
File.Write(FileHandle,strText)
//close file
File.Close(FileHandle)

 

Thank you.

Link to comment
Share on other sites

  • 2 months later...

Initialize fileLoc in a different sequence, one marked Auto-Start.  Then you can change the file name using a variety of methods.  For example with a button you could add this Quick Sequence Action:

private string name = file.fileSaveDialog(fileLoc)
if (!isempty(name))
   fileLoc = name
endif

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.