FILESEEK

FILESEEK 1:

With this function block the file pointer of an opened file can be set to a definable position.

VAR_INPUT

VAR_INPUT
    NETID       : T_AmsNetId;  (* ams net id *)
    HFILE       : UINT;     (* file handle *)
    SEEKPOS     : UDINT;        (* new seek pointer position *)
    SEEK        : BOOL;     (* seek control input *)
    TMOUT       : TIME;
END_VAR

NETID : is a string containing the AMS network identifier of the target device to which the ADS command is directed. 

HFILE : is occupied by the file handle already created by FILEOPEN.

SEEKPOS : contains the desired (absolute) target position of the file pointer. The constants FILE_SEEKEND and FILE_SEEKBEGIN can be used to set the file pointer to the end or to the beginning of the file.

SEEK : the ADS command is triggered by a rising edge at this input.

TMOUT : specifies the time until the abortion of the function.

VAR_OUTPUT

VAR_OUTPUT
    BUSY        : BOOL;
    ERR         : BOOL;
    ERRID       : UDINT;
END_VAR

BUSY : this output remains TRUE until the function block has executed a command, but at the longest for the duration supplied to the 'Timeout' input. While Busy = TRUE, no new command will be accepted at the inputs. Please note that it is not the execution of the service but its acceptance whose time is monitored.

ERR : this output is switched to TRUE if an error occurs during the execution of a command. The command-specific error code is contained in ‘ErrorId’. If the function block has a timeout error, 'Error' is TRUE and 'ErrorId' is 1861 (hexadecimal 0x745). Is reset to FALSE by the execution of a command at the inputs.

ERRID : contains the instruction-specific error code of the most recently executed command. Is reset to 0 by the execution of a command at the inputs.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v2.7.0

PC or CX (x86)

PLCSystem.Lib

TwinCAT v2.8.0

PC or CX (x86)

TcSystem.Lib

TwinCAT v2.10.0 Build >= 1301

CX (ARM)

TcSystem.Lib