Overview
The Siemens LOGO! 0BA5 logic module provides four built-in cursor keys (C1, C2, C3, C4) on the integrated display that can be assigned to digital input functions inside the LOGO! program. Many integrators want to reuse these keys as a free "user interface" once every discrete I/O point is taken by sensors and actuators, particularly when retrofitting a machine with expansions such as the DM16 24R (0BA0) and DM8 (0BA1). This reference shows the supported methods to make a cursor key event increment or decrement an up/down counter, drive an off-delay timer preset, and display the current value in a message text block on the LOGO! display.
The hardware documented in the field application is:
- LOGO! 0BA5 base module, AC/DC 24 V variant, 8 digital inputs (2 of them re-configurable as analog inputs), 8 digital outputs.
- LOGO! DM16 24R expansion (0BA0), 8 inputs / 8 relay outputs.
- LOGO! DM8 expansion (0BA1), 4 inputs / 4 outputs.
After the expansion stack is applied, only 4 free outputs remain, and all discrete inputs are reserved by the process. The cursor keys therefore become the only spare signal source for operator adjustments.
LOGO! 0BA5 Hardware and Cursor Key Architecture
The 0BA5 generation (also referenced as LOGO! 6 hardware) supports the four front-panel cursor keys as virtual digital inputs that can be wired to any function block in the circuit diagram, exactly like a physical DI. According to the LOGO! 0BA5 System Manual (Siemens Online Support, entry ID 109741410):
- C1 = cursor up arrow
- C2 = cursor down arrow
- C3 = cursor left arrow
- C4 = cursor right arrow
- ESC = escape key, also used as a "modifier"
- OK = enter key
Each cursor key can be used individually or combined with ESC to form a two-button operator action. The supported ESC + Cx combinations behave as additional virtual inputs, which the LOGO! editor exposes as separate flags. This is the mechanism used to differentiate "browse" presses from "edit" presses inside the running program.
Why the Cursor Key "Wraps" the Counter
On every LOGO! display the up-arrow points to the smaller displayed value and the down-arrow points to the larger one. This follows the convention that arrows describe the direction the value moves under the key. Microsoft has documented the same expectation in its Old New Thing developer blog ("Why do up-down controls have the arrows backwards?"): a spin button's arrow represents the change in value, not the change in physical position. The LOGO! cursor keys follow the same model:
- Up arrow (C1) = increment the focused value (numbers grow upward in the sense of "rolling forward" through the parameter).
- Down arrow (C2) = decrement the focused value.
- Left/Right arrows (C3 / C4) = move focus between editable fields; they do not directly change a counter.
This convention is also reproduced in third-party UI toolkits - see the vizia spinbox issue #730 where the same up/down vs. left/right split is debated. The takeaway for LOGO! users is that C1 always maps to increment, C2 to decrement, and that mixing arrow direction with counter direction is a common source of confusion.
Function Block Wiring: Cursor Key to Up/Down Counter
The Up/Down Counter block (function block number B001 in the LOGO! special functions list) has the following relevant inputs:
| Input | Purpose | Typical wire from cursor key |
|---|---|---|
| Cnt | Count pulse | C1 (ESC+C1 for filtered use) |
| Dir | Count direction (0 = up, 1 = down) | C2 - or a constant "0" if only incrementing |
| Res | Reset counter to 0 | ESC + C3 |
| On | Enable counter | High (constant 1) |
A minimal increment-by-one program therefore looks like the ladder equivalent below. (LOGO! SoftComfort displays this as FBD; the equivalent ladder view is shown for engineers used to RSLogix-style editors.)
| ESC + C1 --[ ]--+----[ ]--+--(Cnt)--[ B001 Up/Down Counter ]
| | |
| | +--(Dir)--[ B001 ] <- tied to C2 or fixed 0
| |
| +--(Res)--[ ESC + C3 ]--( B001 reset )
|
| B001.Cnt --------->[ B002 Off-Delay ] parameter "T"
Important wiring rules taken from the LOGO! 0BA5 System Manual:
- The Up/Down Counter block must have On = High at all times when you want it to react to pulses; otherwise the block freezes and ignores Cnt events.
- Retentivity must be enabled on B001 if you want the value to survive a power cycle. Set the "Retentive" parameter to "on" in the block properties dialog.
- The On threshold / Off threshold parameters on B001 control the boolean output AQ; they do not affect the numeric value used for the off-delay parameter.
Using ESC + Cursor Combinations
Naively wiring C1 directly into the counter causes every bump of the cursor key during normal parameter browse to register as a count pulse. The supported mitigation is the ESC + C1 combo, exposed by the LOGO! operating system as a single virtual flag:
| Key combination | Virtual input flag | Suggested use |
|---|---|---|
| C1 alone | Cursor up (low/high transient) | Browse parameters in message text |
| ESC + C1 | EscUp | Increment counter (intentional press) |
| C2 alone | Cursor down | Browse parameters in message text |
| ESC + C2 | EscDown | Decrement counter |
| C3 alone | Cursor left | Move between message text fields |
| ESC + C3 | EscLeft | Reset counter (Res input) |
| C4 alone | Cursor right | Move between message text fields |
| ESC + C4 | EscRight | Optional "Preset" or "Save" action |
This way the operator presses ESC with one hand and the desired cursor key with the other, producing a deliberate two-handed press that is far less likely to happen by accident while the operator is scrolling through menu options.
Driving an Off-Delay Timer with the Counter Value
To make the off-delay time follow the counter value, wire the B001 Cnt value output to the T parameter of an Off-Delay block (B002). In SoftComfort:
- Insert "Off-Delay" (special function, "Timer", second row in the dialog) and open its properties.
- Replace the constant time value with a reference to the counter: click the small connector icon next to the T field and select B001 -> Cnt.
- Set the time base to the resolution you actually need. For values up to 99 s use base "1 s"; for longer values up to 99 min use "1 min". Mixing the time base with a unitless counter value (which is just an integer in hundredths of the time base) is the most common off-delay bug.
- Enable retentivity on B002 if you want the remaining time to survive a power cycle.
Parameter mapping example with time base = 1 s:
| Counter Cnt value | Off-delay T interpreted | Real time |
|---|---|---|
| 1 | 1 hundredth of 1 s | 10 ms |
| 10 | 10 hundredths of 1 s | 100 ms |
| 100 | 100 hundredths of 1 s | 1.000 s |
| 5500 | 5500 hundredths of 1 s | 55.00 s |
| 9900 | 9900 hundredths of 1 s | 99.00 s |
The conversion factor for any LOGO! timer is fixed by the selected time base: T_real = Cnt / (100 / TimeBase). With time base = 1 s this simplifies to T_real = Cnt / 100. With time base = 1 min it becomes T_real = Cnt / 100 minutes.
Showing the Counter Value in a Message Text Block
Use a Message Text block (special function "Message Text") to display the live counter value on the LOGO! display. Wire the B001 output Cnt into the message text "Value" parameter and add the label string. Example configuration in SoftComfort:
Message text 1
Input : B001 / AQ (Boolean enable)
Line 1 : "OFF-DELAY SETTING"
Line 2 : "%d s" (placeholder for integer)
Value : B001 Cnt / 100
If you prefer the raw counter number to be visible (e.g. 5500 hundredths of a second rather than 55 s), drop the divide-by-100 step and use the value directly. To prevent the message from blanking the display when the timer runs, keep the message Input always high and use a separate condition (e.g. AQ of the counter threshold) to gate the actual content.
Alternative Methods When Cursor Keys Are Too Slow
Incrementing the counter by 1 every time you press ESC+C1 is fine for fine tuning but extremely slow if you need to set, say, 55 seconds. Three well-supported alternatives are described below.
Method 1 - Coarser Pulse Weight
Multiply each pulse by a fixed factor by inserting an arithmetic block between the cursor key and the counter:
ESC+C1 ---[ ]----(B003 Arith: +10 )----(Cnt)--[ B001 Up/Down Counter ]
Every key press now bumps the counter by 10, which means ten presses instead of fifty-five to reach 55 seconds. This is the smallest hardware change and is the typical first optimization.
Method 2 - Analog Input + Potentiometer + Analog Amplifier
The 0BA5 base module exposes I7 and I8 as analog inputs (0 to 10 V DC) on the AC/DC 24 V variant. The field application had both reserved, but if even one is free in another machine, the recommended path is:
- Wire a 10 kΩ potentiometer between +24 V (terminal +24 V on the LOGO! power) and GND (terminal M).
- Connect the wiper to AI1 (I7 on the AC variant).
- Insert an Analog Amplifier block (special function "Analog", first entry) and set the sensor type to "0 to 10 V".
- Configure the amplifier's min/max to map the voltage range onto the desired counter range (e.g. 0 to 9900 for 0 to 99 s).
- Wire the amplifier output directly to the Off-Delay T parameter - the analog amplifier already produces a value with the right scaling.
This is the "classic" LOGO! solution for operator-adjustable time presets and is documented in detail in the LOGO! 0BA5 System Manual chapter on analog value processing.
Method 3 - Discrete Preset Selection
If neither analog input is free, use the cursor keys as a "step selector" and switch between preset constants:
- Add one Up/Down Counter wired to ESC+C1 (increment) and ESC+C2 (decrement) as in the basic method.
- Limit the counter range using On threshold = 5 and Off threshold = 0 with Output = On when Cnt >= On.
- Convert the resulting count (0 to 5) into a discrete preset by feeding it through a Analog Multiplexer (special function "Analog Mux").
- Wire each of the mux inputs to a fixed time constant (e.g. 1000, 2000, 3000, 4000, 5000 hundredths of a second).
The operator cycles between "10 s, 20 s, 30 s, 40 s, 50 s" with two button presses instead of fifty. This pattern is more reliable on a 0BA5 than direct 1-step incrementing because every press produces a meaningful, repeatable result.
Pre-Initializing the Counter to a Select Value
A frequently asked follow-up is "how do I start the counter at a non-zero value?" The Up/Down Counter block itself does not expose a Preset input like the regular Counter block does. Two supported workarounds exist:
Workaround A - Manual Pre-Count Pulse Train
On program start (use a flag such as M8 "Init run" which is high for one cycle after the LOGO! enters RUN), generate N pulses to the counter's Cnt input using a pulse generator and a second counter acting as the "preset counter".
Workaround B - Use a Regular Counter Block with Preset
The plain Counter block (B004 in many programs) has a Counter -> Cnt range input and a Start value configurable as a parameter. Wire the cursor key to its increment input and set the start value to the desired initial count. If you also need a decrement, combine two Counter blocks with a comparator to subtract.
This is the simplest path when the user "just needs to initialize at a value" rather than continuously increment during operation.
Debouncing Cursor Keys in LOGO!
Mechanical-style bouncing is not an issue with the LOGO! cursor keys (they are Hall-effect on 0BA5), but operator double-tapping is. To prevent the counter from advancing twice per intended press, place a Pulse Generator (special function "Pulse Generator") or an On-Delay (50 ms) between the cursor key flag and the counter Cnt input. Recommended values:
| Filter | Time | Use case |
|---|---|---|
| On-Delay | 50 ms | Suppress bouncing and rapid re-trigger |
| Off-Delay | 200 ms | Long press needs to be detected as a single increment |
| Pulse Generator | Th = 50 ms, Tl = 1 s | Auto-repeat while held (useful for fast scrolling to a value) |
Parameter Sheet - Common LOGO! 0BA5 Limits
| Parameter | 0BA5 Base | DM16 24R | DM8 |
|---|---|---|---|
| Order number (example) | 6ED1052-1CC01-0BA5 | 6ED1055-1NB10-0BA0 | 6ED1055-1HB00-0BA1 |
| Digital inputs | 8 (2 analog) | 8 | 4 |
| Digital outputs | 8 transistor | 8 relay | 4 relay |
| Function blocks max | 200 (typical) | - | - |
| Cursor keys usable as inputs | Yes | No | No |
| ESC + Cursor combo usable | Yes | No | No |
Step-by-Step Commissioning Procedure
- Identify the program window: Connect LOGO! SoftComfort via Ethernet (the 0BA5 supports the LOGO! 8/0BA8 Ethernet cable) and download the circuit to the base module.
- Add the Up/Down Counter block and name it B001. Set the On threshold / Off threshold to the range you want to display (e.g. 10 / 0).
- Add the Off-Delay block B002 and wire its T to B001 / Cnt. Select time base = 1 s.
- Wire ESC+C1 to B001 / Cnt via a 50 ms on-delay for debouncing.
- Wire ESC+C2 to B001 / Dir (level signal, not pulse) so the direction toggles when ESC+down is pressed. For pure increment, tie Dir to constant 0.
- Wire ESC+C3 to B001 / Res so the operator can zero the counter.
- Add a Message Text block B003. Set Input = M1 (always high) and Value = B001 / Cnt / 100 so it shows seconds.
- Download the program to the LOGO! and switch to RUN.
- Verify in RUN mode by pressing ESC+C1 and watching the message text increase by 1 per press.
- Verify debouncing by mashing ESC+C1 rapidly; the counter should advance roughly once per ~150 ms even with rapid tapping.
Verification Checklist
- Counter increments by exactly 1 per deliberate ESC+C1 press.
- Counter decrements by exactly 1 per deliberate ESC+C2 press.
- Counter resets to 0 on ESC+C3 press.
- Off-Delay time base = 1 s, value tracks Cnt / 100, displayed in message text.
- Retentivity on B001 is enabled if the application must survive power loss.
- If using the analog input method instead, the off-delay range can be adjusted from the potentiometer without any cursor key press.
- No accidental increments when only C1 is pressed without ESC.
Common Errors and How to Avoid Them
| Symptom | Root cause | Fix |
|---|---|---|
| Counter never moves | Cnt input wired to a non-existent flag name | Re-drag ESC+C1 from the LOGO! cursor key palette in SoftComfort |
| Counter jumps by 2-3 per press | Cursor key flag debounced by firmware differently than expected | Insert 50 ms on-delay between flag and Cnt |
| Off-delay always 0 | T parameter wired to AQ (boolean) instead of Cnt (integer) | Re-wire to the integer Cnt output |
| Message text blank | Input of message text block is low | Tie Input to a high flag or to AQ of B001 |
| Counter resets at power-up | Retentivity disabled on B001 | Open block properties and tick "Retentive" |
| Direction is inverted from arrow | Dir wired to C1 instead of C2 | Swap the wires or invert the direction with an NOT gate |
| ESC+C1 not detected at all | Operator releases ESC before the cursor key | Hold ESC during the cursor key transition; review operator training |
FAQ
Can a Siemens LOGO! 0BA5 use the cursor keys as digital inputs?
Yes. The four cursor keys (C1-C4) and the ESC combinations (ESC+C1..C4) are exposed as virtual inputs inside the LOGO! circuit diagram, identical to wiring a physical digital input. Reference the LOGO! 0BA5 System Manual for the exact flag names.
How do I increment an Up/Down Counter by one with a single cursor press?
Wire the ESC+C1 flag to the counter's Cnt input and keep On = High. Add a 50 ms on-delay to debounce accidental double presses. Set the Dir input to constant 0 for pure incrementing.
How can I set an off-delay timer value without typing numbers?
Use an Up/Down Counter block to accumulate cursor key pulses, then wire its integer output to the T parameter of an Off-Delay block. With time base = 1 s, divide the counter value by 100 to convert hundredths to seconds. An analog potentiometer on I7/I8 with an Analog Amplifier is the cleaner alternative when one analog input is free.
Why does the up-arrow decrement on a LOGO! display?
It does not - on a LOGO! the up-arrow increments and the down-arrow decrements when a parameter is being edited. The arrow represents the value change, not the cursor's physical position. This convention is shared with most modern UI controls; see the Microsoft developer blog explanation and the vizia spinbox discussion.
Can I preset the counter to a non-zero value at start-up?
The Up/Down Counter block has no Preset input. Use the regular Counter block with its Start value parameter if you only need a one-time initial value, or generate N pulse-train counts on the first LOGO! RUN cycle via a flag (M8) and a pulse generator.
Does the DM16 24R or DM8 expansion also expose cursor keys?
No. Only the base module with an integrated display exposes the cursor keys. The DM16 24R and DM8 expansions are I/O-only and have no front-panel keys. They inherit the cursor key flags from the base module but do not add new ones.