Customizing the code in the function block – Yaskawa MotionWorks IEC Toolboxes User Manual

Page 237

Advertising
background image

File_RW Toolbox: Function Blocks

MotionWorks IEC61131-3 Toolboxes: 2013-09-13

224

3) Initialize the data required for "MyDataStruct" as shown below. Most importantly, set Columns and
MaxRecords. MaxRecords indicates how may lines of data are to be written to the file. In the case of Append
mode =TRUE, set MaxRecords to the number of lines from the MyDataStruct to be appended. Appending always
starts from the first line (array element 0) of the structure and adds data to the end of the file. It is not
necessary to initialize (clear) the other data elements beyond MaxRecords that may be from a previous use.

4) Copy & paste the Write_CSV_File function block into your main project so it can be customized. This will
allow you to retain the original function in the template for future reference. Rename the function to avoid
name conflict with Write_CSV_File in the Toolbox.

Customizing the code in the function block

Advertising