PLCgen: constants with enum values get unsupported values if enums are eliminated to constants
From #861 (comment 2814450):
We changed enum handling a while back in !1021 (merged) for #934 (closed). We generate for S7 for each enum literal a constant with an integer value. For uses of enum values, we generate the name of the corresponding constant. Then, one constant has as value the name of another constant. It seems that is not allowed. It seems we must use the value of that constant. So, rather than:
<Constant type='BYTE' remark='' value='0'>A</Constant> ... <Constant type='BYTE' remark='' value='A'>c01</Constant>
It should be:
<Constant type='BYTE' remark='' value='0'>A</Constant> ... <Constant type='BYTE' remark='' value='0'>c01</Constant>
Thus, for constants, the value should never be an identifier, but always a literal value.
See #861 (comment 2814417) for the original report.
Addresses #679
Edited by Dennis Hendriks