# Function Block Diagram Timers and Counters for Siemens PLCs 310

This class explains how function block diagram programming is used to program timers and counters. It examines the basic rules for each type of timer and counter used in FBD programming for S7-1200 PLCs.

details Other tabs

## Class Details

Class Name:
Function Block Diagram Timers and Counters for Siemens PLCs 310
Description:
This class explains how function block diagram programming is used to program timers and counters. It examines the basic rules for each type of timer and counter used in FBD programming for S7-1200 PLCs.
Version:
1.0
Difficulty:
Number of Lessons:
16
Spanish

## Class Outline

• Objectives
• Siemens PLC Timers and Counters
• SIMATIC and IEC Timers and Counters
• IEC Timers
• TP Timer Instruction
• TON Timer Instruction
• TOF Timer Instruction
• TONR Timer, PT, and RT Instructions
• IEC Counters
• CTU Counter Instruction
• CTD Counter Instruction
• CTUD Counter Instruction
• TP Timer and CTU Counter Example
• TON Timer and CTD Counter Example
• CTUD Counter Example
• Summary

## Objectives

• Describe timer and counter PLC instructions.
• Describe the timer instructions used by S7-1200 PLCs for FBD programs.
• Explain how TP timer instructions function.
• Explain how TON timer instructions function.
• Explain how TOF timer instructions function.
• Explain how TONR, PT, and RT timer instructions function.
• Describe the counter instructions used by S7-1200 PLCs for FBD programs.
• Explain how CTU counter instructions function.
• Explain how CTD counter instructions function.
• Explain how CTUD counter instructions function.
• Describe the operation of an FBD programming network.

## Glossary

Vocabulary Term Definition
counters Instructions that allow PLCs to keep track of actions or events, such as the number of items placed in a container or the number of times a motor or machine has turned on, and to respond when a specific count is reached.
CTD counter Count down counter. An IEC counter instruction that counts down by 1 when the count down parameter (CD) transitions from 0 to 1.
CTU counter Count up counter. An IEC counter instruction that counts up by 1 when the count up parameter (CU) transitions from 0 to 1.
CTUD counter Count up and down counter. An IEC counter instruction that counts up by one on a 0 to 1 transition of CU and counts down by 1 on a 0 to 1 transition of CD.
data block DB. A memory structure used in Siemens PLC user programs to store data for a code block. All of the program blocks in the user program can access the data in a global DB, but an instance DB stores data for a specific function block (FB).
data type A definition that specifies both the bit size of a data element as well as how the bit string is to be interpreted.
DB Data block. A memory structure used in Siemens PLC user programs to store data for a code block. All of the program blocks in the user program can access the data in a global DB, but an instance DB stores data for a specific function block (FB).
decrements Counts down or decreases.
FBD Function block diagram. A graphical programming language defined in part 3 of the IEC 61131 standard.
function block diagram FBD. A graphical programming language defined in part 3 of the IEC 61131 standard.
IEC 61131 A standard of the International Electrotechnical Commission that defines programmable logic controller capabilities. Part 3 of this standard (IEC 61131-3) defines PLC programming languages.
IEC counters PLC counter instructions that conform to the descriptions provided in IEC 61131.
IEC timers PLC timer instructions that conform to the descriptions provided in IEC 61131.
Int Signed integer. A 16-bit (1 word) data type that can represent an equivalent decimal range from -32,768 to +32,767.
LTime data type A 64-bit data type available for use in SIMATIC S7-1500 PLCs. This data type is used with IEC timers for preset time (PT) and elapsed time (ET) values when these values exceed the range of the Time data type.
OB Organization block. A program structure that links the user program to the PLC operating system. A variety of OBs are used in Siemens PLC programs. Some OBs have predefined behaviors and start events, but also can be created with custom start events.
OR function A PLC instruction that provides a 1 at the output of the instruction if one or more of the inputs to the instruction is a 1.
organization block OB. A program structure that links the user program to the PLC operating system. A variety of OBs are used in Siemens PLC programs. Some OBs have predefined behaviors and start events, but also can be created with custom start events.
PT instruction Preset timer instruction. An IEC timer instruction that loads a preset time value to the specified timer.
RT instruction Reset timer instruction. An IEC timer instruction that resets the specified timer.
set reset flip-flop SR flip-flop. A PLC instruction that sets the output parameter Q to 1 when the set input transitions from 0 to 1 and resets Q to 0 when the reset input transitions from 0 to 1. The reset input is dominant over the set input, so, if both inputs are 1 at the same time, Q is 0.
signed double integer Dint. A 32-bit (1 double word) data type that can represent an equivalent decimal range from -2,147, 483, 648 to +2,147, 483, 647.
signed integer Int. A 16-bit (1 word) data type that can represent an equivalent decimal range from -32,768 to +32,767.
SIMATIC counter PLC counter instruction developed for use in Siemens SIMATIC PLCs prior to the development of the IEC 61131 standard. These instructions are still widely used.
SIMATIC timer PLC timer instruction developed for use in Siemens SIMATIC PLCs prior to the development of the IEC 61131 standard. These instructions are still widely used.
Time data type A 32-bit data type used by IEC timers for preset time (PT) and elapsed time (ET) values. Time data is stored as a signed double integer interpreted as milliseconds.
timers Instructions that allow PLCs to control and monitor time-dependent aspects of machines and processes.
TOF timer Off-delay timer. An IEC timer instruction that sets the output parameter (Q) to on and then resets the output to off after a preset time delay.
TON timer On-delay timer. An IEC timer instruction that sets the output parameter (Q) to on after a preset time delay.
TONR timer On-delay retentive timer. An IEC timer instruction that sets the output parameter (Q) to on after a preset time delay. The elapsed time can be accumulated over multiple timing periods. The reset parameter (R) is used to reset the elapsed time.
TP timer Pulse timer. An IEC timer instruction that generates a pulse with a preset time width.
UInt Unsigned integer. A 16-bit (1 word) data type that can represent an equivalent decimal range from 0 to 65,535.
unsigned integer UInt. A 16-bit (1 word) data type that can represent an equivalent decimal range from 0 to 65,535.
unsigned short integer USInt. An 8-bit (1 byte) data type that can represent an equivalent decimal range from 0 to 255.
USInt Unsigned short integer. An 8-bit (1 byte) data type that can represent an equivalent decimal range from 0 to 255.