PLCnext / CSharpExamples

Collection of various C# sample code for PLCnext Technology controllers.
MIT License
13 stars 11 forks source link

Program template could be clearer #17

Open martinboers opened 1 year ago

martinboers commented 1 year ago

In the Visual Studio extension for C# (version 2022.6), when a new C# Program is added to a project, the template includes this code section:

   [Program]
    public class Program1
    {
        // Use the attributes [Global] and either [InputPort] or [OutputPort] to mark fields, 
        // that should exchange data with other IEC- or C#-Programs
        [Global, OutputPort]
        public int a = 1;
        [Global, InputPort]
        public int b = 2;
        public int c = 3;
           :

This gives the impression that the variables b and c are both InputPort variables, when in fact only b is an input port variable.

Perhaps this could be made clearer in the template, maybe with a comment after the declaration of variable c.