Establishing FTP Server using AS 4.12

Hi B&R Community,

I am struggling a bit with establishing a stable FTP connection between PLC and Matlab. I want to save image from my Smart Camera using ViBaseGetImage and functions from FileIO library and then transfer pics from CF card to my PC using FTP protocole. From Matlab part I see an error: Could not open a connection to “ftp://10.0.0.101”, port “21”. Verify the supplied host. My PC can reach PLC IP which is 10.0.0.101 (ping verification). Firewall is turned off. In my project I also use TCP/IP to transfer data between PLC and Matlab and it works fine. I also tried to use function CfgSetFTPServer, but it didn’t success either. Status was switching from 0 to 0xFFFF every PLC cycle.
Matlab syntax which trying to reach FTP server to access its files: ftpobj = ftp(host,username,password)
I attach my configuration below. USER partition is made - checked in sdm.

Grateful for any help,
Jakub

Hi,

I would try another way of accessing the FTP server - e.g. using FileZilla or other tools. Maybe that helps narrowing the issue.
Also have a look at the logger, maybe it states something meaningful about the ftp server

Best regards

Hi,

thank you for your message. I tried to install FilleZilla, but my PC rejected installation process. I installed WinSCP then and it turned out I can connect with FTP Server (PLC) but access is denied to its files. Where can I changed access level? I assume it is to be done on AS side.

Regards,
Jakub

Your config shows that you should have read/write access to the files in there. The question is, what does “but access is denied to its files” mean? Do you see the files listed but can’t download any? Or don’t you see any files (and if so, what makes you sure there are any?)

Might be relevant to this: Your file device HD looks wrong to me: the path should be USER_PATH, not USER_PATH :\

No, no files are listed. When I click on that folder with arrow I get a message “Permission denied“.
I have also changed to USER_PATH, but still the same problem appears.

The issue is solved now. I could not enter the shown folder but all created files are listed below. I did not execute functions before because I expected to see old files saved in other folders. Matlab can connect with FTP server as well.

Thank you for your attendance!

The “shown folder” isn’t a folder but a way to navigate up one level - which is of course forbidden since you are already at the root path of it.

Glad you could figure it out.