Lookup tables, or LUTs, are numeric tables loaded into ecmc and then accessed at runtime.
Use them when:
Load a LUT from file with:
${SCRIPTEXEC} ${ecmccfg_DIR}loadLUTFile.cmd "FILE=./cfg/example.lut"
Optional:
LUT_ID: explicit LUT idAfter load, the actual id is also available in ECMC_LUT_ID.
The LUT file is a plain text file with two numeric columns.
Example:
# Encoder correction example
PREC=5
-10 -10.12345
0 0.12345
10 10.12345
PREC=6
12.67898 12.345679
Notes:
PREC=<n> changes the read precision for the following rowsThe exact interpretation of the two columns depends on how the LUT is used. A common pattern is:
One common use is encoder correction data, where:
LUTs can also be used directly from PLC logic through the lut_... helper functions.
That is useful when:
The PLC function library provides lut_... helper functions.
A typical pattern is:
value = lut_get_value(0,index);
Use PLC functions for the full lut_... reference.
Use LUTs when the data is:
Do not use LUTs as a replacement for:
For those cases, use data storage, plugins, or normal EPICS/PLC state instead.