Overview
The Siemens LOGO! logic module exposes two visually similar but functionally distinct memory element families: the conventional M (Marker) flag and the IM (Internal Memory / open-connector) flag. In function block diagram (FBD) and ladder diagram (LAD) editing inside LOGO! Soft Comfort, both render as coil-like outputs and contact-like inputs, and both can be read an arbitrary number of times after they are set. Their intended role inside the editor, however, is fundamentally different: M flags are general-purpose latched or non-retentive bits, while IM flags exist primarily to act as open connectors that allow a network to be split across multiple physical rows or blocks in the editor while still behaving as a single continuous rung.
This distinction is particularly important for engineers migrating electromechanical schematics into LOGO! using LAD, because the IM element resolves a structural limitation of the editor: a long ladder rung cannot easily be written on a single line, and a stray wire in the middle of a row would otherwise need to be drawn back to the power rail. The IM element (sometimes also called the flag for open connector) is the editor's prescribed way to terminate a sub-network, drop down to a new line, and continue the same logical rung from a contact in the next row.
LOGO! Flag Inventory by Hardware Generation
The number of available markers depends on the LOGO! base module generation. The published counts in the official Siemens LOGO! product support page are summarized below.
| LOGO! Generation | Order Number Family | Digital M Flags | Analog AM Flags | IM (Open Connector) Flags | Max Program Blocks |
|---|---|---|---|---|---|
| LOGO! 8 (0BA8) Standard | 6ED1052-xxx08-0BA8 | 64 (M1..M64) | 32 (AM1..AM32) | 64 (IM1..IM64) | 400 |
| LOGO! 8.3 (0BA8) FS4 | 6ED1052-xxx08-0BA1 | 64 | 32 | 64 | 400 |
| LOGO! 7 (0BA7) | 6ED1052-1x | 32 | 16 | 32 | 200 |
| LOGO! 6 (0BA6) | 6ED1052-1x | 32 | 16 | 32 | 200 |
IM flags are not part of the retentive or run-time memory map that LOGO! exposes to HMI displays; they are an editor construct that compiles down to internal nets. Even so, they consume a numbered address in the same flag namespace, so reusing IM1 as a regular marker and as an open-connector in the same program is permitted but discouraged for readability.
M (Marker) Flags: Functional Definition
An M flag is a single-bit memory element that exists in two forms:
- Marker output (coil) – placed on the right-hand power rail of a network; when the rung is TRUE, the bit is set to 1; when the rung is FALSE, the bit is reset to 0.
- Marker input (contact) – a normally-open or normally-closed contact that reflects the current state of the bit.
Marker flags are bidirectional: a single M address can be written once (as a coil) and read many times (as multiple contacts) anywhere else in the program. The state of a standard M flag is volatile – it is lost on power-down / cold restart, identical to a discrete output that is not configured as retentive. To make a marker survive a power cycle, it must be flagged as Retentive in the block properties dialog. In LOGO! 8, up to 250 M flags can be flagged as retentive (subject to device limits; see the system manual for the exact bound on the specific 0BA8 variant).
Marker flags can be freely intermixed with digital inputs (I), digital outputs (Q), and shift register bits (S). They appear on the HMI / LOGO! display and in Web Server / Modbus TCP read maps under their M-address, which is what allows them to be used as low-cost latching relays, edge detectors, and alarm latches.
IM (Internal Memory / Open Connector) Flags: Functional Definition
The IM element solves a single, well-defined problem: how to terminate a sub-network in the editor and continue the same logical rung from a new row without drawing a literal wire. In the FBD and LAD editors of LOGO! Soft Comfort, this is achieved by placing an IM coil at the end of the upper sub-network and an IM contact (referencing the same IM number) at the start of the continuation row. The rung state is passed through the IM element exactly as if the two rows were joined by a wire.
Key behavioral properties of the IM element:
- The IM element does not retain state between scans in the way a real coil does; it is a structural connector, not a latch. Each program cycle, the IM contact on the continuation row sees the instantaneous evaluated result of the upstream sub-network at the moment the IM coil was energized.
- An IM number may be reused multiple times within a program as an open connector, because the editor only needs a unique identifier to pair the IM coil and IM contact. Two IM1 coils in different sub-networks are legal and are treated as two independent connectors.
- IM elements do not appear in the LOGO! display or in the Web Server tag browser, and they are not addressable over Modbus TCP. They exist purely inside the compiled user program.
- Placing an IM contact on the same row as a marker coil is legal but redundant – the IM contact will simply mirror the marker; use a marker contact instead.
Why the Two Types Exist: Editor Architecture
LOGO! Soft Comfort compiles a program into a directed graph of function blocks and connector nets. In FBD, every connection is a wire drawn between block output pins, so net continuity is a visual property. In LAD, however, the editor was originally a true ladder grid, and the original LOGO! (0BA0..0BA3) only allowed a limited number of elements per row. Long control schematics – for example, the 1978-era pump-station or machine-tool interlocks that many engineers still convert today – routinely exceed 7 or 8 contacts, which is the typical physical row length displayed in the editor.
The IM element was introduced in the 0BA4 generation specifically to break this physical constraint without forcing the user to introduce a true memory bit. Conceptually, it is the editor equivalent of a solder bridge: it conveys the rung's energised state across a row boundary without storing it. The fact that the IM element exposes the same coil/contact syntax as an M flag is a usability choice – it lets a programmer learn one symbol pair instead of two.
Side-by-Side Comparison
| Property | M Flag | IM (Open Connector) Flag |
|---|---|---|
| Purpose | Persistent / runtime memory bit | Row-to-row net bridge |
| Retentive option | Yes (via block property) | No (structural only) |
| Visible on LOGO! display | Yes | No |
| Accessible via Web Server / Modbus | Yes | No |
| Reusable as coil multiple times | Not recommended (last assignment wins in some tools) | Yes, by design |
| Consumes numbered address in flag table | Yes (M1..M64) | Yes (IM1..IM64) |
| Counted against device resource budget | Yes | No (compiled away) |
| Appropriate for latching, alarms, hand-off-auto | Yes | No |
| Appropriate for splitting a long ladder rung | Possible but wasteful | Yes (intended use) |
Worked Example: Splitting a Long Ladder Rung
Consider a permissive-start condition for a 1978-era machine: Start pushbutton (I1) AND guard interlock (I2) AND oil-pressure OK (I3) AND motor-thermal OK (I4) AND E-stop released (I5) -> energise output Q1 and latch via M1. In a single LAD row this exceeds the editor's width, so the engineer must split it. The IM technique preserves the visual ladder metaphor.
Sub-network 1 (top row):
I1 ]--[ I2 ]--[ I3 ]--[ I4 ]--[ I5 ]--( IM1 )--
Sub-network 2 (next row):
|--[ IM1 ]--( Q1 )--
Then a parallel latch is built using a marker for memory:
|--+--[ Q1 ]-- |
|--[ M1 ]--[ Stop (NC, I6) ]--( M1 )--
In this fragment, IM1 is purely structural – it carries the energised state of the five-input AND gate down to the next row. M1 is the actual latching memory bit that survives across scan cycles and is the correct element to expose on the HMI for hand-off-auto selection.
Common Pitfalls When Using IM Flags
- Treating IM as a latching bit. Because the IM element looks identical to a marker coil, beginners sometimes wire an IM contact downstream of an IM coil expecting persistence. The bit is not latched; it follows the upstream rung state every scan. Use M flags for any state that must survive a cycle.
- Number collision with marker map. The IM namespace is independent of the M namespace, so IM1 and M1 can coexist. However, the LOGO! display and Web Server only show M (and Q, I, AI, AQ, AM, S) addresses, which can confuse maintenance technicians who cannot see why an IM reference in the code is not appearing as a tag.
- Cut / paste corruption in LAD. A well-known issue with the LAD editor in Soft Comfort V8.0 through V8.3 is that cutting and pasting a sub-network containing an IM coil without its matching IM contact can leave a dangling IM reference. The program will still compile, but the rung will evaluate incorrectly. Always verify the IM coil/contact pairing after any cut/paste operation, and consider re-authoring long rungs in FBD where the same logic does not require IM elements at all.
- Over-use in FBD. IM elements are unnecessary in FBD because the editor draws explicit wires between block outputs. Inserting an IM pair in FBD simply consumes an address from the IM table without providing any benefit.
- Confusion with shift register bits. The Shift block (S) and the IM element are unrelated. S bits are sequential memory stages with a fixed bit depth; IM elements are connector nets.
When to Use M vs IM: Decision Matrix
| Scenario | Correct Element | Reason |
|---|---|---|
| Latching a start / stop pushbutton pair | M flag | State must persist between scans |
| Splitting a long ladder rung across two rows | IM flag | Purely structural; no state to retain |
| Storing a fault alarm until operator acknowledge | M flag (retentive) | State must survive power cycle |
| Exposing a state to the LOGO! display or web server | M flag | IM not visible to HMI / Web |
| Reading via Modbus TCP from a SCADA | M flag | IM not addressable over Modbus |
| Passing rung logic from row 1 to row 2 in LAD | IM flag | Standard ladder row-break mechanism |
| Building a one-shot / edge detector | M flag | Edge memory must be retained within a scan |
Verification Procedure
- Open the program in LOGO! Soft Comfort V8.3 or later, then select Tools → Simulation to enter the on-screen simulator.
- Force the upstream inputs of any IM row-break through the I/O panel and confirm that the downstream element energises and de-energises in real time, with no scan delay.
- Power-cycle the simulated LOGO! (Simulation → Power Off / On) and verify that any non-retentive M flag resets, while any IM element re-evaluates fresh from the upstream rung on the first scan after restart.
- From the project tree, open Tools → Information → Block List and confirm that the IM numbers in use are not exceeding the published IM count for the target base module (64 for LOGO! 8).
- If the program will be downloaded to a real base module, perform an offline → online comparison (Tools → Compare) to confirm that the IM references are present in the on-board project as expected.
- Use the Web Server (LOGOTM Web Editor) on a LOGO! 8 base module to confirm that every M flag you intended to monitor is visible under Variables, and that no IM address is listed – this is the cleanest proof that the program is using IM only as a structural element.
Best-Practices Checklist
- Reserve a contiguous block of IM numbers (e.g. IM1..IM16) for row breaks and never co-mingle them with M flags in the same numeric range.
- Add a brief comment on the IM coil indicating which continuation row it feeds, e.g. "IM1 → row 4 of Network 3".
- If a ladder rung still needs to be broken after the first break, use IM2, IM3, ... in sequence rather than re-using IM1 to keep the diagram unambiguous.
- For new projects, prefer FBD unless a corporate standard mandates LAD – FBD does not require IM elements and the resulting program is easier to maintain.
- Never read an IM element in a way that depends on its state being held; it is not a memory bit.
Related Editor Constructs
Engineers who are new to LOGO! sometimes confuse IM with three other editor elements:
- Open connector (X) – a true graphic-only connector in FBD that pairs two wires visually but does not introduce a numbered IM address. In LAD, the open connector is rendered as an IM coil/contact pair.
- Flag (M) – a true runtime memory bit; see above.
- Shift register bit (S) – an indexed element of a Shift block, addressed S1.1, S1.2, ... in older firmware or Sx.y notation in LOGO! 8.
The official Siemens LOGO! 8 System Manual (entry ID 109751136) is the authoritative reference for the exact IM and M counts per device variant, while the LOGO! product support portal lists current firmware (currently V8.3.1) and the matching Soft Comfort version.
What is the practical difference between an M flag and an IM flag in LOGO!?
An M flag is a runtime memory bit that can be latched (or made retentive) and is visible on the LOGO! display, the Web Server, and over Modbus TCP. An IM flag is an open-connector used purely to bridge a ladder rung from one editor row to the next; it does not retain state and is not exposed outside the user program.
Can an IM flag be used as a latching relay substitute?
No. The IM element is a structural connector that follows the upstream rung every scan. For latching behaviour, use an M flag wired as a seal-in (latching) contact, and flag it as retentive if it must survive a power cycle.
How many IM flags are available on a LOGO! 8 base module?
LOGO! 8 (0BA8 / 0BA8 FS4) provides 64 IM flags, numbered IM1..IM64. LOGO! 7 and earlier provide 32 IM flags. The exact count is published in the LOGO! 8 System Manual on the Siemens Industry Online Support portal.
Why does LAD need IM flags at all?
Long ladder rungs cannot be drawn on a single editor row, and the LAD editor cannot draw a physical wire from a mid-row contact back up to the power rail. The IM coil/contact pair is the prescribed way to terminate a sub-network and continue the same logical rung from a contact in the next row, exactly as if a wire joined the two rows.
Should I write new LOGO! programs in LAD or FBD to avoid IM-flag issues?
For new projects, FBD is generally preferred because the editor draws explicit wires between block outputs and the IM element is unnecessary. LAD remains valid and is familiar to electricians trained on relay schematics, but requires disciplined use of IM row breaks and care when cut-and-pasting sub-networks.