Siemens PLC Interview Question

Q & A: TIA Portal V17

Qn What is the Siemens S7-1200 PLC?

the Siemens S7-1200 is a small- to medium-sized automation task-specific programmable logic controller (PLC). It has multiple connectivity methods, a modular design, and an easy-to-use interface.

Qn Types of Modules in Siemens S7-1200 PLC

Digital Modules:

  • Digital modules handle on/off states.

  • Examples: digital input (DI) and digital output (DO) modules.

  • DI modules receive signals from sensors, switches, or buttons.

  • DO modules control actuators like solenoids, relays, or motors.

Analog Modules:

  • Analog modules deal with continuous signals (e.g., voltage, current, temperature).

  • Analog input (AI) modules convert physical quantities into digital values.

  • Analog output (AO) modules generate analog signals based on digital inputs.

Special Modules:

  • These modules serve specific functions beyond standard I/O.

  • Examples:

    • High-Speed Counter Modules: For precise counting of fast events.

    • Pulse Width Modulation (PWM) Modules: Used for controlling motor speed.

    • Temperature Measurement Modules: For thermocouples or resistance temperature detectors (RTDs).

Communication Processors:

  • Communication processors enable communication between the PLC and external devices.

  • They support protocols like PROFINET, Modbus, or Ethernet/IP.

  • Communication processors facilitate data exchange with other PLCs, HMIs, or SCADA systems.

Fail-Safe I/O Modules:

  • Fail-safe modules ensure safe operation in critical applications.

  • They comply with safety standards (e.g., SIL 3, PL e).

  • Fail-safe DI and DO modules provide redundancy and fault tolerance.

Qn. Types of Memory in Siemens PLC S7-1200 ?

Load memory:
Internal load memory, which includes the PLC software itself, holds any data that is downloaded to the PLC from the PC.

Working memory is used for temporary storage while programs are being executed. External load memory is additional memory modules that can be attached externally to increase the PLC's memory capacity
holds data that is used by the application, such as timers, counters, and variables.


  1. System Memory: Holds status flags and data pertaining to the system.
    include system components such as "Diagnostic status changed," "First cycle," and others.

    Retentive Memory: Preserves information even following power outages.
    used to store important data, including configuration settings, counter values, and process values

Qn Difference between Response time and PLC scan time differ in the following ways:

PLC Scan Time: Definition: The amount of time the PLC needs to finish a single scan cycle is known as the PLC scan time.

Cycle Parts:
Input Scan: Every input, whether digital and analog, is read by the PLC.
Program Execution: The logic program, which includes function blocks and ladder logic, is processed by the PLC.
Output Update: Depending on how the program is running, the PLC modifies the state of each and every output.

Response Time: Definition: The amount of time it takes for the system, which includes the PLC, to respond to a change in inputs and generate the appropriate outputs is referred to as response time.
Parts:
A portion of the total reaction time is the PLC scan time.
Communication Delays: Contains communication between the PLC and devices (such as actuators and sensors).
Processing Time: The amount of time the PLC needs to run the logic of the program.
Time Needed to Update the Output Devices: The output update time.


Qn. What data types are used in Siemens TIA Portal software?

In Siemens TIA Portal, data types play a crucial role in defining the structure and organization of data within your PLC program. Let’s explore some essential data types available in TIA Portal:

  1. Basic Data Types:

    • These are fundamental data types used for storing simple values.

    • Examples include:

      • Integer (INT): Represents whole numbers (positive or negative).

      • Real (REAL): Represents floating-point numbers (decimal values).

      • Boolean (BOOL): Represents true or false values.

      • Byte(Byte):- Represent 8 bits

  2. User-Defined Data Types (UDTs):

    • UDTs allow you to create custom data structures by combining basic data types.

    • You can define your own UDTs to represent complex objects or process-specific data.

    • UDTs enhance code readability and reusability.

  3. Arrays:

    • Arrays are collections of elements of the same data type.

    • They allow you to store multiple values under a single variable name.

    • Useful for handling repetitive data (e.g., sensor readings).

  4. Enumerated Data Types (ENUM):

    • ENUMs define a set of named values (enumerators).

    • Useful for representing discrete states or options (e.g., days of the week, operating modes).

  5. System Data Types:

    • These are predefined data types provided by Siemens.

    • Examples include:

      • IEC_TIMER: Represents time intervals.

      • IEC_COUNTER: Counts events.

      • IEC_DATE_AND_TIME: Stores date and time information.

  6. Structured Data Types:

    • These combine different data types into a single structure.

    • Useful for organizing related data.

    • Includes structures like STRUCT and UNION.

Qn How many blocks are used in TIA Portal ?

  1. In S7-1200, blocks are modular units of code that perform specific functions. They include:

Qn Difference betwenn Local and Global address in TIA Portal

  1. Local Addresses:

    • Local addresses refer to memory locations within a specific block or function.

    • They are accessible only within the scope of that particular block or function.

    • Local addresses are used for temporary storage, intermediate calculations, or specific tasks.

    • Examples of local addresses include variables declared within a function block (FB) or a function (FC).

    • These addresses are not visible or accessible outside the block or function where they are defined.

  2. Global Addresses:

    • Global addresses are accessible from anywhere in the project.

    • They are not limited to a specific block or function and can be accessed globally.

    • Global addresses are often used for shared data, communication between different parts of the program, or for storing persistent information.

    • Examples of global addresses include:

      • Tags: These are globally accessible and can be used throughout the project. Tags can represent inputs, outputs, memory areas, timers, counters, etc.

      • User-Defined Data Types (UDTs): UDTs allow you to define custom data types based on existing elementary or complex types. UDTs are global and enhance reusability.

      • Static Variables: These are retentive memories stored in the CPU’s non-volatile memory. They can be referenced throughout the program and are also global.

In summary:

  • Local addresses are confined to specific blocks or functions.

  • Global addresses are accessible project-wide and facilitate communication and data sharing across different parts of the program.

Qn . differences between Function Blocks (FB) and Functions (FC) in Siemens TIA Portal:

    1. Function Block (FB):

      • Memory and State:

        • An FB is a function that “remembers” or “keeps score” of its last operations.

        • It has an instance Data Block (IDB) associated with it.

        • The IDB saves all the parameters (IN, OUT, IN-OUT, and STAT).

        • The STAT parameter is not available in FCs.

      • Reusability:

        • FBs allow re-use of blocks with different calling environments.

        • They encapsulate functionality and data.

      • Automatic Memory Management:

        • The IDB makes STATIC parameters always available, memorized, and accessible.

        • Even if the block is not being processed at the exact moment by the CPU, the IDB retains its data.

      • Examples:

        • FBs include timers (TON), counters (CTU), and other blocks that need to remember their state between cycles.

    2. Function (FC):

      • No Memory:

        • FCs do not have memory associated with them.

        • They do not retain information between cycles.

      • General Purpose:

        • FCs are general-purpose functions without memory.

        • They perform specific tasks but do not store intermediate results.

      • Example:

        • FCs include mathematical calculations, logic operations, and other functions that do not require memory.

  1. Siemens TIA Portal V17, let’s explore the distinction between elementary data types and complex data types:

    1. Elementary Data Types (Primitive Data Types):

      • These are the fundamental building blocks for representing basic values.

      • They are predefined by the programming language and are independent of other types.

      • Examples of elementary data types include:

        • Integer (int): Represents whole numbers without fractions (e.g., 300, 0, -300).

        • Floating Point (float): Represents numbers with fractions (e.g., 34.67, 56.99, -78.09).

        • Character (char): Represents a single letter, digit, punctuation mark, symbol, or blank space.

        • Boolean (bool): Represents true or false values.

    2. Complex Data Types:

      • These data types are more intricate and allow us to create structured and reusable data structures.

      • They are often user-defined or non-primitive.

      • Examples of complex data types in TIA Portal V17 include:

        • Arrays:

          • An array represents a fixed number of components of the same data type.

          • It can have up to six dimensions, each with its own set of bounds.

          • Array components are addressed using fixed or variable indexes.

          • Example: Creating an array of ten integers, ten reals, and ten Booleans.

        • Structures (STRUCT):

          • A structure represents a data structure with distinct components of various data kinds.

          • Components can be of the STRUCT or ARRAY data types.

          • Structures group data for efficient parameter transfer.

          • Nested structures allow up to 8 levels of nesting.

          • Example: Creating a structure for a lubricating plant with tank-related signals.

        • User-Defined Data Types (UDTs):

          • UDTs allow you to define custom data types based on existing elementary or complex types.

          • They enhance reusability and efficiency in programming.

          • Example: Creating a UDT to handle IOs for multiple tanks in the lubricating plant.