Legacy Instructions

Extended Instructions
Legacy & Specialized

Leverage the power of Siemens' historical functions. From simulated mechanical drum sequencing to advanced diagnostic tools, master the extended instructions.

Why use Legacy instructions?

Legacy extended instructions are powerful function blocks originally designed to simplify complex tasks without requiring tedious manual programming. While some have been replaced by more modern methods, they remain essential for maintaining existing machine fleets or for their formidable efficiency in specific areas like sequencing (DRUM).

This section also covers low-level signal processing tools like BITSUM or SEG, as well as control algorithms like LEAD_LAG, providing increased flexibility for specialized industrial applications.

Sequencer

Sequential cam-based automation

DRUM — Drum Sequencer

DRUM

What it does

Simulates the operation of a mechanical cam drum. It allows defining several steps with specific output states for each step, triggered by time or external events.

When to use it

Simple cyclic processes like industrial washing, mixers, or sequential filling machines.

Pro Tips

Ideal for replacing a complex Grafcet when steps are primarily time-based.

Use the 'L_S' parameter to force a jump to a specific step.

The drum can manage up to 16 outputs simultaneously.

Control & Monitoring

Safe management of motors and valves

DCAT / MCAT — Control Alarms

MCAT

What they do

Monitor the activation of an actuator (motor for MCAT, discrete for DCAT) and generate an alarm if state feedback is not received within a set time.

When to use it

Securing motor commands or pneumatic valves with position fault detection.

Pro Tips

Incorporates internal 'Watchdog' logic to simplify your safety networks.

Very useful for reducing the number of networks in your standard control FBs.

Allows differentiating response times for opening and closing.

Special Comparisons

Pattern and matrix analysis

IMC / SMC — Masked Comparison

IMC

What they do

IMC compares two inputs bit by bit through a mask. SMC compares a bit matrix to detect changes over a complete cycle.

When to use it

Fault diagnosis or binary pattern conformity checking on production lines.

Pro Tips

IMC is perfect for ignoring 'non-important' bits during a comparison.

Use SMC to create diagnostic logs on input state changes.

These instructions are very high-performance for analyzing grouped signals.

Signal Processing

Algorithms and display conversion

BITSUM — Count Bits

BITSUM

What it does

Counts the total number of bits that are in the '1' state inside a word or double word.

When to use it

Production statistics (e.g., how many active faults out of 32), or redundancy checking.

Pro Tips

Faster than scanning 32 bits with a FOR loop.

Useful for detecting if more than one pump is active simultaneously.

Returns an integer value (Int).

SEG — 7-Segment Display

SEG

What it does

Converts a hexadecimal digit (0-F) into a bit pattern ready to drive a physical 7-segment display.

When to use it

Driving hardware displays directly via PLC outputs.

Pro Tips

Bit 0 usually corresponds to segment 'a', bit 1 to 'b', etc.

Essential for low-cost process display panels.

Takes a Byte as input.

Modernization vs Legacy

Should you still use these instructions?

NeedLegacy InstructionModern Alternative
Complex sequencingDRUMGRAPH (SFC)
Motor controlMCATStandard blocks (LAcyc)
Count bitsBITSUMSCL Loop (slower)
Numerical displaySEGHMI Screen (Panel)
RegulationLEAD_LAGPID_Compact
Masked comparisonIMCAND + == operator

Frequently Asked Questions

Is the DRUM instruction available on all CPUs?

It is mainly available on S7-1200 and S7-1500 to ensure transition from old S7-200/300 programs.

What is the utility of LEAD_LAG?

It is a lead-lag compensator used in control theory to stabilize a closed-loop system or improve its transient response.

Why use BITSUM for diagnostics?

If you have 16 alarm sensors grouped in a Word, BITSUM lets you instantly know how many alarms are present without testing them one by one.

Does SEG handle the decimal point?

The SEG instruction generates patterns for segments 0 to 15 (F). For the decimal point, you usually need to drive the 8th bit manually.

Migrate or optimize your Legacy code

T-IA Connect understands DRUM and MCAT instructions. Describe your old schemas, we translate them into modern TIA Portal code.