-

Y_CO_ReName_FTP_RecordData

Image
This function works in combination with Y_CO_ReName_FTP_SendData. 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, Y_CO_ReName_FTP_RecordData and Y_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 an 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 Y_CO_FTP_RecordData, and the other which contains data being uploaded to the FTP server. Y_CO_Rename_FTPSendData can typically execute in a slower task or the DEFAULT task.

Parameters

* Parameter Data Type Description Default
VAR_IN_OUT
V RecordedData Yt_CO_ReName_RecordedUserData User customizable structure containing the data to be recorded. See examples below.
V NewSample Yt_CO_ReName_RecordedSample A single element of the many samples in one of the databanks. All the data in one sample is collected in one time slice.
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 Stream BOOL If Stream is True, a Sample will be added to the UserData structure every task interval. FALSE
B Trigger BOOL If Stream is False, Samples can be added to the UserData structure only upon the rising edge of Trigger. FALSE
VAR_OUTPUT
B Valid
BOOL Indicates that the function is operating normally and the outputs of the function are valid.
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

(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.