cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

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

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

Rathinavel
Established Member

Hello,

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

Rathinavel_1-1694334347087.png

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.

Rathinavel_2-1694334646987.png

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

Thanks

Rathinavel L

 

1 REPLY 1

HmiGuide
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
    HmiGuide_1-1694413279129.png
  • 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.
Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist