Inst ToolsInst ToolsInst Tools
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Search
  • Books
  • Software
  • Projects
  • Process
  • Tools
  • Basics
  • Formula
  • Power Plant
  • Root Cause Analysis
  • Electrical Basics
  • Animation
  • Standards
  • 4-20 mA Course
  • Siemens PLC Course
Reading: Using Clock Memory Bits in TIA Portal – Siemens PLC
Share
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • Design
  • PLC
  • Interview
  • Control System
Search
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
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 !

Continue Reading

PLC Pneumatic Circuit Control
PLC Power Supply and Operating Voltages
Why Baud Rate is Important in Modbus Network?
Analog Measurement using Ladder Logic
Difference Between Microcontroller and PLC
Five Types of PLC Programming languages
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
210kSubscribersSubscribe
38kFollowersFollow

Categories

Explore More

Importance of Grounding Electronic Equipment
Classroom Bell System – PLC Programming Practice Examples
How to Choose a Suitable HMI for Your Application?
Schneider PLC Example Program for Star-Delta System
What is Resources Tab in the Siemens PLC?
Difference between Power Cables and Signal Cables
Configuration of InTouch Scada Trends
Boolean Logic to PLC Programming

Keep Learning

PLC Ladder Logic Chemical Mixing Process

Chemical Mixing Process using PLC

How to Prevent Ground Loops in Analog Circuits?

How to Prevent Ground Loops in Analog Circuits?

Flip-Flop PLC Program for Lamps Application

Example of Flip-Flop PLC Program for Lamps Application

In this article, we will learn the difference between Machine Expert Basic and Machine Expert software in Schneider PLC.

Difference between Machine Expert Basic and Machine Expert – Schneider PLC

Star-Delta PLC programming with 1 button

How to Program a Star-Delta System using 1 Button in PLC?

Conveyor Sorting Omron PLC Programming

CX-Programmer Products Sorting & Counting – Omron PLC

Coil Type Timers in Siemens PLC Programming

Coil Type Timers in Siemens PLC Programming

Pumping System in Industrial Automation

Basic Pumping System Application Used in Industrial Automation

Learn More

pH Analyzers Questions and Answers

Secondary Reference Electrodes Questions & Answers

PLC Program for Alarm Indication in Process

PLC Program for Alarm Indication in Process Control

Enterprise Resource Planning in Industrial Automation

What is ERP in Industrial Automation? – Enterprise Resource Planning

OPC in PLC Systems

OPC in Old PLC Systems

Opposite Acting Valves

What is Split Range Control Loop ?

Electromagnetic Fields Objective Questions

Electromagnetic Field Theory Questions and Answers

What is Gas Chromatography

What is Gas Chromatography?

Core-Type Transformer

Transformer Theory of Operation

Menu

  • About
  • Privacy Policy
  • Copyright

Quick Links

  • Learn PLC
  • Helping Hand
  • Part Time Job

YouTube Subscribe

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?