Skip to main content

Example: SequenceEditor

Product: CODESYS Application Composer

This example shows how to use the sequence editor which is integrated in the CODESYS Application Composer. With the corresponding graphical editor, modules are displayed and edited according to the sequence flow.

Description

You can use the sequence editor to edit the module tree in the form of a graphical sequence representation. To do this, you need to define and program the steps which should be added to the program sequence later as corresponding modules.

_ex_ac_img_sequence_editor1.png

For more information, see: Mechatronics library and mse.Sequence section.

Additional information

The AC_Mechatronics.library library provides an OMAC program manager (simple) which is based on the OMAC State Model ( www.omac.org). The program manager allows for different states of the OMAC State Model, each to be equipped and displayed with a sequence.

_ex_ac_img_sequence_editor2.png

To use the AC_Mechatronics.library library, you need to create modules which are inserted in the program sequences of the library. These program sequences are parameterized and instantiated in the sequence editor. If you want to use module sequence steps in a program sequence, then they must implement the AC_MEC.IProgramSequenceStep interface.

. Details about the AC_Mechatronics.library library:
  • If a sequence step should be used in a program sequence, then the StepBase module is the easiest way to extend it. In this way, the step directly implements AC_MEC.IProgramSequenceStep and can be used in program sequences. Within the extension of StepBase, the Execute method must be overridden, which you can see in this example. The Execute method of the currently active step is executed and called until this step signals the end of its task by setting the Done property to TRUE.

  • The AC_Mechatronics.library library already provides some basic steps. This includes, for example, sequence steps which represent jumps (ConditionalJump) or branches (BranchOnBool, BranchOnComparison).

  • Within the scope of the AC_Mechatronics. library, it is possible for sequence steps to act on the actuator modules which they reference. A slot is provided for actuators below an AC_Mechatronics.library machine (top-level module in this library). In order to insert them there, the actuators must implement the empty AC_MEC.IActuator interface.

  • Below the machine (module defined in AC_Mechatronics.library), there is a slot for a program manager module which contains the OMAC state behavior. Sequences for each OMAC state can be inserted below the program manager module. The Program Manager module has inputs and outputs to control the OMAC states (for example, to send a startor stop command to the program manager).

    Compare with the OMAC diagram.

System requirements and restrictions

Programming system

CODESYS Development System (version 3.5.17.0 or higher)

Runtime system

CODESYS Control Win (version 3.5.17.0)

Add-on components

CODESYS Application Composer

Note

_example_icon.png DOWNLOAD Projects