STATESAVE – Save multiple block states and parameters

Block SymbolLicensing group: ADVANCED
PIC

Function Description
The STATESAVE block stores the values of states and parameters in a file. The file is specified by the filename parameter and is in JSON format, which can usually be reloaded by the STATELOAD block. It is also possible to store data in the OutState output, which is a JSON string in the same format as the file output. The OutState output is used if the filename parameter is empty.

All values configured by the parameters blocks, depth, and mask are stored.

Inputs

SAVE

Trigger to save the state

Bool

uChain

This input is not used by the block but is useful for placing the block in the correct execution order.

Long (I32)

Parameters

filename

Filename where to store

String

blocks

List of blocks to store. Block names must be relative connection strings (e.g., begin with a dot) and are separated by semicolons. All blocks (within the current subsystem) are stored if the parameter is empty.

String

depth

If the saved block is a subsystem, this parameter specifies the number of levels to save. 0 = current level only, 1 = current level and blocks directly in the current level subsystems, etc.   0  65535

Long (I32)

mask

Select which objects are saved. Each bit of the number represents:

  • 1 ... inputs
  • 2 ... outputs
  • 4 ... parameters
  • 8 ... internal states
  • 16 ... array parameters
  • 32 ... array states
  • 64 ... cyclic (trend) buffers
  • 256 ... metadata (STATESAVE only)

  0  65535 65535

Long (I32)

SaveOnExit

If set, the file is stored when the entire configuration is terminated.  on

Bool

Outputs

OutState

JSON string where values are stored (only if the filename parameter is empty)

String

DONE

Indicates whether the state has been saved

Bool

iE

Error code if block execution fails

Error

"

2023 © REX Controls s.r.o., www.rexygen.com