View Full Version : FTP file format

August 29th, 2013, 05:49 AM

I use FB40 to daily write a File DB to our FTP server for some logging.
Now this works great, but..... the silly thing seems to be that I can not find a way to view the DB that I send to the FTP sever from a Windows environment.

I opened it with an editor and I can see that the information is in there somehow... but I would like to be able to view it in a normal layout. Possibly excel, or some tool, doesn't really matter just as long as I can examine the data. With symatic manager I can only open projects but not a simple file that was generated by FB40.

The only thing now that I can seem to do with it is just to read it back to the DB in S7 with FTP again...

This cannot possibly be true, there must be some simple way to view the contents :)

August 29th, 2013, 05:59 AM
You have not specified how the file is written in the FTP server, or what format the data is in the file. "the information is in there somehow" doesn't tell much does it ?
Maybe it is enough to give the file an .CSV extension in order for the file to be possible to open with Excel. But without an example of the file it is not easy to tell for sure.

August 29th, 2013, 06:01 AM
Yes but that is exactly my question.
I can not specify any file format. FB40 is the standard FB to use for FTP.
I can only tell it to connect/read/write/disconnect etc. With the write command the input is a siemens File DB. There is nothing to specify the format.
That is precisely my point. What format is it, how can I examine it....

August 29th, 2013, 08:09 AM
Somewhere, the filename must be defined. I cannot know how that is done in your system.
You are not telling much. But ....... I am guessing you are using the block called FTP_CMD.
Read this manual and follow the information on page 79 on how to specify the file name:

August 29th, 2013, 08:24 AM
Yes, that is the document I have used to do the FTP code.
I specified the filename like that document described. And I can put whatever extension on it that I want. But the filename or the extension does not change the format of the resulting file.

At this moment I am making some sort of work around. I have made a new DB consisting of only STRING fields, and after each field I put an extra field with a comma; in effect I am now making the DB in CSV format resulting in an output file with also 99% text.
I still get some unreadable chars in the output file at the beginning and end of each field, but at least it is readable now.

Still, it has to be in some known format. The FB40 (FTP_CMD indeed yes), can also read the file back from FTP into the DB so...

August 29th, 2013, 08:37 AM
You dont have to put in commas to sort the file content into cells.
Use the function 'text to columns' in Excel and it will automatically split the values into cells and columns.