SILOS – Save input string, load output string

Block SymbolLicensing group: STANDARD
PIC

Function Description
The SILOS block can be used to export or import a string to/from a file. The string is saved when a rising edge (off on) occurs at the SAVE input and the string is also set to the sy output. The string is loaded at startup and when a rising edge (off on) occurs at the LOAD input.

If a logical true (on) is brought to the APPEND input, the input string is added to the end of the file when it is saved. This mode is useful for logging events into text files. This input signal has no effect on loading from the file.

The LLO parameter is intended for choosing whether to load the entire file (off) or its last line only (on).

The outputs E and lastErr indicate an error during disk operation. The E indicator is reset on falling edge at the SAVE or LOAD input while the lastErr output holds the value until another disk operation is invoked.

Alternatively it is possible to write or read the string continuously if the corresponding flag (CSF, CLF) is set to on. The disk operation is then performed when the corresponding input is set to on. Beware, in that case the disk operation is executed in each cycle, which can cause excessive use of the storage medium. Thus it is necessary to use this feature with caution.

The fname parameter defines the location of the file on the target platform. The path is relative to the data folder of the RexCore runtime module.

Inputs

su

String input of the block  0

String

SAVE

Save string to file

Bool

LOAD

Load string from file

Bool

APPEND

Append saved string to file

Bool

Outputs

sy

String output of the block

String

E

Error indicator

Bool

off ..

No error

on ...

An error occurred

lastErr

Result of last operation

Long (I32)

Parameters

fname

Name of persistent storage file

String

CSF

Continuous saving

Bool

CLF

Continuous loading

Bool

LLO

Last line only loading

Bool

nmax

Allocated size of string   0  65520

Long (I32)

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