jhorne Posted February 13, 2017 Share Posted February 13, 2017 Hi, This seems like a rather straightforward problem but I cant seem to figure it out. I am a beginner with DAQFactory, and i am using a Labjack U6 device to record data. I am able to log channels correctly and I followed a couple examples here in the forum for creating a Button that automatically starts logging while renaming the file based on the time (see code below) if (logging.mylog.running) endlogging(mylog) else logging.mylog.strFileName = "C:\Desktop\DAQ\log_" + formatdatetime("%y%m%d_%H%M%S",systime()) + ".csv" beginlogging(mylog) endif as well as a Variable Value component that lets you change the file save location private string path = File.FileSaveDialog(logging.mylog.strFileName) if (!IsEmpty(path)) logging.mylog.strFileName = path endif What I would like to do now is instead of saving as "log_DATEANDTIME" I have a few combo boxes where the user selects options based on the test configuration. All options are numeric, for example the number of nozzles, the size, and flowrate. I would like to save them as variable so that the filename can be more descriptive, for example: "log_DATEANDTIME_1_3_30" for 1 nozzle, size #3, at 30 litres per minute Any help is appreciated. Jono Link to comment Share on other sites More sharing options...
AzeoTech Posted February 14, 2017 Share Posted February 14, 2017 You just want to use some variables. For example, in an auto-start sequence declare and initialize some variables to defaults: global numNozzles = 1 global nozzleSize = 3 global flowRate = 30 Then, simply change your script that starts the logging set to incorporate that: logging.mylog.strFileName = "C:\Desktop\DAQ\log_" + formatdatetime("%y%m%d_%H%M%S",systime()) + "_" + numNozzles + "_" + nozzleSize + "_" + flowRate + ".csv" Link to comment Share on other sites More sharing options...
jhorne Posted February 14, 2017 Author Share Posted February 14, 2017 Thanks Guru, Is there was way to set either a drop down combo box or radio buttons to override and set those values as the variable? Link to comment Share on other sites More sharing options...
AzeoTech Posted February 15, 2017 Share Posted February 15, 2017 Sure, just set the "set channel" for those components to the desired variable. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.