Get the value of a field from the log data


GetFieldLog( fieldno, seconds )
Float:GetFieldLog( fieldno, seconds, FLOAT )

Fetches the value of a field from the log data buffer

Available in firmware 21060101 or newer


fieldno Which field to fetch
seconds How far back in time the data should come from
FLOAT By default, this function returns an integer value. Add 'FLOAT' as the last parameter to return a floating point value

Return value

The value of the field from the log data. The log buffers will be searched for the closest timestamp saved. If the field is set to log faster than the default 10 minutes, this fuction automatically selects the 'fastlog' data.

Example usage

   new x;
   new Float:f;
   x = GetFieldLog(4, 300);
   f = Float:GetField(4, 3600, FLOAT);
   // x now holds the value of field 4 from 5 minutes ago, rounded to the nearest integer.   
   // f holds the value from field 4 from 1h ago as a float.
  • ezeio2/scriptref/getfieldlog.txt
  • Last modified: 2021-06-03 00:03
  • by andreh