Programming for experts
P.
117 of 349
Saving in the flash
Loading from the flash
It is important to note: If the user moves or scales a diagram, he disconnect the diagram from
the real-time web server, i.e. further changing of values, which are written in the time series
(time buffer) are no longer visible on the web server until a page refresh (usually F5) of the
browser is running. This does not affect the other elements of the website.
After the time series was taken over some time in the Enertex® EibPC it has to be ensured that
these are not los even if reloading of program or restarting the values. The functions
timebufferstore
(
ChartBufferID
)
timebufferread
(
ChartBufferID
)
are created for this task (comp. p. 256).
timebufferstore
sets the values of the timebuffer with the
ChartBufferID
permanently into the flash
memory of the Enertex® EibPC ,
timebufferread
reads a stored buffer back. In addition the values
with Enertex® EibStudio as described on page 200 to an external device to ensure data can be
downloaded and uploaded.
Thus we store our buffer every 24 h in the following way:
// Wert im Flash speichern
if chtime(01,00,00) then {
timebufferstore(ChartBuffer0);
timebufferstore(ChartBuffer1);
} endif
The values we save back at startup as follows:
if systemstart() then {
timebufferread(ChartBuffer0);
timebufferread(ChartBuffer1);
} endif
Is a art declared as EXTDOUBLE so eliminates the fields of Picture 8, in particular the moving and
superimposing of different time buffer no longer possible.
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]