Skip to content

CIF merger: allow to preserve controller properties annotation

When working on #1315 (closed), I noticed that the button_lamp_timer example still uses cif2plc rather than plcgen. I tried to change it, but couldn't get it to work with our current tools:

  • I first changed cif2plc to cifplcgen. The timer was not supported for PLC code generation, as it increases rather than decreases. This was easy to change.
  • Then, PLCgen gives many warnings about not having done the controller properties checks. I changed it to first add the hardware mappings, but not timers, then do the controller checks, then add the timer, and then do PLCgen. I add to add marking to the hardware mappings to make the checks succeed (there was no marking in them). However, the merge of the timers removes the controller properties annotation. So, still PLCgen gives warnings.

I think we need a way for the CIF merger to preserve the controller properties annotation, if the user is really sure their information will remain valid. In our process, we want to include as much as possible in the model before we do the controller checks. But, if something must be added afterwards, we want to be able to still preserve the controller properties annotation, including for instance its computed bounds, for PLCgen to use. This should be properly documented and maybe give a message on the command line, as this can be abused if used wrongly.

After adding this, we can update the button_lamp_timer example to use PLCgen.

Addresses #978
Addresses #1315 (closed)