beckhoff TS4100 — 5.7.2 FB_CTRL_LOG_DATA (only on a PC system)

PLC-API VAR_INPUT VAR_INPUT fLogData : T_CTRL_LOGGER_DATA; eMode : E_CTRL_MODE; END_VAR VAR_GLOBAL CONSTANT nCTRL_LOGGER_DATA_ARRAY_SIZE :UINT := 10; END_VAR TYPE T_CTRL_LOGGER_DATA :ARRAY [1..nCTRL_LOGGER_DATA_ARRAY_SIZE] OF FLOAT; END_TYPE fLogData : Array containing the values that are to be written into the log file. eMode : Input that specifies the block's operating mode [ } 16] . VAR_OUTPUT VAR_OUTPUT eState : E_CTRL_STATE; bFileOpen : BOOL bFileClosed : BOOL fBufferUsage : FLOAT (* Buffer fill level in percent [0 ... 100] *) bBusy : BOOL eErrorId : E_CTRL_ERRORCODES; bError : BOOL; END_VAR eState : State of the function block. bFileOpen :

A TRUE at this output indicates that the file has successfully been opened. bFileClosed : A TRUE at this output indicates that the file has successfully been closed. fBufferUsage : Current fill level of the used buffer in percent. bBusy : A TRUE at this output indicates that logging a row is active. eErrorId : Supplies the error number [ } 16] when the bError output is set. bError : Becomes TRUE, as soon as an error occurs. VAR_IN_OUT VAR_IN_OUT stParams : ST_CTRL_LOG_DATA_PARAMS; END_VAR stParams : Parameter structure of the logging block. This consists of the following elements: TYPE ST_CTRL_LOG_DATA_PARAMS : STRUCT tLogCycleTime :

TIME := T#0ms; (* controller cycle time [TIME] *) tTaskCycleTime : TIME := T#0ms; (* task cycle time [TIME] *) sFileName : STRING; sNetId : T_AmsNetId := ''; (* ams net id *) TS4100 114 Version: 1.1 Operating with an external buffer: The user must create a buffer of the type ARRAY OF BYTES larger than 255 bytes. The individual messages are temporarily stored in the external buffer and this buffer is written to the file as soon as possible. The fBufferUsage output indicates how full the buffer is. The function block is stopped and an error is output if the buffer overflows.