beckhoff TF4100 — 4.2.1.6.3 FB_CTRL_LOG_MAT_FILE

PLC API NOTICE Error during file handling The parameter set can only be changed when the file is closed (bFileClosed = TRUE). Otherwise errors can occur during file handling. 4.2.1.6.3 FB_CTRL_LOG_MAT_FILE This function block allows a log file to be created in Matlab 5 (*.mat) format, in which a maximum of 10 magnitudes may be recorded. Two variables are created in the file, a double array and a cell array. The recorded magnitudes are recorded, line-by-line, in the double array. The identifiers of the individual rows are stored in the cell array. The user can specify the name used for the double array in the function block's parameter structure.

The name of the cell array is derived from the name of the double array by appending "_Info" to the variable name. TF4100 127 Version: 2.2.4 Name Type Description tLogCycleTime TIME Cycle time with which entries are written into the log file. This must be greater than or equal to the TaskCycleTime. tTaskCycleTime TIME Cycle time with which the function block is called. If the function block is called in every cycle this corresponds to the task cycle time of the calling task. sFileName STRING Name and path of the log file, for example: d:\Logfile.csv sNetId T AmsNetId _ The log file is written to the system with the NetId specified here.

tFileOperation Timeou TIME Timeout for all file operations nNumberOf Column INT Number of columns written into the file (maximum 10) arColumn Headings ARRAY Array of strings that contain the column headings. bAppendData BOOL If this parameter is TRUE, then new data sets are appended when a file is opened again. Otherwise the file is overwritten without query, and this will delete any content that already exists. bWriteTime Stamps BOOL If this parameter is set to TRUE, the time stamp of the measurement is written into the first column of the file. bWriteColumn Headings BOOL If this parameter is set to TRUE, the column headers are written into the first row of the file.

bWriteAbsolute TimeStamps BOOL If this parameter is set to TRUE, the local NT time is used as timestamp. In this case the minimum LogCycleTime is 5s! pLogBuffer ADR _ POINTER TO BYTE Address of the external LogBuffer. To detect a buffer, the address must not be 0. nLogBuffer _ SIZEOF UDINT Size of the LogBuffer. The buffer must be an ARRAY OF BYTE with at least 256 elements. The size of the buffer can be optimized with the aid of the fBufferUsage output.