Type
| Function block |
Description
| Moves the current file pointer to a new position.Assign the valid handle of the file to be processed to the Handle input. This handle is created when the file is opened with the FILE_OPEN function block. Write the relative offset to be used to move the file pointer to the Position input. Enter the reference to be used to move the pointer at the Mode input (see description of the Mode input).Activate the function block on a rising edge at the Execute input. Execution of the function block is complete when the Done output is set to 1. If an error occurred during execution,
the value at the Error output = 1. ErrorID indicates the number of the cause of the error. |
Notes
|
- The status of the Done, Error, and ErrorID outputs is maintained until a falling edge is detected at the Execute input.
- Specifying a position beyond the end of file is possible. If the position is written, the gap between the end of file and the current writing position is filled with zeros.
- Function blocks have to be instantiated. The instance name of the function block has to be declared in the 'Variables' table of the POU where the FB is going to be used. The instance name must be unique within the POU.
|
Parameters
| Inputs
Execute
Data type: | BOOL |
Description: | Sets the new position of the file pointer if a rising edge is detected. |
Handle
Data type: | UINT |
Description: | File handle of the file in which the position is to be set. |
Position
Data type: | ANY_INT |
Description: | New position in file. |
Mode
Data type: | ANY_INT |
Description: | Positioning mode
0, other values | Positioning relative to start of file. |
1 | Positioning relative to current position. |
2 | Positioning relative to end of file. |
|
Outputs
Done
Data type: | BOOL |
Description: |
0 | The function block was not executed. |
1 | The function block was executed. |
|
Error
Data type: | BOOL |
Description: |
0 | No error occurred when setting the position. |
1 | An error occurred when setting the position. |
|
ErrorID
Data type: | UINT |
Description: | Error number of the error that occurred when setting the position:
0 | No error information available. |
1 | Invalid file handle. |
13 | Invalid position. |
24 | Position could not be set. |
|
|