LOGO! Web Editor Weekly Timer and Astronomical Clock Input Setup

David Krause15 min read
HMI ProgrammingSiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview

The Siemens LOGO! 8 Base Module (catalog numbers 6ED1052-1MD08-0BA1, 6ED1052-1HB08-0BA1, 6ED1052-1FB08-0BA1, and the LOGO! 8.3 variants 6ED1052-xxx08-0BA2) integrates a programmable logic relay with a built-in Ethernet web server. Using the LOGO! Web Editor (LWE), engineers author custom HTML pages served by the LOGO! Base Module, exposing both control elements (buttons, switches) and parameter values (analog inputs, thresholds, timers) for browser-based operator interfaces.

Two LOGO!Soft Comfort function blocks consistently generate support questions when exposed through LWE custom web pages: the Weekly Timer (parameterized by ON time and OFF time) and the Astronomical Clock (parameterized by longitude, latitude, and time zone). The root cause in nearly every case is selection of the wrong variable type within LWE: the web editor must use scale time rather than analog value for time fields, and longitude/latitude must be treated as four bytes in series rather than as a single raw integer.

This reference covers the correct encoding, the rationale behind it, and a step-by-step configuration procedure verified against LWE V1.1.1. It supplements the Siemens support article 109741041 on the astronomical clock function and the Time-Controlled Lighting with LOGO! 8 and LOGO! CMR application example.

Prerequisites

  • LOGO! 8 or LOGO! 8.3 Base Module with Ethernet interface.
  • Firmware FS:04 or later. Earlier firmware revisions may not host the full LWE feature set.
  • LOGO!Soft Comfort V8.0 or later for program development and download.
  • LOGO! Web Editor (LWE) V1.1.1 or later. Versions prior to V1.1.1 may treat time parameters as analog values by default.
  • Web browser supporting HTML5 and JavaScript (Chrome, Firefox, Edge) for runtime verification.
  • Micro SD card (max 32 GB, FAT32) with sufficient free space for the LOGO! project plus the /logo/ web directory.
  • Network connectivity to the LOGO! Base Module IP address (default 192.168.0.1, configurable from LOGO!Soft Comfort or the LOGO! onboard display).
Note: LWE V1.1.1 is required for the behavior described here. Earlier versions may not expose the scale-time input type or may default to analog-value encoding for time fields. Confirm the LWE Help → About version before configuring inputs.

LOGO! Web Editor Architecture and Variable Memory

The LOGO! Base Module exposes process data to the integrated web server through its Variable Memory (VM) area. Each VM byte corresponds to a specific tag or parameter within the running LOGO!Soft Comfort program. LWE generates an HTML page that reads and writes VM bytes through AJAX calls to internal endpoints such as /logo/ajax and /logo/cmd.

When the LWE user drops an input widget onto the canvas and binds it to a VM address, the editor asks the user to declare the data type. Available types include:

  • Digital value — 1 bit per address (0 or 1).
  • Analog value (16-bit) — signed 16-bit integer, range -32768 to +32767.
  • Analog value (32-bit) — signed 32-bit integer, range -2147483648 to +2147483647.
  • Float (32-bit IEEE 754) — single-precision float, 4 bytes.
  • Scale time — LOGO!-specific BCD encoding used for time-of-day and timer parameters.

Selecting the wrong type is the single largest source of custom web page malfunctions on LOGO!. The remainder of this reference addresses the two cases that produce the most confusion: Weekly Timer parameters and Astronomical Clock parameters.

Weekly Timer Web Input Format

The Weekly Timer function block in LOGO!Soft Comfort exposes ON time and OFF time parameters in hours and minutes. Internally these are encoded in a BCD-style format that LWE labels scale time. Each time field occupies one VM byte and is interpreted as follows:

Bit Range Field Range / Encoding
Bits 7..4 Tens of hours 0..2 (BCD digit)
Bits 3..0 Units of hours 0..9 (BCD digit)
Bits 7..4 of byte +1 Tens of minutes 0..5 (BCD digit)
Bits 3..0 of byte +1 Units of minutes 0..9 (BCD digit)

A complete Weekly Timer ON-time entry therefore consumes two VM bytes. For example, the value 06:45 is encoded as 0x06 (BCD hours) followed by 0x45 (BCD minutes). When the operator types 06:45 into an LWE input widget, the editor must convert the human-readable string into the BCD bytes before pushing them to the LOGO!.

Why Scale Time, Not Analog Value

If the LWE widget is configured as an analog value, the editor treats the byte pair as a 16-bit signed integer. The two bytes 0x06 0x45 would be interpreted as the integer 0x0645 = 1605 decimal — not 06:45. The LOGO! Weekly Timer block, expecting BCD scale-time data, rejects or silently corrupts the parameter. The fault typically manifests as the timer output never activating, or activating at the wrong moment, without any explicit error message.

Selecting scale time in LWE instructs the editor to:

  1. Parse the input string in HH:MM format.
  2. Validate that hours are 0..23 and minutes are 0..59.
  3. Convert each field to its BCD nibble representation.
  4. Write the resulting bytes to the two configured VM addresses.
Common symptom: Times entered on the web page appear off by a factor of 60 or the timer never fires. Switching the widget from analog value to scale time resolves the issue immediately.

Byte Layout for ON/OFF Times

Configure the LWE widget with two VM addresses: one for hours, one for minutes. The LOGO!Soft Comfort project must use the same VM addresses for the Weekly Timer's ON-time and OFF-time parameters. The mapping for a typical Weekly Timer block B001 is:

Parameter VM Byte Address (typical) Encoding
ON-time, hours VB0 (low byte of VW0) BCD 0..23
ON-time, minutes VB1 (high byte of VW0) BCD 0..59
OFF-time, hours VB2 (low byte of VW2) BCD 0..23
OFF-time, minutes VB3 (high byte of VW2) BCD 0..59

Exact VM addresses depend on the program layout. Always cross-reference the LOGO!Soft Comfort Tools → Parameter VM Mapping table to confirm the byte offset allocated to each Weekly Timer block in your specific program.

Astronomical Clock Web Input Format

The Astronomical Clock function block computes sunrise (TR) and sunset (TS) times for a given geographic location. It exposes three parameters to the user: longitude, latitude, and time zone offset. Each geographic coordinate is a signed decimal degree value with one decimal place of precision — for example, longitude 13.4050 (Berlin), latitude 52.5200 (Berlin), time zone 1 (CET).

Longitude range: -180.0 to +180.0 (negative = western hemisphere).
Latitude range: -90.0 to +90.0 (negative = southern hemisphere).
Time zone range: -12 to +14 (whole-hour offset from UTC).

Internally, the LOGO! represents each coordinate as a 32-bit IEEE 754 single-precision float. Because LWE byte-level editing operates on individual bytes, the float must be presented as four consecutive bytes in series. The Longitude and the Latitude are each four bytes in series values, with each byte representing one component of the IEEE 754 representation. The JavaScript runtime inside the generated HTML page handles the conversion transparently when the widget type is correctly set to Float.

IEEE 754 Single-Precision Layout

A 32-bit float occupies four bytes. The byte order observed by LWE on LOGO! 8 is little-endian, matching the x86/ARM convention. For the longitude 13.4050 (0x41566E14 in IEEE 754):

Byte Offset Hex Value Decimal
+0 (LSB) 0x14 20
+1 0x6E 110
+2 0x56 86
+3 (MSB) 0x41 65

LWE presents each of these four bytes as part of a single Float widget bound to its starting VM address. The operator types 13.4050 once, and the LWE JavaScript splits the float into its IEEE 754 components before pushing them to VM. Selecting analog value or digital value instead of float mis-encodes the value and the astronomical clock computes sunrise/sunset from garbage coordinates, often producing nonsensical on/off transitions.

Time Zone Encoding

Time zone is a signed 8-bit integer in the range -12..+14. It occupies a single VM byte and may be exposed as a simple analog value widget with range limits. No special encoding is required beyond configuring the widget's allowed min/max.

Recommended VM Layout for Astronomical Clock

Parameter VM Address (typical) Type Encoding
Longitude, byte 0 (LSB) VB100 Float component IEEE 754 bits 7..0
Longitude, byte 1 VB101 Float component IEEE 754 bits 15..8
Longitude, byte 2 VB102 Float component IEEE 754 bits 23..16
Longitude, byte 3 (MSB) VB103 Float component IEEE 754 bits 31..24
Latitude, byte 0 (LSB) VB104 Float component IEEE 754 bits 7..0
Latitude, byte 1 VB105 Float component IEEE 754 bits 15..8
Latitude, byte 2 VB106 Float component IEEE 754 bits 23..16
Latitude, byte 3 (MSB) VB107 Float component IEEE 754 bits 31..24
Time zone VB108 Analog value Signed 8-bit, -12..+14

Confirm exact VM offsets in LOGO!Soft Comfort under Tools → Parameter VM Mapping. The address ranges above are illustrative; the actual offsets depend on the program.

Step-by-Step Configuration Procedure

  1. Open the LOGO!Soft Comfort project and place a Weekly Timer block (B001) and an Astronomical Clock block (B002). Configure the function blocks with default parameters and download the program to the LOGO! Base Module.
  2. Open LOGO! Web Editor V1.1.1 and create a new project. From the LWE main menu choose File → New.
  3. In the LWE project tree, drag an Input Field widget onto the canvas. In its properties, bind it to the VM address corresponding to the Weekly Timer ON-time hours byte.
  4. Set the widget's Type to Scale Time. This is the critical step. Do not select Analog Value.
  5. Add a second Input Field bound to the ON-time minutes byte, also typed as Scale Time.
  6. Repeat steps 3–5 for the OFF-time (hours and minutes).
  7. For the Astronomical Clock longitude, drag a single Input Field onto the canvas. Bind it to the first of the four longitude bytes (VB100 in the example). Set its type to Float (32-bit IEEE 754, little-endian, 4-byte series). LWE V1.1.1 automatically reserves the next three VM bytes (VB101, VB102, VB103) for the remaining float components.
  8. Repeat step 7 for latitude, binding to the next available float offset (VB104..VB107).
  9. For time zone, drag an Input Field bound to VB108. Set type to Analog Value with min -12 and max +14.
  10. Save the LWE project and copy the generated /logo/ directory to the SD card root.
  11. Insert the SD card into the LOGO! Base Module and power-cycle the module.
  12. Browse to http://<logo-ip>/logo/index.html. Authenticate with the configured LWE credentials (default username admin; the password is whatever was configured in the LWE project under Web Server → Password).
  13. Enter the desired ON/OFF times and longitude/latitude values. Click Apply or the equivalent submit button. The LWE JavaScript converts the strings to the correct byte encodings and pushes them to VM.
  14. Monitor the LOGO! onboard display or LOGO!Soft Comfort online mode to confirm the new values are accepted and the Weekly Timer / Astronomical Clock outputs behave as expected.

LWE V1.1.1 Changes and Improvements

LWE V1.1.1 introduced several improvements relevant to this article:

  • Default input widget type for time fields changed from analog value to a context-sensitive suggestion. When the bound VM address is associated with a Weekly Timer, LWE now defaults to Scale Time.
  • Float widgets gained a 4-byte-series indicator in the property pane, making the byte order explicit to the user.
  • Validation tightened for time fields: hours outside 0..23 or minutes outside 0..59 produce a visible warning instead of silently writing a corrupt byte.
  • Float widgets validate that all four VM bytes are reserved consecutively; if any byte is already in use, LWE emits a configuration error at compile time.
  • Password handling tightened to require non-trivial passwords by default, mitigating the historical weakness where trivial passwords were accepted without warning.

If you are migrating a project authored in LWE prior to V1.1.1, manually verify that every Weekly Timer and Astronomical Clock input uses the correct type. Earlier versions saved the binding as analog value by default, which does not survive an upgrade cleanly.

Verification Procedure

After applying values from the custom web page, perform the following checks:

  1. Visual confirmation in LOGO!Soft Comfort online mode: Right-click the Weekly Timer block and confirm that ON-time and OFF-time display the values entered. If they show a nonsensical number (e.g., 1605 instead of 06:45), the wrong type is selected.
  2. VM readback via web page refresh: Reload the custom web page. The values entered should round-trip correctly. A mismatch indicates the wrong encoding.
  3. Functional test for Weekly Timer: Set ON-time to a value two minutes in the future and OFF-time to a value three minutes in the future. Verify the corresponding Q output transitions high at the expected minute boundary.
  4. Functional test for Astronomical Clock: Cross-check sunrise/sunset against a published almanac (such as timeanddate.com) for the entered coordinates. Deviations beyond ±2 minutes suggest an encoding error in longitude or latitude.
  5. Time zone sanity: Compare the LOGO!'s UTC offset against the system clock. A difference of N hours should match the configured time zone parameter.
  6. VM mapping inspection: In LOGO!Soft Comfort, open Tools → Parameter VM Mapping and confirm that the addresses bound in LWE correspond exactly to the Weekly Timer and Astronomical Clock block parameters. Mismatched addresses silently produce no error — the value simply never reaches the block.

Troubleshooting Matrix

Symptom Likely Cause Corrective Action
Timer fires 60× later than expected Time field typed as Analog Value instead of Scale Time Change widget type to Scale Time
Timer never fires Hours byte receives only low nibble; minutes byte overwritten by next widget Reserve both bytes explicitly; do not bind two widgets to overlapping addresses
Sunrise/sunset times wildly wrong Longitude/Latitude typed as 16-bit Analog Value instead of 4-byte Float Change widget type to Float (32-bit, 4-byte series)
Coordinate appears as integer 0 Float bytes bound in reverse order (big-endian instead of little-endian) Confirm LWE is configured for little-endian byte order (LOGO! default)
Web page displays but Apply button does nothing Wrong password or session token expired Re-authenticate; confirm LWE password matches the value configured in project
Web page not found (404) SD card /logo directory not loaded or card not inserted at boot Power-cycle LOGO! with SD card inserted; verify directory structure on card
All VM widgets show stale data AJAX endpoint blocked by network or browser Disable browser extensions; verify direct access to /logo/ajax endpoint
Time entered as 24:00 silently rejected Hours field accepts invalid BCD value in older LWE Upgrade to LWE V1.1.1; rely on validation warning
Negative longitude rejected Float widget min bound to 0 Set Float widget min to -180.0 and max to +180.0
Weekly Timer values shown but Q never activates VM address bound to wrong function block parameter Cross-check Tools → Parameter VM Mapping; rebind to correct offset
Astronomical Clock fires once then stops Float bytes overlapped with another widget that overwrites them at scan cycle Move float widget to free VM range; re-verify all bindings

Field-Proven Caveats and Best Practices

Address collisions: When binding float widgets, LWE reserves the next three consecutive VM bytes automatically. If any of those bytes are already bound to another widget (digital input, status indicator, etc.), the second widget silently fails. Always consult Tools → Parameter VM Mapping in LOGO!Soft Comfort to confirm the float bytes are free.

Endianness: LOGO! 8 stores multi-byte values in little-endian byte order. LWE V1.1.1 honors this convention for float encoding. If you ever author a custom HTML page by hand (without LWE), reverse the byte order manually for any 32-bit value or the LOGO! will read it as the wrong magnitude.

SD card lifecycle: The /logo directory on the SD card is read at boot. Editing the project in LWE and saving does not automatically update the SD card — the files must be re-copied and the LOGO! power-cycled. The web page shown at runtime reflects the SD card contents, not the LWE source.

Time source: Both Weekly Timer and Astronomical Clock depend on the LOGO!'s internal real-time clock. If the LOGO! has no RTC backup (battery not installed or dead), times drift and astronomical calculations drift with them. Consider a LOGO! CMR (communications module, 6GK7142-...) with NTP for time synchronization, as demonstrated in the time-controlled lighting application example.

Password hygiene: For production deployments, choose a strong password for the custom web page and rotate it whenever personnel changes. Custom web pages can expose write access to live parameters — a weak password is a vector for unintended parameter changes.

Browser compatibility: LWE-generated pages rely on XMLHttpRequest for AJAX polling. Modern browsers support this natively; older browsers or restrictive corporate proxies may strip the calls. Test the page in the browser that operators will use, not just the engineer's development browser.

Float precision: IEEE 754 single-precision float offers roughly 7 significant decimal digits. Astronomical coordinates with more than 4 decimal places may round-trip with slight error. For most sunrise/sunset applications this is irrelevant (seconds of arc). For solar tracking or sundial applications, consider upgrading to a controller with double-precision floats.

Multiple Weekly Timers in one project: When the LOGO! program contains several Weekly Timer blocks (B001, B002, B003, ...), each occupies its own VM offset pair. Mistakenly binding one LWE widget pair to two blocks' offsets produces values that overwrite each other at every cycle. Maintain a VM map table in your project documentation and cross-reference it before every LWE revision.

Daylight Saving Time: The Astronomical Clock block uses the fixed time zone offset parameter; it does not auto-adjust for DST. Operators must update the time zone parameter twice per year if the LOGO! is not paired with an NTP source that already accounts for DST.

Frequently Asked Questions

Why does the Weekly Timer fire at the wrong minute after I enter the time on the custom web page?

The input widget is almost certainly typed as Analog Value rather than Scale Time. Open LWE, select each Weekly Timer time field, and change its type to Scale Time. The LOGO! expects BCD-encoded hours and minutes; an analog-value widget writes a raw 16-bit integer that the timer block rejects or misinterprets.

How do I enter longitude and latitude so that the Astronomical Clock block computes the correct sunrise/sunset?

Bind a single Float (32-bit, 4-byte series) widget to the first byte of each coordinate. LWE V1.1.1 reserves the next three bytes automatically. Confirm the float widget's min/max are set to -180.0/+180.0 for longitude and -90.0/+90.0 for latitude. Do not use Analog Value, Digital Value, or two-byte-per-coordinate widgets.

What does four bytes in series mean for longitude and latitude?

It means the IEEE 754 single-precision float representation of the coordinate is stored as four consecutive VM bytes in little-endian order. LWE exposes the float as a single widget binding rather than as four independent widgets. If you manually craft the HTML, write the bytes in little-endian order to the four reserved VM addresses.

Which LWE version introduced the Scale Time input type for Weekly Timer parameters?

LWE V1.1.1 made Scale Time the default for time-field bindings and added explicit 4-byte-series indicators for float fields. Earlier versions defaulted to Analog Value and required manual configuration. Upgrade to V1.1.1 or later and re-check every time widget in existing projects.

My custom web page loads but Apply does nothing. What should I check first?

Verify (1) the password matches the value configured in the LWE project, (2) the LOGO! Base Module firmware is FS:04 or later, (3) the SD card /logo directory was copied and the module was power-cycled after the copy, and (4) the browser can reach the /logo/ajax endpoint directly. Authentication failures and stale SD card contents are the two most common causes.

Back to blog