ezeio2:expref:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ezeio2:expref:start [2020-11-03 21:03] johparezeio2:expref:start [2022-11-16 23:50] (current) – [Field expressions] andreh
Line 1: Line 1:
 ===== Expressions ===== ===== Expressions =====
-{{indexmenu_n>700}}+{{indexmenu_n>900}}
  
 Within the configuration of an ezeio, mathematical expressions are used to produce a value/result for "Fields", "Alarms" and "Conditions". This powerful tool can produce mathematical and logical results using multiple constants and/or variables from the available resources on an ezeio. Expressions can be as simple as the constant "1" to indicate True/ON or as complex as necessary. Within the configuration of an ezeio, mathematical expressions are used to produce a value/result for "Fields", "Alarms" and "Conditions". This powerful tool can produce mathematical and logical results using multiple constants and/or variables from the available resources on an ezeio. Expressions can be as simple as the constant "1" to indicate True/ON or as complex as necessary.
Line 94: Line 94:
 Since we are looking for kW-hours, we need to divide the momentary power with 36000 (3600 seconds in an hour, and we are re-evaluating 10 times per second). Since we are looking for kW-hours, we need to divide the momentary power with 36000 (3600 seconds in an hour, and we are re-evaluating 10 times per second).
  
 +=== Example: Signal filter ===
 +
 +{{ :ezeio2:expref:iirresponsegraph.png?400|}}If data from a register (or other field) includes a lot of noise and needs to be filtered over time, a simple field expression can be used to implement a IIR filter function:
 +
 +<code javascript>( f(THIS)*99 + r(1,1) )/100</code>
 +
 +Knowing that the expression evaluated 10 times per second, we are keeping 99% of the value, and adding 1% from the signal every 100ms. Thus the response time for this filter is about 7s for a 3dB (50%) response.
 ==== Reverse expressions ==== ==== Reverse expressions ====
  
  • ezeio2/expref/start.1604437420.txt.gz
  • Last modified: 2020-11-03 21:03
  • by johpar