Input Description

../_images/ec4974eedfb2a97d0a33139001da94d5

Function Block TECT_LOG_FILE

Note

The inputs marked with a triangle d141ac78424622eb0a331390012fe443_78f228175b765b440a33139001315693 are of the class VAR_IN_OUT (input and output variable). These inputs must be connected to a variable.

EN (enable)

Data type: BOOL

The Function Block is activated by a TRUE at the input EN. It enables live logging visualization. With a rising edge, the folder to save log file is created. Depending on the MODE, a subfolder will be created for each zone. With a falling edge, clear logging buffer action is executed and backup file is created. After that, FOLDER_CREATED is reset to FALSE. See CLEAR_BUFFER and FOLDER_CREATED for details.

EN_LOG

Data type: BOOL

A TRUE at the input will enable logging to the buffer and copying of files from buffer to .csv file when buffer is full.

LOG_TRIG

Data Type: BOOL

A TRUE at the input executes logging a data entry into logging buffer with a rising edge.

ADR_LOG_BUFFER

Data type: POINTER TO BYTE

Start address of the logging buffer since this is POINTER TO BYTE. It is recommended to connect the input through ADR and point it to %RB area.

NUM_BUFFER_ENTRY

Data type: WORD, Range: 1 … 65535, Default value: 100.

The size of logging buffer for each zone is the number of entries.

Note

Following conditions to be checked to avoid data loss while logging in the buffe:

  • NUM_BUFFER_ENTRY should always be greater than NUM_OF_ZONE.

    Recommendation: NUM_BUFFER_ENTRY > NUM_OF_ZONE x 2.

  • Interval of trigger for logging LOG_TRIG must be greater than one second.

  • Monitor the output NUM_LOG_LOST for the logs/data lost in the buffer as indication of possible adaptation of log configuration.

SELECTION

Data type: WORD, Default value: 2#11111111.

Selection of predefined values to be logged: bit 0 to bit 8 indicates the current version.

Bit x = TRUE: the corresponding value will be logged.

  • Bit 0: Control Word,
  • Bit 1: Status Word,
  • Bit 2: SET_TEMP,
  • Bit 3: ACT_TEMP,
  • Bit 4: Duty Cycle,
  • Bit 5: Control State,
  • Bit 6: Output State,
  • Bit 7: Latest Error.
  • Bit 8: Errors

MODE

Data type: WORD, Default value: 2#00

Define different mode of logging.

This table defines the different modes of logging:

  • Bit 1, Bit 0: Log mode

    • 00: Log all items as long as log trigger is active.
    • 01: Log, if one of the log values changes, when trigger is active.
    • 11: Log, if CW or SW changes or ACT_TEMP changes out of threshold (+/-THRESHOLD), when trigger is active.
  • Bit 4: Internal log trigger, TRUE: It will provide internal trigger to log the files. When Bit 4 is TRUE and there is change in Control word or Status word, a trigger signal will be created. It is a trigger additional to LOG_TRIG.

  • Bit 8: FALSE: Create subfolder automatically; TRUE: Do not create subfolder.

  • Bit 9: Valid, if bit 8 is FALSE.

    • FALSE: subfolder name with index in DECIMAL.

      For example, for group 10, index 3, subfolder name is G010Z003.

    • TRUE: subfolder name with index in HEXADECIMAL.

      For example, for group 10, zone 12, subfolder name is G0AZ0C.

THRESHOLD

Data type: REAL

Threshold of actual temperature. Set the value in combination with MODE (log mode). Log operation will be active when acutal temperature is out of +/- of the Threshold value. See the below figure which explains when is active or inactive.

Bit 1-0: 11: Threshold of actual temperature.

../_images/5792c83212288dee0a317d313c88eb8f

NUM_FILE_ENTRY

Data type: DINT, Range: >= 0, Default value: 0

The logging of data depends on the value of NUM_FILE_ENTRY input is assigned.

  • If NUM_FILE_ENTRY = 0, then a new log file is created daily, previous day file is backed up with the same file name but a different suffix. The suffix is the last three HEX numbers of current time (without second).
  • If NUM_FILE_ENTRY >0, a new file is created when number of log entries is equal to NUM_FILE_ENTRY defined. Old file will be backed up with the same file name but a different suffix. The suffix is the last three HEX numbers of current time (without second).
  • If NUM_FILE_ENTRY <0, it is a invalid condition and function block will generate error 16#4090.

FILE_PATH

Data type: STRING[80]

File Pathfor saving log file (followed with or without ‘/’), e.g. ‘SDCARD/folder’. The physical disk like SDCARD or FLASHDISK must be specified in the FILE_PATH. The folder following will be created if it does not exist yet. But only one folder level will be created, this means the parent folder must already exist.

For Bit 8 of input MODE: FALSE: a subfolder will be created for each zone. The log files will be saved under FILE_PATH/subfolder. See MODE, bit 8 and bit 9 for details. It is recommended to save the log file on SD card.

MANUAL_SAVE

Data type: BOOL

A rising edge at the input will save logging buffer to .csv log file manually.

CLEAR_BUFFER

Data type: BOOL

A rising edge at the input clears the logging buffer: New entries in the logging buffer are written into the .csv file. The .csv file is renamed into a backup file with same file name but different extension. The extension is composed of the last three HEX Numbers of current time without seconds.

ADR_VISU_BUFFER

Data type: POINTER TO TECT_LOGINFO_TYPE

Start address of the log visualization data. It is recommended to define the log visualization data in array. This can be used only with IEC 61131-3 editor visualization. For example, if there are 4 zones to be logged and each zone has 10 log visualization entries, then a one dimensional or two dimensional array can be defined TECT_LOGINFO_TYPE:

visu_array : ARRAY[1..40] OF TECT_LOGINFO_TYPE; (in one dimensional array).

visu_array : ARRAY[1..4, 1..10] OF TECT_LOGINFO_TYPE; (in two dimensional array).

NUM_VISU_ENTRY

Data type: BYTE, Default value: 10.

Number of log entries displayed in log visualization for one zone.

NUM_OF_ZONE

Data type: WORD, Default value: 1.

If TECT_GROUP is used, then Range: 1…65535. If TECT_GROUP is not used, then Range: 1…255.

Number of zones to be logged into the .csv file or displayed in visualization.

FIRST_LOGFILE_DATA

Data type: TECT_LOGFILE_DATA_FILE

First structure of data logging internal settings and values TECT_LOGFILE_DATA_TYPE.

Note

It is highly recommended to define an array of TECT_LOGFILE_DATA_TYPE for this input. The size of the array must be the same as the input MUM_OF_ZONE.

FIRST_ZONEDATA

Data type: TECT_TEMPZONE_DATA_TYPE

First structure of process data and parameters for the zone. Temperature Control Library

Note

All zones must be declared one after another without break. It is highly recommended to define an array of TECT_TEMPZONE_DATA_TYPE for the whole system.