SaveRetainDataFast block

Short summary

Name

SaveRetainDataFast

→POU type

→function

Category

more system blocks, persistence blocks, block with internal error diagnostic

Graphical interface

images/download/thumbnails/429719707/SaveRetainDataFast-version-1-modificationdate-1561969688825-api-v2.png

Available since

version 3.2.2 (for library Standard)

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/warning.svg The block is supported for the platforms LinuxX86 and WindowsX86 (incl. the built-in PLC under Windows).

Functionality

The block saves the values of the →retentive variables persistently to a binary file. Compare SaveRetainData block for an alternative.

Restriction

Recommendation on usage

Use the block only once in a →program and at the end of the application cycle (= shutdown state).
Reason: Depending on the number ob variables and the storage device of the target system, the saving of the values might be rather time consuming. Therefore, if you call this block repeatedly in your application, the execution of the application might take longer with each call.

Inputs, return value


Identifier

→Data type

Description

Inputs:

fileName

STRING

name of the file where the values of the variables are stored
Without any connected value for this input, the file retain.var is created.
By default, the file is saved to the subdirectory PLC of the runtime systemS installation directory. If you prefer that a different directory is used, contact your system integrator and ask to change the configuration of the system service.

Return value:

UDINT

returns the success indicator:

  • 16#00: OK

  • 16#01: memory allocation failed

  • 16#02: missing or invalid data

  • 16#03: IO error

  • 16#04: other error

  • 16#05: no persisted data available

  • 16#ff: system service not loaded on target system

Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

See:

Internal error diagnostic for block

The block checks the following error cases:

  • The system service has not been loaded.

  • The return code of the function call equates to an error (return value ≠ value 16#00).

In such an error case, the output ENO of the block is set to value FALSE (or an equivalent).

Example for usage within ST-editor

See LoadRetainDataFast block.

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.