The code size (CODESYS ST, TwinCat 2) for the beckhoff BC9000 PLC (64 kB max) should be reduced to a minimum:
var
word_CO2: word;
(code skipped)
Need to reduce the size of this code:
MEMCPY(ADR(word_CO2),ADR(ReceiveBuffer[3]),1);
MEMCPY(ADR(word_CO2)+1,ADR(ReceiveBuffer[2]),1);
To reduce code size in CoDeSys 2.3 do the following:
If the above does not help your code needs review and optimization. Generally speaking try to avoid multiple IF...ELSIF statemenets, use MUX and SEL operators instead and (a little bit of) CASE logic. Switching to POINTER arithmetic and compacting data into ARRAYS also helps. Use bit access to BYTE, WORD and DWORD variables instead of BOOL variables.