I recently migrated from codesys 2.3 to codesys 3.5.
In codesys 2.3, I used macros to organize my project, I hid some parts of my code that perform a similar function in macros, so there were only a few macros in PLC_PRG that contained the code. Therefore, the program worked quickly.
Now for codesys 3.5, I have all the code in PLC_PRG at once and I did not find a way to create a macro in it and place parts of the code that perform similar functions there to optimize the project. Therefore, when I connect to the PLC, the codesys freezes for 10 minutes. Please tell me how this is done in codesys 3.5? And is it possible?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Which language are you using?
In SFC you right click one of the objects and select insert macro after.
For ST, you would right click in the device tree and add an action or method. Really this works for any of the languages.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
as I understand there are no macros in 3.5 at all. For cfc, do I need to hide parts of the code in action? Will the action in another action work? What other tips for optimizing project performance can you give?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No idea if it is ok with CFC, but with ST/LD/SFC you can split your code in different routines and then call each one when needed (for exemple, do a Main PRG, and call conditionnaly every other PRG from there).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
At the moment, I did as the first person advised. I split my program into actions that perform similar functions. If this is the only way to optimize the body of the program in codesys 3.5.
It's just not very convenient, to get inside the block you need to find it in the project tree. In codesys 2.3, I used macros and when the project was running, you could go inside and so get to the right place.
I could also give a name as a comment to the macro and it was very convenient. Why did they remove this functionality?
Hello everybody.
I recently migrated from codesys 2.3 to codesys 3.5.
In codesys 2.3, I used macros to organize my project, I hid some parts of my code that perform a similar function in macros, so there were only a few macros in PLC_PRG that contained the code. Therefore, the program worked quickly.
Now for codesys 3.5, I have all the code in PLC_PRG at once and I did not find a way to create a macro in it and place parts of the code that perform similar functions there to optimize the project. Therefore, when I connect to the PLC, the codesys freezes for 10 minutes. Please tell me how this is done in codesys 3.5? And is it possible?
Which language are you using?
In SFC you right click one of the objects and select insert macro after.
For ST, you would right click in the device tree and add an action or method. Really this works for any of the languages.
I use CFC language
as I understand there are no macros in 3.5 at all. For cfc, do I need to hide parts of the code in action? Will the action in another action work? What other tips for optimizing project performance can you give?
No idea if it is ok with CFC, but with ST/LD/SFC you can split your code in different routines and then call each one when needed (for exemple, do a Main PRG, and call conditionnaly every other PRG from there).
At the moment, I did as the first person advised. I split my program into actions that perform similar functions. If this is the only way to optimize the body of the program in codesys 3.5.
It's just not very convenient, to get inside the block you need to find it in the project tree. In codesys 2.3, I used macros and when the project was running, you could go inside and so get to the right place.
I could also give a name as a comment to the macro and it was very convenient. Why did they remove this functionality?