Showing results for 
Search instead for 
Did you mean: 

Retrieve a file from Compuer to ctrlX core via FTP / TFTP

Retrieve a file from Compuer to ctrlX core via FTP / TFTP



As i am new to the CXA_Socket communication & FTP functions, expect any samples to retrive a file stored in a computer (configured as ftp server) to ctrlX core.

I understood from the document that there are FB's that can accomplish it, which are "IL_FTPGetAsync" & "IL_FTPGetFileAsync".

IL_FTPGetAsync:  "sRemotefile_Path was originally configured as "text.txt", which is the target file from ftp server. the value get replaced with fee character from the targetted file as shown in the below image


The error description says "Target buffer too small for file to be transferred". How can i fix it?

IL_FTPGetFileAsync: FB successfully completed the sequence, But did not retrived the targetted by to the path configured under Local file.


Could some one clarify, How can i successfully retrive the file from the ftpserver configured in my windows to my ctrlX core.


Rathinavel L



Community Moderator
Community Moderator

Hello Rathinavel

the difference between both FB's is:

  • IL_FtpGetAsync: Retrieves the content and stores it into a variable.
    You have to provide a variable where the data is stored, but you provide the file name variable (that's wrong).
    Expecting that you read a string variable, you define e.g.
       strData: STRING(1000);
       ValueAdr := ADR(strData);
       NoOfBytes := SizeOf(strData)
       Keep in mind, that the standard string function can only handle strings up to a length of 255 char. => Use string functions of library CXA_Utilities ofolder String Functions NoLimitStrLength
  • IL_FtpGetFileAsync: Retrieves the content and stores it into a file.
    When the FB executes successful, search the file in the active solution path of the PLC. Use either the file browser of PLC engineering or IDE app.