When running this test, compiling resulted in the error as shown below. As seen, the file size of the program block (OB1) is too small. I'm unsure if this is an issue of the PLC code generator, but this test could not be completed.
PLCgen doesn't even create a statement.
Technically the generated code is invalid, as it needs at least one statement. (In other words, a ; is missing.)
Not sure why though, iirc it checks for having a statement. Maybe it doesn't know the comment block is not a proper statement?
I doubt that ; will create 20 bytes code though :)
Assigning to self, so I can find this again for the missing ; problem.
Running this test from test set v9 with ESCET nightly version 20240623 results in the same error message.
I've tried adding some dummy code lines to increase the file size, but this did not seem to fix the issue. I also noticed that the error message specifically mentions that "the interface" of the standard OB (organization block, i.e. the PLC code) is too small, not the OB itself. I have not yet been able to figure out what this means.
We have similar issues with 'The interface of the standard OB is smaller than the minimum value of 20 bytes' also in #890 (closed). It may be the same underlying issue. In #890 (closed) we are progressing towards a potential solution.
I ran some more test for this model. The number of declared variables in VAR_TEMP affects the existence of the error about the interface being smaller than 20 bytes. The minimal example that I was able to create consists of 5 DInt type variables. Remove one of these variables or changing one to a BOOL type results in the aforementioned error.
I have not attempted to determine the number of required BOOL variables to prevent the error message, but I can figure this out (through trial and error) if that is desired.
Ah, so it is temp variables. That helps. 5 DINT variables makes sense. DINT is 32-bits, so 4 bytes. 5 * 4 = 20, which satisfies the '20 bytes' requirement.
@ahofkamp I think we can add dummy temp variables to make it work?