-

Y_CO_ReName_FTP_SendData

Image
This function works in combination withY_CO_ReName_FTP_RecordData. Both functions must be copied and pasted into the main project and slightly customized for use. This function is designed to continuously record data using two databanks. Together, Yt_CO_ReName_FTP_RecordData and Yt_CO_ReName_FTP_SendData handshake and synchronize operations such that Recording takes place in one databank while the FTP transfer takes place using the other databank. Files of nearly unlimited size can be created on the FTP Server. Customization consists of creating an application specific structure similar to "Yt_CO_ReName_RecordedUserData" in the main project which contains the specific data required by the application. This technique writes binary data to the file and therefore requires a program to read and interpret the same data structure. The data is non ASCII, unless converted to ASCII as part of customization using type conversion functions. Converting the data to ASCII on the motion controller is not recommended, especially if high speed recording is desired. Y_CO_ReName_FTP_RecordData typically executes in a faster task, even as fast as the motion network update rate if necessary, recording up to 1000 samples of data in each "DataBank." There are two Databanks; one which is being written to by FTP_RecordData, and the other which contains data being uploaded to the FTP server. Y_CO_Rename_FTP_SendData can typically execute in a slower task or the DEFAULT task.Y_CO_ReName_

Parameters

* Parameter Data Type Description Default
VAR_IN_OUT
V RecordedData Yt_CO_ReName_RecordedUserData Rename and customize this structure based on the needs of the application.
VAR_INPUT
B Enable BOOL The function will continue to execute every scan while Enable is held high and there are no errors. FALSE
V Append BOOL To select whether an existing the file on the server should be deleted and the new data should be appended to the existing data. FALSE
V Destination Yt_String64 The full file name and destination on the FTP server, e.g. 'metrics/example.csv'. STRING#''
V FTPData Yt_CO_FTP_Data The input structure that configures the FTP transfer such as FTP server address, port, etc.
VAR_OUTPUT
B Valid BOOL Indicates that the function is operating normally and the outputs of the function are valid.
B Busy BOOL Set high upon the rising edge of the Execute input, and reset when Done, CommandAborted, or Error is true. In the case of a function block with an Enable input, a Busy output indicates the function is operating, but not ready to provide Valid information. (No Error).
B Error BOOL Set high if an error has occurred during the execution of the function block. This output is cleared when 'Execute' or 'Enable' goes low.
E ErrorID UINT If Error is true, this output provides the Error ID. This output is reset when 'Execute' or 'Enable' goes low.
V ErrorString Yt_String256 If 'Error' is true and it is an FTP response code related error then this output contains the response string from the FTP server.

Notes

Error Description

See the Function Block ErrorID List.

Example Customization

(It is assumed that an FTP server is configured and access is possible.)

  1. Open your project.
  2. Open the Comm Toolbox in a second copy of iCube Engineer.
  3. In the second copy (Comm Toolbox) Project Tree Window, select Y_CO_ReName_FTP_SendFile and Y_CO_ReName_FTP_RecordData and Copy.
  4. In the main project, Project Tree Window, right click on Logical POUs and select Paste.
  5. For both of the new function blocks in your project, right click on them to access the properties page and rename the function blocks.

DataTypes

Create a datatype which describes the information to be recorded. The four datatypes shown below make up "MyRecordedUserData" which must be connected to the function blocks. Customize the detailed information to be recorded as shown on lines 5 through 11. Add or subtract as many variables are required. All code shown here was copied and pasted from the Comm Toolbox, then all instances of "Yt_CO_ReName_" were changed to "My." Change to anything meaningful and appropriate. The only datatype which does not require modification and can remain in the Comm Toolbox is Yt_CO_RecordStatusData.

Initialization

Editing the variables worksheets

Variables worksheet for Y_CO_ReName_FTP_RecordData:

Rename the dataypes.

Variables worksheet for Y_CO_ReName_FTP_SendData:

Rename the datatype.

Function Blocks added to the Project:

MyFTP_RecordData_1 is in a "fast" task:

MyFTP_SendData is in the DEFAULT task:

 


This help information is valid for iCube Engineer Online Help 2025.6

Copyright © 2025 YASKAWA EUROPE GmbH and © 2025 YASKAWA America, Inc.