- The manual explicitly says math functions/tables are evaluated in order. p41: “The above elements are processed at 500 Hz (every 2 ms). Processing elements can be put in arbitrary order. The order in which the elements are listed in the project tree is in the order in which they are processed. The type of the element does not affect the order of evaluation.”
I seem to be able to create math functions that reference themselves or future values. I assume this means that values that are not yet recomputed this cycle will be read with the results of the last cycle? Meaning I can implement low pass filter “number1 = number1 * 0.99 + new_value * 0.01” or even PID controllers etc.
- The manual says division is done as integers. p45: “RESULT := RESULT DIV Value (DIV - integer division; eg.: 9 DIV 2 = 4)” But it also has the option for intermediate results to be calculated using floats. I’m not sure if this is an error in documentation (float support was added later and div documentation wasn’t updated) or is it true that even in float mode div will round? I guess if the latter is the case I can always do something like “100 * a / b * 0.01” but that seems a little inelegant.