Skip to content

PLCgen TwinCAT self-certification: `VAR_TEMP` not supported in functions

Test report

Tool Version
ESCET nightly-20241023-115319
TwinCAT v3.1 build 4020.56
Test suite v27

Setup of TwinCAT as described here: https://cstweb.wtb.tue.nl/4tc00/twincat/setup.html#twincat-install. Project generated as described here: https://eclipse.dev/escet/cif/tools/plcgen/twincat.html#twincat-usage.

Test case: iter_limit3_funcs_event.cif, iter_limit3_funcs_scope.cif, sync_events_funcs_event.cif, sync_events_funcs_scope.cif

Encountered errors

I get the following build error.

'VAR_TEMP' declaration not allowed in this place at \iter_limit3_funcs_event\Untitled1\POUs\tryEvent_a_c.TcPOU line 5.

The relevant piece of generated code is

FUNCTION tryEvent_a_c: BOOL
VAR_INPUT
    isProgress: BOOL;
END_VAR
VAR_TEMP
    funcIsProgress: BOOL;
    current_a_x: DINT;
    current_a_y: DINT;
    edge_a: BOOL;
    eventEnabled: BOOL;
END_VAR

Addresses #1020 (closed) #679

Edited by Martijn Goorden