PLC-API TYPE ST_CTRL_CHECK_IF_IN_BAND_PARAMS: STRUCT tCtrlCycleTime : TIME := T#0ms; (* controller cycle time [TIME] *) tTaskCycleTime : TIME := T#0ms; (* task cycle time [TIME] *) fMin : FLOAT; fMax : FLOAT; END_STRUCT END_TYPE tCtrlCycleTime : Cycle time with which the control loop is processed. This must be greater than or equal to the TaskCycleTime. The function block uses this input variable to calculate internally whether the state and the output variables have to be updated in the current cycle. tTaskCycleTime : Cycle time with which the function block is called. If the block is called in every cycle this corresponds to the task cycle time of the calling task. fMin :
Lower limit of the range. fMax : Upper limit of the range. Requirements 5.7.2 FB_CTRL_LOG_DATA (only on a PC system) This function block allows a log file to be created in *.csv format (comma separated values), in which a maximum of 10 variables may be recorded. The column titles specified by the user are written in the first row of this file. The input data is written at equal time intervals in the following rows. The individual entries are separated by a comma. The time interval between the entries is specified in the tLogCycleTime parameter. If, for instance, tLogCycleTime := T\#2s is chosen, then an entry is made in the file every 2 s.
The files that were generated can be analyzed with a spreadsheet program, for example. The timestamp of the log entry, in s, is stored in the first column of the file. The other columns contain the data of the function block input fLogData . When the mode is set to eCTRL_MODE_ACTIVE the log file is opened and entries are written into the file. The file remains open until the function block's mode is set to eCTRL_MODE_PASSIVE. It is essential that the file is closed by switching into eCTRL_MODE_PASSIVE before attempting to analyze the log file. If this is not done, it is possible that not all the entries will be written into the file.
The function block makes it possible to work with or without an external buffer. The external buffer is used if a buffer address and a buffer size different from zero are parameterized. In the absence of an external buffer, an internal buffer with the size of 255 bytes is used. TS4100 113 Version: 1.1 Development Environment Target System PLC libraries to include TwinCAT v2.8 PC (i386) TcControllerToolbox.lib TwinCAT v2.9 from Build 947 BC [} 10] TcControllerToolbox.lb6 TwinCAT v2.9 from Build 956 BX [} 10] TcControllerToolbox.lbx Operating without an external buffer: The bBusy output is TRUE when the logging of a row has been started.
The following data set will not be logged until the bBusy output is FALSE again. The fBufferUsage output indicates how full the internal buffer is.