FTP server merges text file

Hi guys,

I have a question or better said problem with the FTP server of the PLC. If I delete a text file on the server and then copy a text file with the same name but a shorter length to the server, the content that was longer in the first file is copied into the second file on the server. It is merged, so to speak. This behavior is absolutely reproducible and occurs both with FileZilla and with our own tool (.NET). Has anyone ever observed this behavior?

PLC: X20EM0612
Automation Runtime: I4.93

Best regards
Philipp

Hi Philipp,
I attempted to reproduce this issue on a C80 with the same AR version and Filezilla, but could not see the behavior you were getting.

Could you go into a little more detail about the exact order of operations you performed to get to the result you did?

My own order of operations was as follows:

  • Put numbers 1-10 in a text file on my PC
  • Copy this file to the PLC FTP server with Filezilla
  • Delete the file from the FTP server
  • Edit the file on the PC to have numbers 1-5
  • Copy the file to the PLC FTP server
  • Delete the File on the PC and copy it back from the PLC
  • Open the file on the PC and observe that the numbers read 1-5

Let us know if your order of operations was different so we can more accurately replicate your issue.

Hello,

thank you for your time. I have done further tests today and can say that the error is not directly on the FTP server, but generally has something to do with the file read access of the PLC. With a Windows fileshare there has also a problem occurred during deleting the file after it was opened with the PLC. I currently use the functionblocks FileOpen, FileRead and FileClose. I am not sure what it is, but the PLC seems to block the file somehow, even though it should be closed via the FileClose functionblock.

1 Like

Hi Philipp, what is status of your topic, can you mark the reply that helped you the most?

A post was split to a new topic: PLC’s CPU usage briefly goes to 100% and OPC communication breaks down if file is copied using FTP

info from @Philipp.Oberhuber:

At first we forgot to call the FileClose block every time we accessed a file, but since we’ve been doing it correctly the error hasn’t occurred anymore. So far it seems to be working, although I have to say that this behavior shouldn’t have happened due to a missing FileClose call.

Hi,

only as information for others maybe reading this thread in future:

if working with file devices on a FTP server, a file is transferred from / to the FTP server and is edited in the local memory of the client, since the server does not have the capability to edit a file directly at the remote location.
So the FileClose() is needed as “trigger” to (re)transfer the file to server.

For more information, please see here in the online help:

4 Likes

Ok, that explains the behavior pretty well. It looked as if the original file was still saved somewhere.

2 Likes