Inst ToolsInst ToolsInst Tools
  • Ask
  • Courses
  • Videos
  • Q & A
    • Interview
      • Instrumentation
      • Electronics
      • Electrical
      • Practical Questions
    • MCQ
      • Instrumentation MCQ
      • Electrical MCQ
      • Electronics MCQ
      • Control Systems MCQ
      • Analog Electronics MCQ
      • Digital Electronics MCQ
      • Power Electronics MCQ
      • Microprocessor MCQ
      • Multiple Choice Questions
  • EE
    • Electronics
      • Electronics Q & A
      • Electronic Basics
      • Electronic Devices & Circuits
      • Electronics Animation
      • Digital Electronics
    • Electrical
      • Electrical Basics
      • Electrical Q & A
      • Power Electronics
      • Electrical Machines
      • Electrical Animation
      • Power Systems
      • Switchgear & Protection
      • Transmission & Distribution
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Search
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Reading: Using Clock Memory Bits in TIA Portal – Siemens PLC
Share
Notification Show More
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • PLC Tutorials
  • Control Systems
Search
  • Ask
  • Courses
  • Videos
  • Q & A
    • Interview
    • MCQ
  • EE
    • Electronics
    • Electrical
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Inst Tools > Blog > PLC Tutorials > Using Clock Memory Bits in TIA Portal – Siemens PLC

Using Clock Memory Bits in TIA Portal – Siemens PLC

We will talk about clock memory bits in TIA Portal and Siemens PLC and we will help you to avoid coding a lot of logic lines.

Last updated: June 8, 2023 10:54 am
Mahmoud Salama
PLC Tutorials
No Comments
Share
9 Min Read
SHARE

In this article, we will take about clock memory bits in TIA Portal and Siemens PLC. And we will show how to enable the use of the memory bits and how it can help you avoid coding a lot of logic lines to obtain a simple function that your PLC already do it internally.

Contents
What are Clock Memory Bits?The Need for Clock Memory BitsEnable Clock Memory in Siemens PLCTia Portal Conveyor Belt Example ProgramProcess Description Project IOsProgram CodeProgram SimulationConclusion

Contents:

  • What are clock memory bits?
  • The need for clock memory bits.
  • Enable clock memory in my project.
  • Simple program example.
  • Program simulation.
  • Conclusion.

What are Clock Memory Bits?

A clock memory is a bit memory that changes its binary status periodically in the ratio of 1:1. That simply means it changes its status periodically between true and false with a pre-defined frequency.

There are 8 clock memory bits pre-defined in the CPU which is why they are also called clock memory byte.

You decide which memory byte of the CPU will become the clock memory byte when you enable the use of the memory byte and assign the clock memory parameters.

The Need for Clock Memory Bits

You don’t necessarily need the clock memory as you can create your own logic and achieve the same functionality. However, it is a good thing to have in your pocket when you need such functionality. As creating 8 separate logic for 8 clock memory bits will take some of your time and effort and might make your program unnecessarily large.

You can use clock memory, for example, to activate flashing indicator lamps or to initiate periodically recurring operations such as recording actual values.

Each bit of the clock bit memory byte is assigned a frequency. See the following table.

Bit of the clock memory byte76543210
Period (s)2.01.61.00.80.50.40.20.1
Frequency (Hz)0.50.62511.2522.5510

Table 1. Clock memory bits frequencies according to the TIA Portal help manual.

Enable Clock Memory in Siemens PLC

To use the clock memory bits in your logic, you need to enable the use of the clock memory byte from the properties of the CPU. See picture 1.

Enable the use of clock memory byte in Tia Portal
Picture 1 – Enable the use of clock memory byte

You can choose the address of the byte you want to assign for the clock memory, just make sure it doesn’t conflict with any other memory bytes in your PLC logic.

As you see from the picture, we chose the address 0, so if you need to use the 2Hz clock bit you will use the bit %M0.3

Tia Portal Conveyor Belt Example Program

In a previous article, we used a simple example of a conveyor belt moving a product between the start and end of the belt. There was an indication LED that turns ON when the Belt is running. See picture 2.

conveyor belt system
Picture 2 – Simple conveyor belt system

We will use the same example, but this time we will make the LED more intuitive using the clock memory bits. This time we will use the clock memory bits with the LED to give an indication of different cases of the process.

Process Description

In a conveyor belt system controlled by a PLC, there are two presence sensors at the two ends of the belt to detect the presence of a product, when the product is detected at the start of the belt, the conveyor can be started through a start Pushbutton and when the product reaches the end the belt will stop automatically and it will not run again until a new product is detected once again at the start and the START push button is pressed.

The indication LED should have more than one behavior depending on the current case of the system.

These cases are as follows:

  1. If there is a product at the start of the belt but START is not pressed yet, the LED should be flashing by a frequency of 0.5Hz.
  2. If the conveyor is moving the product the LED should be flashing by a 2Hz frequency.
  3. When the product reaches the end of the belt the LED should be ON
  4. When the product is removed from the end the LED will go OFF.

 Project IOs

We have 4 digital inputs as follows:

  • START: start push button to run the Conveyor.
  • STOP: stop push button to stop the conveyor at any moment.
  • P1: Presence sensor at the start of the belt.
  • P2: Presence sensor at the end of the belt.

We also have 2 digital outputs as follows:

  • MOTOR: when activated the Conveyor belt will start running.
  • LED: will be activated according to the sequence mentioned before.

Program Code

First, we select our PLC and assign the IO tags. See picture 3

Tia Portal Conveyor Belt Example Program
Picture 3 – Assign inputs and outputs tags

Don’t forget to enable the use of the clock memory byte as shown in picture 1.

We will have two networks of code, one for the control of the conveyor belt and another for the LED logic. See pictures 4 and 5 for the logic.

PLC control logic of the conveyor belt
Picture 4 – The control logic of the conveyor belt
Using Clock Memory Bits in TIA Portal - Siemens PLC
Picture 5 – The control logic of the LED

As you can see, using the clock memory bits made the logic simple and easy to read. Imagine if you would create the same logic without the use of these bits, you would have used a lot of timers and your logic would have been fairly complicated.

Program Simulation

We explained before how to use the PLCSim to simulate our code. In this example, we will use the simulation sequence to create the same sequence of the actual process and we will see if the LED behavior will match the intended functionality or not.

Start by compiling our code and start a new simulation. See picture 6.

Tia Program simulation
Picture 6 – Program simulation

As you can see, the LED is now OFF; there are no products presences at the start or the end of the conveyor.

We created a simulation sequence and see how the LED will react to different process conditions. See the following animation.

Clock Memory Bits in PLC

See if you can notice how the LED behavior changes with different process conditions.

Conclusion

  • Clock memory bits turn on and off with a pre-defined frequency.
  •  They are very useful when you need to activate flashing indicator lamps or to initiate periodically recurring operations.
  • Using clock memory bits will save you the time and effort consumed to obtain the same functionality through your own logic.

If you liked this article, then please subscribe to our YouTube Channel for Instrumentation, Electrical, PLC, and SCADA video tutorials.

You can also follow us on Facebook and Twitter to receive daily updates.

Read Next:

  • Overview of SIEMENS PLC
  • HMI and VFD Control System
  • Sequential PLC Pneumatic Valves
  • HMI Screen Design for Hazardous
  • S7-1200 Hardware Configuration
Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
You've successfully subscribed !
Intrinsically Safe Barriers Questions and Answers
Configuration of Input and Output Tags in Siemens Scada and PLC
Shutdown Motors in Timed Operation PLC Program
What is Masking in PLC?
Making Multi Way Switches using PLC
Share This Article
Facebook Whatsapp Whatsapp LinkedIn Copy Link
Share
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

128.3kFollowersLike
69.1kFollowersFollow
208kSubscribersSubscribe
38kFollowersFollow

Categories

Recent Comments

  • Guifty Shimica on Top Non-PLC Certification Courses for Automation Professionals
  • Guifty Shimica on Top Non-PLC Certification Courses for Automation Professionals
  • MIHARITSOA Aina Sitraka on Top Non-PLC Certification Courses for Automation Professionals
  • Vaishnavi on Free Instrumentation Course for Trainee Engineers

Related Articles

Electrical Ladder Diagram Control using Timers Example

Electrical Ladder Diagram Control using Timers Example

Start the Counting from a Preset Value in PLC

Start the Counting from a Preset Value in PLC

Emergency Stop Push button

Emergency Stop Switch Spurious Trip

memory types in siemens plc

#13 PLC Best Practices – Disable Unused Communication Ports

Retentive Timer (RTO)

Timer in Studio 5000 – TON, TOF, RTO

Electrical Ground Loop

How to Solve Electrical Ground Loop Problems?

PLC Programming for Weight-Based Packaging

PLC Programming for Weight-Based Packaging

How a PLC communicates with Transmitters

How PLC Reads the Data from Field Transmitters

More Articles

Electrical Machines Questions and Answers

Transformer as a Magnetically Coupled Circuit

Fieldbus Analog Input Function Block

What is Optical Coating

What is Optical Coating?

memory types in siemens plc

#13 PLC Best Practices – Disable Unused Communication Ports

Feedback control loop - 2

Feedback Control Principle

Process Control Terms

143 Process Control Terms and Glossary – Questions Answers

HVAC System Heat Transfer Loops

Heat Transfer Loops in HVAC System

Difference Between HV and LV Cables

Difference Between HV and LV Cables

Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?