Commands and functions
P.
197 of 349
Remanent memory
Readflash
Writeflash
You can use the Flash-Memory of the Enertex® EibPC to store variables. Therefore 1000 memory
cells are provided, which can store variables of each data type. This memory is touched neither by
firmware updates nor by hardware resets nor by transfering patches and nor by changeing the
application program.
Storing data of a variable in a flash memory cell stores only binary data and not the type of the
variable. So, when data is red from the flash memory cell and wrote back into a variable you must
pay attention to keep the data type of the variable, which was stored previous in the flash memory
cell, equal to that, in which the value is wrote back. Every flash memory cell contains 1400 Bytes.
The number of variables, which can be stored in the Flash-Memory, depends on the data type or
their bit length, respectively, of the stored variables (see page 154).
Pay atteintion to the following note:
Writing on the flash memory can lead to errors in the file system on the Enertex
EibPC
®
, when the application program is faulty, or when voltage supply is
interrrupted, or a similar problem occurs. By the way writing on the flash many
times stresses the flash memory and shortens its life time.
To avoid errors in the file system of the Enertex EibPC
®
, Enertex® Bayern GmbH provides
the patch 1.100, which runs a checkdisk on the flash memory at each start of the EibPC.
Because this patch re-initializes the flash memory, it can only be transferred into the
Enertex EibPC
®
in the factory. Contact Enertex® Bayern GmbH for further details.
Without the patch 1.100 we do not guarantee for file system errors, if the customer
applies the function to store variables into the flash memory. We will prove it via a
log function, whether this function was applied or net.
Definition
●
Function
readflash
(
Variable
,
Flash memory cell)
Arguments
●
Variable
arbitrary data type
●
Flash memory cell
of data type u16. Valid values are from 0u16 to 999u16
Effect
●
The data of the flash memory cell (Number 0u16 to 999u16) is red and wrote to the
variable
Variable
until the memory cell of the variable
Variable
is full (see bit length on
page 154). The return value is 0b01, when the read process was successful. If the read
process failed, the function returns 1b01.
Data type result (Return)
●
Data type b01
(The return value goes asynchronous to the main development loop - see p. 124)
Definition
●
Function
writeflash
(
Variable
,
Flash memory cell
)
Arguments
●
Variable
arbitrary data type
●
Flash memory cell
of data type u16. Valid values are from 0u16 to 999u16
Effect
●
The binary data of the variable
Variable
is stored in the flash memory cell at the position
(Number 0u16 to 999u16). The return value is 0b01, when the write process was
successful. If the write process failed, the function returns 1b01.
Data type result (Return)
●
Data type b01
(The return value is asynchronous to the main development loop - see p. 124)
Example:
At system start ten 1400 byte strings (c1400) should be wrote on the first ten flash memory
cells and afterwards they should be read again. If problems occur during writing or reading,
then an error message should be displayed at the group address '8/5/2'c14.The result of the
read process should be also wrote at the group address.
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]