Skip to content

FBD: composite blocks, axes and drives

Machine control is assembled from blocks in a function block diagram. The logic is data in the package, not code in the firmware. Alongside the fixed block library — TON, PID and the rest, listed under the function block reference — there are two more things.

The composite block

A composite is a program unit with an interface of input and output ports and its own internal FBD network. In a diagram it is used like any other block; double-clicking opens it and shows how it is put together. At compile time it is expanded into primitives, so the panel executes a flat list — no recursion, no extra interpreter.

  • To create one: right-click ApplicationAdd composite FB. The ports are edited with the Ports… button in the diagram — up to four inputs and two outputs. Changing the interface raises the block's version.
  • Blocks that ship with the product, such as DRIVE_i550, are read only: you can look inside but not change it. Save as custom makes an editable copy inside your project.
  • In YAML this is the composites: section. Inside a body, $PORT marks an interface port and ~wire an internal wire. Every use of a composite gets its own wires, so instances do not share state.
  • Limits: nesting depth 8, recursion forbidden, at most 64 blocks after expansion. All of it is enforced by the compiler, not by the panel.

Axes and drives

An axis is a drive controlled by motion blocks. It is added with Add Object → Add axis (drive) and carries a backend and its parameters:

Backend Bus State
CiA 402 (Lenze i550) CANopen verified on the bench
POWERSTEP01 SPI interface ready, driver arrives with the hardware

Blocks bound to an axis — they have an axis selector in the diagram's top bar:

  • MC_POWER — switch the axis on (Status = the axis is in operation)
  • MC_MOVEVELOCITY — velocity; a changed setpoint is taken while running
  • MC_STOP — controlled stop along the deceleration ramp
  • MC_RESET, MC_READACTVEL, MC_READSTATUS
  • the position blocks MC_MOVEABS, MC_MOVEREL, MC_HOME, MC_READACTPOS (for POWERSTEP01)
  • CO_CIA402 — the state machine core, a building block for composites
  • CO_SDOWRITE — write a parameter at start-up; it is translated into commissioning and an SDO is never executed inside the cycle
  • CO_RAMPTIME — ACC and DEC ramp times in seconds relative to the reference speed; written to the inverter only while the axis is stopped

The supplied DRIVE_i550 block

            ┌────────────────┐
  command ──┤ Enable Running ├──── running
  setpoint ─┤ Speed  ActualS.├──── speed
  reverse ──┤ Reverse        │
            └───────┬────────┘
                    axis1 (CANopen node …)

Inside it: MC_POWER + MC_MOVEVELOCITY + MC_READACTVEL. Stopping means dropping Enable — the inverter runs down along its own deceleration ramp and disconnects. Read diagnostics (current, torque, DC link, frequency) with CANopen data tags and a gain for scaling, for example ‰ to A. No blocks are needed for that.

Verified i550 objects: the actual output frequency is 0x2DDD in units of 0.1 Hz. 0x2D87 is the setpoint after the ramp, which holds the setpoint at standstill.

Safety

A motor starts only from a deliberate operator command — a button on the display or in WebVisu. Stopping over CANopen is not a safety function: the inverter's STO terminals and the end-of-travel limits must be hard-wired.