PLC

How to use Siemens TIA Portal to create Different Counter blocks in PLC?

In this article, we are going to see different types of counters used in the Siemens TIA Portal. The following Image shows the usage of counters in the industry process.

The Siemens TIA Portal Timers are:

  1. CTU – UP Counter 
  2. CTD – Down Counter 
  3. CTUD – Up Down Counter

Graphical representation of different Counter used in Siemens TIA Portal

How to use Siemens TIA Portal to create Different Counter blocks in PLC? 1

Different Counter blocks usage in PLC Ladder Logic

CTU – UP COUNTERĀ 

How to use Siemens TIA Portal to create Different Counter blocks in PLC? 2

CTD – DOWN COUNTER

How to use Siemens TIA Portal to create Different Counter blocks in PLC? 3

CTUD UP DOWN COUNTER

How to use Siemens TIA Portal to create Different Counter blocks in PLC? 4

Declaration of Input and Output of different Counter PLC blocks

Declaration of Input, Output, and Other blocks of CTU UP COUNTER PLC block

S. NoOperationInput/Output/OthersAddress of Each Block
1Input Switch_01Input%M0.0
2Input Switch for Counter block (Load Associated Coil)Input%Q0.0
3Count UP BlockUP Counter%DB1
4Output Load for Input SwitchOutput%Q0.0
5Output Load of Counter BlockOutput%Q0.1

Declaration of Input, Output, and Other blocks of CTD DOWN COUNTER PLC block

S. NoOperationInput/Output/OthersAddress of Each Block
1Input Switch_02Input%M0.0
2Input Switch for Counter block (Load Associated Coil)Input%Q0.2
Input Switch for down CounterInput%M0.5
Input for Down CounterOutput%Q1.0
3Count DOWN BlockDOWN Counter%DB2
4Output Load for Input SwitchOutput%Q0.2
5Output Load of Counter BlockOutput%Q0.3

Declaration of Input, Output and Other blocks of CTUD UP DOWN COUNTER PLC block

S. NoOperationInput/Output/OthersAddress of Each Block
1Input Switch for Up CountInput%M0.2
2Input Switch for Down CountInput%M0.3
3Down Counter Output Load SwitchInput%M0.4
4Input Switch for UP Counter (Load Associated Coil)Input%Q0.4
5Input Switch for DOWN Counter (Load Associated Coil)Input%Q0.5
6Output for the UP CounterUP Counter Output%Q0.6
7Output for the DOWN CounterDOWN Counter Output%Q0.7
8Output Load for UP Counter Input SwitchOutput%Q0.4
9Output Load for DOWN Counter Input SwitchOutput%Q0.5
10Count DOWN BlockDOWN Counter%DB3

Different Phases of PLC Ladder Logic of Counter Block Operation

The PLC program is created using Siemens’ TIA Portal V16 software. According to the above statement, Different PLC Counter Blocks are explained in the following Sections.

CTU ā€“ UP COUNTER

  1. The UP counter will be ā€œTurned ONā€ when the required number of counters is reached. This will happen when the input switch of the UP counter i.e.,CU ON and OFF for the required number of times.
  2. Once the input switch %M0.0 is Turned ON. The output %Q0.0 will be ON; this helps the input switch %Q0.0 of the counter %DB1 ON.
  3. The number of times the counter input switches ON that much of time the counter will increase the count.
  4. Once the required counter value is reached by the counter %DB1. The counter %DB1 set and will switch ON the output load %Q0.1.

CTD – DOWN COUNTER

  1. The DOWN counter will be ā€œTurned ONā€ when the counter reaches to Zero value from the initial set value. This will happen when the input switch of the DOWN counter i.e., CD ON and OFF for the required number of times.
  2. The LD of Down counter %DB1is Reset the CTD counter to the required value set in the Preset Value (PV) and Turns OFF the output load %Q0.3
  3. Once the input switch %M0.1 is Turned ON. The output %Q0.2 will be ON; this helps the input switch %Q0.2 of the counter %DB2 ON.
  4. The number of times the counter input switches ON that much of time the counter will decrease the count.
  5. Once the counter %DB2 reaches zero the counter. The counter %DB2 set and will switch ON the output load %Q0.3.

CTUD ā€“ UP DOWN COUNTER

  1. The UP-DOWN Counter will be ā€œTurned ONā€ in two states. The output QD, or down counter output, will be ON if the counter value is zero. The Down Counter also turns OFF if the Counter value is greater than zero. The Up Counter will start counting. Once the Up counter reaches the required value the QU Tuned ON.
  2. Before the input switch %M0.2 Turned ON. The UP-DOWN Counter %DB3 counter value is zero. Therefore, the Down Counter output i.e., QD is enabled. This QD Turns ON the input switch %M0.4.
  3. Now, %M0.2 will be Switched ON. This will be Turned ON the %Q0.4.
  4. The %M0.2 will be Turned ON and OFF continuously until it reaches the counter value. Once the Counter value is reached. The Up Counter %Q0.6 output Turned ON.
  5. Similarly, %M0.2 Turned ON and OFF continuously, the %DB3 counter start decremented from the current value. Once it reaches Zero, the %Q0.6 output Turns ON. The process is continuous.

Note: Please see the above page for a thorough description of how to program ladder logic using the Siemens TIA Portal.

Simulation screenshots of different type of Counter blocks

CTU – UP COUNTER

  • The simulation result shows the operation of the UP Counter. 
  • The %M0.0 is the Main switch to Turn ON the input switch %Q0.0 connected to the Counter %DB1.
  • The below diagram shows the Main switch %M0.0 is Turned ON, due to this the Load switch %Q0.0 is Turned ON, which helps the input switch %Q0.0 connect to the counter Turn ON the counter Value.
How to use Siemens TIA Portal to create Different Counter blocks in PLC? 5
  • The Main Switch %M0.0 Turns ON and OFF up to the Preset Value (say PV= 5 in this article). Once the Counter %DB1 reaches the Present Value the Counter output %Q0.1 Turns ON.
How to use Siemens TIA Portal to create Different Counter blocks in PLC? 6

CTD – DOWN COUNTER

The simulation shown below is the Operation of the Down Counter.

Here the Main Switch %M0.1 is used to Turn ON the input switch %Q0.2 connected to the Counter %DB2.

Once the simulation starts the output %Q0.3 will be in ON Stage. This is because if the CTD counter is Zero. The output %Q0.3 connected to the Down counter CTD %DB2 will be ON.

How to use Siemens TIA Portal to create Different Counter blocks in PLC? 7

The output %Q0.3 connected to the Down counter CTD %DB2 will be OFF, only if the CTD %DB2 reaches the Preset Value. This is achieved by Turn ON the Input Switch %M0.5. This input Switches by Turning on the input switch %Q0.2 connected to the counter indirectly through the load Switch %Q0.2.

How to use Siemens TIA Portal to create Different Counter blocks in PLC? 8

Once again, the CTD %DB2 Turns ON the output%Q0.3 connected to the counter by turning On the %M0.1 number of times until it reaches Zero.Ā 

How to use Siemens TIA Portal to create Different Counter blocks in PLC? 9

CTUD ā€“ UP DOWN COUNTER

  1. The below simulation results show the UP-DOWN Counter Operation.
  2. The UP Down Counter operation is a combination of the above two Counter.
  3. The UP-DOWN counter %DB3 contains CU, CD, R, LD & PV Inputs.
  4. The simulation result has two operations i.e., when the counter reaches zero and when the counter reaches the required value. The first one is Count Down and the latter is Count Up
  5. Here %M0.2 is used for the Count UP operation and %M0.3 is used for the Count DOWN Operation (through the corresponding load Switch).
  6. The %Q0.4 and %Q0.5 are used as Count Up and Count Down input switches respectively.
  7. When the %Q0.4 is turned through the %M0.2 to the required operation the load Turned ON.
  8. Similarly, When the %Q0.5 is turned through the %M0.3 until it reaches zero the output load %Q0.6Turns OFF.
  9. At the same time the Down Counter Load %Q0.7 Turns ON due to Preset Value.
How to use Siemens TIA Portal to create Different Counter blocks in PLC? 10

How to use Siemens TIA Portal to create Different Counter blocks in PLC? 11

By doing the above exercise the reader can understand different types of counter logics used in a PLC Ladder Logic.

Sundareswaran Iyalunaidu

With over 24 years of dedicated experience, I am a seasoned professional specializing in the commissioning, maintenance, and installation of Electrical, Instrumentation and Control systems. My expertise extends across a spectrum of industries, including Power stations, Oil and Gas, Aluminium, Utilities, Steel and Continuous process industries. Tweet me @sundareshinfohe

Related Articles

Back to top button