FOR_LOOP_VAR_USED_AFTER¶
Severity: info.
PLCopen: L13 — the value of a FOR loop counter after the loop is implementation-defined.
A reference to the loop counter appears after the FOR body terminates. Per IEC 61131-3 the post-loop value of the counter is not portable — it may be end, end + step, or whatever the runtime decided. Don't depend on it.
Settings. No check-specific config. (Heuristic: a reference more than 200 lines after the FOR header is treated as "after the loop"; finer-grained loop-end tracking is on the backlog.)
Trigger.
The bot posts.
Fix. Compute the post-loop value explicitly (e.g. assign before exiting the loop body), or use a fresh variable for the post-loop intent.