hschir Posted April 1, 2012 Share Posted April 1, 2012 What was the script to ftp yesterday's log file - it seems to have gone missing ? Link to comment Share on other sites More sharing options...
AzeoTech Posted April 1, 2012 Share Posted April 1, 2012 Missing from where? I think its in that long thread we had on FTP. Anyhow, you just need to save the current name of the log file before trying to change it. Something like: private string curName = logging.myLog.strFileNamelogging.myLog.strFileName = formatdatetime("c:\mydata\mydata_%y%m%d.csv",systime())if (logging.myLog.strFileName != curName) DoFtp(curName)endif[/CODE]where DoFtp is some sort of function you create to do the ftp with the file name passed in. Link to comment Share on other sites More sharing options...
hschir Posted April 1, 2012 Author Share Posted April 1, 2012 Thanks for that. I found the other one - it was posted under scripting; It was: while (1) delay(1) // set logging file name: yesterday = logging.Field_Sensor_log.strFileName logging.Field_Sensor_Log.strFileName = "C:\Users\hschiret\Documents\UNE_MonoEvap_Project\Log_Files\Daily_Field_Log_"+ formatdatetime("%d_%m_%y",SysTime()) + ".csv " if (yesterday != logging.Field_Sensor_log.strFileName) // new day, so upload yesterday's file sendFTP(yesterday, "/data/Daily_Field_Log_" + formatdatetime("%d_%m_%y",SysTime() - 86400) + ".csv " // and repeatendwhile[/CODE]Now as I explained elsewhere, the website I wish to upload these files to is on a Linux server that uses sftp (not supported by DAQFactory) so I have to use an external program, in this case WinSCP http://winscp.net/en...cs/introductionSo, what I need to do is from within the DAQFactory sequence, pass the (exact) filename of yesterdays log file (not some other name such as "yesterday.csv") to either a] the external sftp application or, b] a batch file that handles the connection.The question then is in two parts, namely;How do I call an external program passing the exact file name to it? If a batch is the chosen option - I don't know how to pass a filename directly to a batch file - I don't even know if that's possible ? Link to comment Share on other sites More sharing options...
julius228 Posted April 2, 2012 Share Posted April 2, 2012 Also in "Daq Factory - Labjack application guide" pag.47, section 7.3 there is a good starting point. http://www.azeotech.com/dl/labjackguide.pdf Link to comment Share on other sites More sharing options...
AzeoTech Posted April 2, 2012 Share Posted April 2, 2012 Sure, first you can use system.shellExecute() to run an external program. In that function you can pass parameters, so presumably your file path. As for using a a batch file, you can also do parameters to a batch file. You'll have to search the internet on how to create a batch file that takes parameters, but if I remember correctly, you put %1, %2 in your batch file where you want to insert the parameter. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.