Commands and functions
P.
198 of 349
Readflashvar
[EibPC]
a=$: No$
nr=0u16
read_nok=OFF
write_nok=OFF
new_r=ON
new_w=ON
TestGA='8/5/2'c14
if cycle(0,1) and nr<10u16 then write_nok=writeflash(convert(nr,$$)+a,nr);
nr=nr+1u16;new_w=!new_w endif
if cycle(0,1) and nr>9u16 then {
read_nok=readflash(a,nr-10u16);
nr=nr+1u16;
if (nr<20u16) then new_r=!new_r endif
} endif
if write_nok then write('8/5/2'c14,$W-Err: $c14+convert(nr,$$c14)) endif
if change(new_w) then write('8/5/2'c14,convert(convert(nr,$$)+a,$$c14)) endif
if read_nok then write('8/5/2'c14,$R-Err: $c14+convert(nr-10u16,$$c14)) endif
if change(new_r) then write('8/5/2'c14,convert(a,$$c14)) endif
Example 2:
The last value that is sent on the bus should be stored in flash and after a restart automatically
sent to the bus.
Value=0u08
if change("Wohnküche RTR Modus-5/1/7") then {
writeflash("Wohnküche RTR Modus-5/1/7",0u16)
} endif
if systemstart() then readflash(Value, 0u16) endif
if after(systemstart(),1000u64) then write("Wohnküche RTR Modus-5/1/7",Value) endif
Definition
●
Function
readflashvar
(
Variable)
Arguments
●
Variable
arbitrary data type
Effect
●
In the built-in flash, the binary data is written back to the memory of the
Variable
, as it can
be recorded (see bit length, page 154)). The return value is 0b01 when reading was
successful, otherwise 1b01 is returned.
●
The reading or de-referencing is performed via the variable name. When the user installs a
new program, the variable is overwritten with the last value stored in the flash, regardless
of the program changes.
Data type result (Return)
●
Data type b01
(The return value is asynchronous to the main processing loop - see p.124)
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]