Kkula
Browse Questions » LOGO! - Projects: chronometer

About User

Questions Asked: 24.4K

Answers Given: 0

0
  • Open

LOGO! - Projects: chronometer

I would like to know if there are anything example of chronometer, for Logo.
I need counter time in seconds, minuts and hors that one entered isin off.
I had to create with counters and asynchronous pulse generator , in simulation that is functioned normally, but not in logo. -

0 Likes 0 Favourites 0 Followers 0 Comments
Answers(1)
Logo! Chronometer Example

Logo! Chronometer Implementation

You're right to observe differences between simulation and real hardware with Logo!. Asynchronous pulse generators and counters can behave unexpectedly due to scan cycle times. Here are some approaches and considerations:

Challenges & Solutions

The primary issue is that the Logo! scan cycle isn't deterministic. A 1ms pulse in simulation might be missed on the hardware if the Logo! is busy with other tasks.

Example Approach (using Network Variables & Flag)

A more robust method involves using a network variable to trigger the counter and a flag to enable/disable it. This minimizes reliance on precise timing within a single scan cycle.

  1. Network Variable: Use a network variable (e.g., NW1) as a "Start/Stop" signal. This variable is controlled by an external push button or other trigger.
  2. Flag (Memory Bit): Use a memory bit (e.g., M1) to actively enable the counter.
  3. Counter: Configure a counter (e.g., C1) to count up on a rising edge.
  4. Logic:
    • When NW1 changes from OFF to ON (rising edge): Set M1 ON.
    • When NW1 changes from ON to OFF (falling edge): Set M1 OFF, and Reset C1.
    • Configure C1 to increment on the rising edge of a fast pulse generator (e.g., 1ms) *only when M1 is ON*.
  5. Time Display: Use separate counters and calculations (division, modulo) to display seconds, minutes, and hours based on the value of C1.

Resources

Refer to these Siemens resources for more detailed guidance:

Important: Carefully consider scan cycle times and potential missed pulses when designing timing-critical applications in Logo!. The network variable/flag approach is generally more reliable.

0
Add a comment