Execution order of code pane tabs in Control Module Type
While programming using Control Builder,what will be the execution order of Code Pane tabs while programming using Structure Text in CMT.
Example If I have 4 tabs of code like Code1..Code2..Code3...Code 4. Which code pane will execute first ? or all four code pane will be executing simultenously ?
Voted best answer
For control modules, the compiler analyzes each code block separately, with respect
to which variables are read and written by each block. ST, IL, FBD, and LD – SFC
are treated somewhat differently. The compiler then determines
the optimal execution order for the code block. A block that assigns a value to a
variable has to be executed before the block that reads the variable value.
The technique for ordering the blocks is called code sorting, and means that the
optimal execution order will be based on data flow, instead of the program flow (as
is the case for function blocks). Code sorting guarantees that the code will be
executed in the correct order. Code sorting reduces time delays and results in a new
control module automatically being correctly placed in the process.
Read more about this topic on page 107 onwards in the manual 3BSE044222-510.
Also see the attached white paper on the subject.