I'm trying to understand the execution order of P1, N and P0 in SFC in Compact Control Builder. I get that P1 is executed at the entrance to a step, N is repeatedly executed, and P0 is executed once at the end of a step. But I'm having a strange issue that a transition is immediately true in N, but it is running through a second time before executing P0. So considering the entire program cycle, how are these executed? Is it P1, then IMMEDIATELY N? Or is there a scan cycle between P1 and N? And with N, when a transition becomes true, I guess P0 is not IMMEDIATELY executed, rather, there is a scan cycle, N is executed a second time, then is P0 IMMEDIATELY executed? Or is there another scan cycle between?
That's correct. Both N **AND** P0 are executed once when the transition condition becomes true. The sequence then moves on to the next step.
I believe ( but cannot prove , its not in the release notes ) that the behaviour of SFC has changed slightly over time. In early versions of 800xA ( SB2 ) Steps that had no "P1" or "P0" actions needed 1 less program scan to transition. Now it appears that the SFC still requires a program scan even without the P1 or P0 actions. However, I'm not going to commit to this being true in release 6.1 without testing to confirm.