LOOKUP_TABLE1 output bug that may incorrectly return 0.0 when duplicate X,Y coordinate pairs are used
Question
Why does the LOOKUP_TABLE function block output 0.0 when the input X value is greater than the maximum configured X value?
Answer
A confirmed behaviour has been identified with the LOOKUP_TABLE function block where the output may incorrectly return 0.0 under a specific lookup table configuration.
The issue occurs when:
- The
LOOKUP_TABLEblock contains duplicate/repeated X,Y coordinate pairs at the end of the table. - The input value
Xbecomes greater than the maximum configured X value,Xmax.
For example, if the final lookup table entries contain repeated coordinate pairs such as:
and the input value becomes:
while the maximum configured X value is:
the expected behaviour would be for the output to remain at the final Y value:
However, the observed behaviour is that the pin mapping/direct output may incorrectly become:
This issue is not caused by repeated Y values alone. The behaviour has been observed when the final X,Y coordinate pairs themselves are duplicated/repeated. When the input value remains within the configured X range:
X <= Xmax
the output returns the expected Y value. When the final X,Y mappings are unique, the issue does not appear to occur. This behaviour was observed using the LOOKUP_TABLE function block in Control Expert.