beautypg.com

Basic functionality example - transferring a file – Yaskawa MotionWorks IEC Toolboxes User Manual

Page 191

background image

Communications Toolbox: Function Blocks

MotionWorks IEC61131-3 Toolboxes: 2013-09-13

178

12553

Requested action not taken, file name not allowed / mailbox name not allowed

12554

Transcation failed

Basic Functionality Example - Transferring a File

This examples demonstrates how to configure the block using the data structure, create a file to send and
execute the FTP_SendFile block.

Here is the code in the "Initialize" ST program which configures the file data and the FTP structure. The FTP
server is hosted on a local computer and does not have a domain name. Therefore, FTPIP was used and FTPPort
was left blank as the local FTP server is configured to use the default port of 21. The LocalIP is set to the
controllers IP and the username/password combination are set.

This program works by creating a file via the PROCONOS File_Open, String_to_Buf, File_Write and File_Close
blocks. The contents of the file in "sample_file_data" is converted from a YC_STRING128 to YC_BYTE128 via the
"SAMPLE_TO_BUF" block. Once the file is created the destination file name is prepared and the FTP block sends
the file to the server.