Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

FTPClient created files problem


Jukurpa Jul 14, 2014 08:26 AM

Hello,

On a new project, I try to use the FTPClient command to share the results with different people without giving them access to our CR3000.
What I'd like to do, is having only one file with our datas.
To do so, I'm using the option code 9 for the PutGetOption (Append data to end of file, passive mode).
All of this is done in TOA5 (option 8 for FileOption)

Here is the full line I'm using for this transfer:

FTP_flag = FTPClient(FTP_Server,FTP_Login,FTP_password,"table_name","file_destination",9,0,0,Hr,8)

I do this one a day, around midnight, when nobody is supposed to access the CR3000

According to the help, with the Append option, as I understand it, I should have only one file with all the new datas appended since the last transmission.
But, what I have, is one file for each day (each call of the function), so, with my example, I retreive:

file_destination0.dat
file_destination1.dat
file_destination2.dat

etc...

So, what am I missing?
Could you please help me to solve this misunderstanding?

Thanks for your kind help, regards,

Fred
Belgium


Jukurpa Jul 22, 2014 07:19 AM

I tried several configurations for the command line, but none seems to work as I hope.

I tried to use the 1000+ option for the FileOption field, but it doesn't work.
At the first call, the file I'm asking is created, but the next times (once a day), nothing occurs, the result's flag stay at 0 (transmission not complete).


I also tried without the 4 optional parameters, but I even can't create a file without it.

So, my problem remains, how do I "reuse" an existing file on FTP by appending it new datas? I currently tried with the Option 9 for the PutGetOption field.


smile Jul 23, 2014 06:54 AM

Hi

it would be to see the program of the logger, but perhaps I understand that if the logger in its internal mem generates data files with different names, perhaps it will be difficult to append them to only one file into the FTP server.

Will this be the problem?

Smile

* Last updated by: smile on 7/23/2014 @ 12:55 AM *


Jukurpa Jul 23, 2014 08:10 AM

Hello,

It'd be to long to copy our program here, but it only uses one table, never cutted or renamed by the program. And I'd like to transfer once a day the new datas since the last call of the function.

I'd like to share our slow table (averaging, etc...) with other people without leaving them access to the CR3000.

Once a week, we go on field to recover the CF card for the high frequency table (10Hz for Eddy Covariance)
The CR3000 knows itself where it has stopped at the previous successful transfer.

As I said, I already performed tests for this transfer, but the function supposed to append new datas to an existing file (PutGetOption 9) doesn't seems to work as I write it.
So, I'd like to know which syntax to use to make it work as intended.


XxVashxX Oct 3, 2014 03:08 PM

Hello Some one can look in to this?

I have the same problem cant find how to have just one file using the put get option 9 t have jusy one file and append to this file new data........ i just obtain:

file_destination0.dat
file_destination1.dat
file_destination2.dat
etc...

The instruction i use is:
FTP_flag = FTPClient(FTP_Server,FTP_Login,FTP_password,"table_name","file_destination",9,0,0,Hr,8)

And as i understand the files sensded must be writed in the same file with the append option what i am missing?

Thank you in advance


XxVashxX Oct 3, 2014 03:14 PM

In previus OS i use some instructions to first write the data in the USR memory and i can change the names of the files in that memory, also i create back ups (using some "queueadd" and "queuesub" subrutnines i found in the forum) of the file to avoid loose some data when the cellullar service go down..........

but i think in new OS27 i dont need to write the data to the USR and i think with new options the datalogger makes is hown backup to avoid loose data when the cellular services fail.

Now i want to have just one file in the FTP that increment the size with new data like a data table retrieved with PC400 or loggernet with append new data file option

Thank you


Sam Nov 10, 2014 12:43 AM

With OS 27:
Public FTPResult as Long
FTPResult = FTPClient(server,user,pass,"table","table.dat",9,0,0,Hr,1012)

'9 = append (or create if file doesn't already exist)

'0,0 = any new data since last successful transfer

'1012 = send toa5, no header (because we don't want headers interspersed in our data file, use the dest filename as specified (table.dat), do not automatically append a counter to end of file name (i.e. don't make table1.dat, table2.dat, etc)


With OS 28, tbr by end of 2014:
Public FTPResult as Long
FTPResult = FTPClient(server,user,pass,"table","table.dat",9,0,0,Hr,-1008)

'9 = append (or create if file doesn't already exist)

'0,0 = any new data since last successful transfer

'-1008 = if file doesn't already exist write header and first set of data, if file does already exist (discovered through FTP NLST command) then do not write header, just append the new data, do not automatically append a counter to end of file name (i.e. don't make table1.dat, table2.dat, etc)

Log in or register to post/reply in the forum.