Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
This also works. Is there a mention in any coding style documentation that suggests one style or the other?
Could there be a performance difference between the two?
First Style
CPU Step 1: Assign STR1 the value of String1
CPU Step 2: Assign STR2 the value of String2
CPU Step 3: Call CONCAT with STR1 and STR2
VS.
CPU STEP 1: CALL CONCAT with String1 and String2
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As far as performance goes, there doesn't seem to be a difference:
As for style, I agree with you, that CONCAT(String1, String2) is more readable, but on more complex functions where the inputs might not be as intuitive, I'll use the names.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2019-03-29
Originally created by: rickj
Adding to what TVM said, for large function calls it's common to list parameters on separate lines as shown below. Also note the different notation for input and output parameters.
  Result:=SomeFunction(    Input_01:=in01,      //Inputparameters    Input_02:=in02,    Input_03:=in03,      "     "    Input_99:=in99,    Output_01=>out01,    //Outputparameters    Output_02=>out02,  );
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
rickj hat geschrieben:
Adding to what TVM said, for large function calls it's common to list parameters on separate lines as shown below. Also note the different notation for input and output parameters.
  Result:=SomeFunction(    Input_01:=in01,      //Inputparameters    Input_02:=in02,    Input_03:=in03,      "     "    Input_99:=in99,    Output_01=>out01,    //Outputparameters    Output_02=>out02,  );
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am working on an existing project. This project has a number of function calls with the format:
String3 := CONCAT(STR1 := String1, STR2 := String2);
This works properly. My preference would be:
String3 := CONCAT(String1, String2);
This also works. Is there a mention in any coding style documentation that suggests one style or the other?
Could there be a performance difference between the two?
First Style
CPU Step 1: Assign STR1 the value of String1
CPU Step 2: Assign STR2 the value of String2
CPU Step 3: Call CONCAT with STR1 and STR2
VS.
CPU STEP 1: CALL CONCAT with String1 and String2
As far as performance goes, there doesn't seem to be a difference:
As for style, I agree with you, that CONCAT(String1, String2) is more readable, but on more complex functions where the inputs might not be as intuitive, I'll use the names.
Originally created by: rickj
Adding to what TVM said, for large function calls it's common to list parameters on separate lines as shown below. Also note the different notation for input and output parameters.
Thank You!