PLCgen: S7 has additional naming constraints
I was reading Siemens SIMATIC Structured Control Language (SCL) for S7-300/S7-400 Programming Manual (PDF, and thereby found some things that are not yet correct in DefaultNameGenerator
yet:
- Section 7.3 ('Reserved Words') lists reserved words, some of which we still allow.
- Section 7.4 ('Identifiers in SCL') indicates "The maximum length of an identifier is 24 characters.", a constraint that we don't yet take into account.
- Section 7.5 ('Standard Identifiers') lists in Table 7-1 'Block Keywords' and a bit later in that section also 'Address Identifiers' (table without table number). We don't have these as keywords yet.
- Appendix A.5 ('Keywords and Predefined Identifiers') lists in Table A-7 various 'SCL Keywords and Predefined Identifiers in Alphabetical Order', including ones we don't yet treat as keywords.
- Appendix A.6 ('Address Identifiers and Block Keywords') lists in Table A-8 various 'Address Identifiers for Global System Data' and in Table A-9 various ' Block Keywords Plus Counters and Timers', including ones we don't yet treat as keywords.
Interestingly, the document also indicates: "Reserved words, which are only valid in SCL, can be declared as identifiers by putting the character “#” in front (for example, #FOR). This can be useful if you want to transfer the actual parameters to blocks which were created in a different language (for example, STL)." Not sure whether we should use this feature though, as it may be specific to SCL.
Addresses #679
Edited by Dennis Hendriks