PLCnext / PLCnext_CLI

The PLCnext CLI is our tool for programming in high level languages for the PLCnext Technology ecosystem. Build an up-to-date version of the PLCnext CLI that includes the very latest bug fixes, or even build your own customised version. Test the newest features or contribute your ideas.
Apache License 2.0
10 stars 3 forks source link

Port rules in Component .hpp file are incorrect #7

Closed martinboers closed 2 years ago

martinboers commented 3 years ago

In the .hpp file generated by the acfproject template , there are comments that describe the rules for defining GDS ports. At least some of these rules are incorrect.

For example, the comments state:

Create one (and only one) instance of this struct.
Apart from this single struct instance, there must be no other Component variables declared with the #port comment.

... but I have successfully broken this rule in firmware version 2021.0.3 on an AXC F 2152.

Perhaps these comments were correct for an earlier firmware version, but they need to be revised.

This might be the same for GDS ports in PLM components (I haven't checked).

twilker commented 3 years ago

It is not really a rule. It is more of a suggestion which works. The problem when you use multiple structure is, that it is easy to have the same port name twice. Both in different structures. Do you mean we should change the comment, so that is does not sound like a rule?

martinboers commented 3 years ago

These comments are written like rules, and that is good - users of this template need to know what the rules are for defining Component ports, in the same way that users need to know the rules for defining Program ports. After the rules are clear, then examples can be provided. But the first priority is to clearly list the complete set of rules.

So, either the comments should be changed to list the rules for defining Component ports, or else a reference to the complete set of rules should be provided in the comments. Otherwise, I don't understand how users of this template are supposed to know the rules for defining Component ports?

twilker commented 3 years ago

Will be fixed with the next version

twilker commented 2 years ago

Was fixed in the 21.6 Release.