The execution order in POUs is uniquely determined in text-based and network-based editors. In the CFC editor, however, you can position the elements freely, so the execution order is initially not unique. For this reason, CODESYS uses the data flow to determine the execution order and, in the case of multiple networks, by means of the topological position of the elements. The top elements and networks are sorted from top to bottom and left to right. In this way, the execution order is unique and makes sure that the POU is processed while optimized by time and by cycle.
You can temporarily display the current execution order in the chart. When you program networks with feedback, you can define an element as the starting point in the feedback loop.
You can also explicitly edit the processing order in a CFC object. To do this, switch the “Auto Data Flow Mode” property of the CFC object to “Explicit Execution Order Mode”. In this mode, you have the option of editing the execution order by means of menu commands.
Before CODESYS V3.5 SP15, you had to define the execution order explicitly for each POU. The was no mode switching.
-
Data flow
-
Displaying the execution order
-
Determining the execution order in feedback networks
-
Defining the execution order explicitly