Programming for experts
P.
118 of 349
Simple mtimechart
Selecting the values on the position
in the timebuffer with the function
mtimechartpos() or the time with
mitimechart()
Less „ease of operation“, especially in the application with a touch panel but more space for the
representation provide the “simple” i.e. not EXT-format types of mtimecharts (comp. Picture 9). In
this form the diagram is reminiscent of the mcharts respectively mpcharts (comp. p. Fehler: Referenz
nicht gefunden and p. 252), where also the time axis is automatically scaled and taken out of the
time buffer.
Picture 9: Standard-art webelement
The definition of the element in the web server is identical to the definition of the EXT-types, except
that instead of EXTLONG is standing as format LONG.
[WebServer]
page(1)[$Log$,$Room1$]
mtimechart(R1_ID)[EXTLONG,NOAUTOSCALE,192,17,30,0,100] ( $Temp$,LEFT, ChartBuffer0,
$Control$,RIGHT,ChartBuffer1 )
Also here: If the user moves or scales a diagram he disconnects the diagram from the real
time webserver, 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.
The time series is basically defined the same as in the code sections on p. 115 and p. 116.
With the function
mtimechartpos
(
TimeChartID,ChartIdx,ChartBuffer,StartPos,EndPos
)
mtimechart
(
TimeChartID,ChartIdx,ChartBuffer,StartZeit,EndZeit
)
(comp. p. ) can also be changed by the application program the display similar to the direct value
input in Picture 8 of the display area of the art-webelements.
mtimechartpos
requires additionally to the ID and the graph index mtimechart the position of the
value range of the data in the buffer to which the value is fixed. As indicated in Figure 10 “numbers”
the Enertex® EibPC every space from 0 up to max. configured value n-1. In this case, n is the
configured buffer length. Figure 10 shows a buffer with length 4000, start position 0 and end position
3999. With the help of
mtimechartpos
one can fall back to the specified position in the time buffer
where position 0 is always the oldest value in the buffer and position n-1 (in the example, the 3999)
is the most recent value in the buffer.
Figure 10:Structure of the timebuffer with index
mtimechart
does not evaluate the index of the graph but the value of the timestamp itself. Here have
to be specified the time statements
StartTime,EndTime
in the argument as utc-millisecond format. In
order to simplify this for the user, you can fall back to the function
utc
(
Zeit
)
(comp. 180). This converts a string specifying of the form $2013-01-30 14:00:00$ into the utc-
millisecond format.
if systemstart() {
mtimechart(1,0,ChartBuffer0,utc($2013-01-30-14-00-00$),utc($2013-01-30 14:00:00$))
} enduf
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]