Attention

IronPLC can only run very simple programs. The steps described are accurate but many language features are not yet supported.

P0008

Code

P0008

Message

SFC body does not have an initial step

This error occurs when a Sequential Function Chart (SFC) body in a PLCopen XML file does not define an initial step. Every SFC must have exactly one step marked as the initial step where execution begins.

Example

The following XML defines an SFC body without an initial step:

<pou name="MyProgram" pouType="program">
  <body>
    <SFC>
      <step name="Step1">
        <!-- Missing initialStep="true" attribute -->
      </step>
      <step name="Step2"/>
    </SFC>
  </body>
</pou>

The SFC body contains steps but none of them are marked as the initial step.

To fix this error, add the initialStep="true" attribute to exactly one step:

<pou name="MyProgram" pouType="program">
  <body>
    <SFC>
      <step name="Step1" initialStep="true">
        <!-- This step is now the initial step -->
      </step>
      <step name="Step2"/>
    </SFC>
  </body>
</pou>

According to the IEC 61131-3 standard, every SFC network must have exactly one initial step, which defines where execution starts when the SFC is activated.