1. Principles for constructing simple, serial, and parallel program segments in LAD

1. Principles for constructing simple, serial, and parallel program segments in LAD

1.1. Principle of contact placement

  • Each program segment must start with a contact point.

  • Program segments cannot be terminated by touch points.

1.2. Coil placement rules

  • The program segment cannot start with a coil; The coil is used to terminate the logic program segment.

  • A program segment can have several coils, as long as the coils are located on parallel branches of that specific program segment.

  • Cannot connect more than one coil in series on a program segment (i.e. cannot place multiple coils on a horizontal line of a program segment).

1.3. Box placement rules

  • Most boxes must have input as an energy flow condition.

  • A program segment can have several boxes, as long as the boxes are located on parallel branches of that specific program segment.

  • Cannot concatenate more than one box on a program segment (i.e. cannot place multiple boxes on a horizontal line of a program segment).

1.4. Program segment size limit

  • The width of the ladder diagram program can be expanded to a maximum of 255 columns.

  • The height of the ladder diagram program is expandable, with a maximum of 65535 lines.

  • The ladder diagram network can accommodate up to 65535 networks.

  • Anyway, the final generated program size cannot exceed the maximum space that the PLC can accommodate.

1.5. Example

The following figure lists some possible logical structures that may exist in the SamSoar2022 LAD editor.

  • This program segment uses a normal contact ("Start") and a NOT contact ("Stop_"). Once the motor is successfully activated, it remains locked until the "stop" condition is met.

![Locked](./StructurePrinciple~/Images~/pic11. png)

图1 Locked

  • Please note that if the first condition is met, the preliminary output (output 1) will be displayed before the evaluation of the second condition. You can create multiple steps with midline output.

![Conditional Output](./StructurePrinciple~/Images~/pic12. png)

图2 Conditional Output

  • When the startup conditions are met, all outputs (boxes and coils) are activated. If an output is not successfully evaluated, the energy flow still flows to other outputs; Not affected by failed instructions.

![Function Block Instructions for Branches](./StructurePrinciple~/Images~/pic13. png)

图3 Function Block Instructions for Branches