I have default arguments specified for function block methods but when calling a method, an error is produced requiring me to supply all the arguments despite there being default values.
This works for me in Schneider Machine Expert 2.2, which is based on Codesys 3.5.19.
It did not work in Machine Expert 2.1, which was based on Codesys 3.5.16.
The new TwinCAT 4026 will add those default parameters, as TwinCAT drinks from Codesys I guess that will be implemented soon (or maybe, it already is given what tvm says in the previous post).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have default arguments specified for function block methods but when calling a method, an error is produced requiring me to supply all the arguments despite there being default values.
According to the online documentation, under section "Calling a Method" and subsection "argument passing" of the following link:
https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_obj_method.html
"Passing an argument for an input ... can be omitted ... for which a default or initial value was specified in the declaration..."
I have found this to be the case for all Codesys IDEs I've used, 3.5.11, 3.5.16, 3.5.17, 3.5.19.
Am I missing something?
It's not that you missed something, it's that CODESYS doesn't have this feature. I hope CODESYS can add this feature.
We also hope to add function overload functionality.
This works for me in Schneider Machine Expert 2.2, which is based on Codesys 3.5.19.
It did not work in Machine Expert 2.1, which was based on Codesys 3.5.16.
The new TwinCAT 4026 will add those default parameters, as TwinCAT drinks from Codesys I guess that will be implemented soon (or maybe, it already is given what tvm says in the previous post).