-
Hi! We have come across this issue: The compiler gives error when declaring pragma on Tracking also here |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Hi @PTKu, thanks for your question. Directly, I can't answer that. But let me ask the experts ;-) |
Beta Was this translation helpful? Give feedback.
-
Hi @PTKu, I'm one of the product owners for SIMATIC AX responsible for the implementation of the IEC 61131-3 ST standard. Currently, we do not allow pragmas in every location, but only dedicated ones. I'm telling you this, because I assume there is a misconception of the concept of a TYPE vs. a type (and yes, the casing is important to make that point).
This is a perfectly valid declaration within our engineering. It causes two concrete types to be declared. Colors (a named value type) and Name (a structured type). This gives the user the possibility to arrange his declarations any way he wants, without restricting him too much when it comes to structure. Having said that and while looking at your usage of the pragma above, this would either mean, the semantics of the pragma shall be applied to all different types declared inside that container, or you did what I would call single type declarations (one type per TYPE construct only). Hence I assume, you'd want to add the pragma on top of the structured type instead of the whole TYPE container, i.e.
And this is perfectly valid in our engineering. |
Beta Was this translation helpful? Give feedback.
Hi @PTKu,
I'm one of the product owners for SIMATIC AX responsible for the implementation of the IEC 61131-3 ST standard.
Currently, we do not allow pragmas in every location, but only dedicated ones.
Given the definition of the TYPE construct, I'm not particularly sure, in how far and why you'd want to be able to put a pragma on top of it. Could you please elaborate on that?
I'm telling you this, because I assume there is a misconception of the concept of a TYPE vs. a type (and yes, the casing is important to make that point).
TYPE END_TYPE is nothing but a container. Like a section that says "within this particular part of the file, I'm going to declare types that are not known to the s…