SACA Programmable Logic Controllers 2 — Questions and Answers
Question 1: In IEC 61131-3, what is the key characteristic of a Function Block Diagram (FBD) program?
- Text-based sequential instructions similar to assembly language
- Graphical blocks with inputs and outputs connected by signal flow lines (Correct answer)
- Flowchart-style diagrams showing process steps and decisions
- Relay-equivalent contact and coil symbols on rungs
Correct answer: Graphical blocks with inputs and outputs connected by signal flow lines
FBD uses graphical function blocks (representing algorithms like PID, timers, comparators) with their inputs and outputs connected by lines showing the flow of data — ideal for signal processing and continuous control applications.
IEC 61131-3 defines 5 PLC languages: Ladder Diagram (LD), Function Block Diagram (FBD), Structured Text (ST), Instruction List (IL), and Sequential Function Chart (SFC). FBD resembles electronic circuit diagrams — function blocks execute in a defined order, passing data between them. Standard function blocks include AND, OR, timers, counters, PID controllers, and math functions. FBD is preferred for process control engineers familiar with P&ID diagrams and for applications with parallel data flows.
Question 2: What is the purpose of the PLC's watchdog timer?
- To automatically schedule preventive maintenance alerts
- To reset or halt the CPU if the scan cycle takes longer than a programmed time limit (Correct answer)
- To track the total operating hours of the PLC
- To synchronize multiple PLC clocks across a network
Correct answer: To reset or halt the CPU if the scan cycle takes longer than a programmed time limit
The watchdog timer is a safety mechanism — if the scan cycle doesn't reset the timer within the configured period (e.g., 150ms), it indicates a program fault or infinite loop, triggering a CPU fault and transition to safe state.
The scan cycle (read inputs → execute program → write outputs) must complete within a bounded time. The watchdog timer is loaded with a maximum allowed scan time at startup. Each scan cycle resets it; if the cycle takes too long (due to infinite loops, very long user programs, or CPU faults), the timer expires and the CPU faults, forcing outputs to their fail-safe states. On Allen-Bradley PLCs, the watchdog is called 'Maximum Scan Watchdog'; on Siemens, it's the OB80 (time error) interrupt.
Question 3: In Ladder Diagram programming, what does an 'XIC' (Examine If Closed) instruction do when the referenced bit is FALSE (0)?
- It provides continuity (passes power flow) to the next element in the rung
- It blocks continuity (prevents power flow), acting like an open switch (Correct answer)
- It forces the bit to TRUE and continues scanning
- It generates a fault and halts program execution
Correct answer: It blocks continuity (prevents power flow), acting like an open switch
XIC (Examine If Closed) passes power flow (logical continuity) only when the referenced bit is TRUE (1). When the bit is FALSE (0), XIC acts as an open contact, blocking power flow in that rung branch.
Ladder diagram mimics relay logic. XIC (Allen-Bradley terminology; 'normally open contact' in IEC notation) represents a contact that passes current only when energized (bit=1). XIO (Examine If Open) passes current only when the bit is 0. The output coil (OTE) sets a bit to 1 when the rung has continuity. Understanding XIC/XIO behavior is fundamental — a common mistake is confusing the logical bit state with the physical switch state (a normally-closed physical switch wired to a PLC input goes high=1 when healthy).
Question 4: What is the difference between retentive and non-retentive timer instructions in a PLC?
- Retentive timers count in seconds; non-retentive timers count in milliseconds
- Retentive timers maintain their accumulated value when the rung goes false; non-retentive timers reset to zero (Correct answer)
- Retentive timers output a pulse; non-retentive timers hold their output continuously
- Retentive timers require battery backup; non-retentive timers work without battery
Correct answer: Retentive timers maintain their accumulated value when the rung goes false; non-retentive timers reset to zero
A retentive timer (RTO/TONR) preserves its accumulated count when de-energized — useful for tracking total running time. A non-retentive timer (TON/TOF) resets to zero whenever the enabling condition goes false.
TON (Timer On-Delay): starts timing when rung goes true, resets immediately when rung goes false — like measuring how long a button has been held. RTO (Retentive Timer On): accumulates time whenever rung is true, keeps value when rung goes false — like measuring total runtime. RTO requires an explicit RES (Reset) instruction to clear it. Application: TON for sequence delays; RTO for maintenance hour counters. TOF (Timer Off-Delay) starts timing when the rung goes false, keeping output true for the delay period.
Question 5: Which PLC communication protocol operates at the application layer and is specifically designed for reading/writing data in Rockwell/Allen-Bradley controllers?
- Modbus RTU
- EtherNet/IP with CIP (Correct answer)
- PROFIBUS DP
- DeviceNet
Correct answer: EtherNet/IP with CIP
EtherNet/IP uses the Common Industrial Protocol (CIP) over standard Ethernet/TCP-UDP — it is the native protocol of Allen-Bradley PLCs (ControlLogix, CompactLogix) for explicit messaging and I/O connections.
CIP (Common Industrial Protocol) is maintained by ODVA and used across three physical networks: EtherNet/IP (Ethernet), DeviceNet (CAN bus), and ControlNet (coax). EtherNet/IP uses TCP for explicit messaging (read/write data on demand) and UDP multicast for implicit messaging (real-time I/O, cyclic). Tags in ControlLogix PLCs are accessed by name (e.g., 'Motor1.Speed'). The MSG instruction in Logix uses CIP to read/write data in remote PLCs. Third-party devices support EtherNet/IP via ODVA certification.
Question 6: What is 'indirect addressing' in PLC programming and when is it used?
- Accessing data in a remote PLC over a network connection
- Using a variable as a pointer to specify the memory address of the actual data (Correct answer)
- Programming offline without connecting to a physical PLC
- Accessing data from a previous scan cycle's register values
Correct answer: Using a variable as a pointer to specify the memory address of the actual data
Indirect addressing uses the value of one variable as the address of another — allowing the program to select different data elements using a computed index, enabling loops and array processing without writing repetitive code.
In ladder logic, indirect addressing uses brackets: N7[N7[0]] means 'use the value in N7[0] as the index into array N7'. This enables powerful patterns: a single rung can process all 100 recipe parameters by incrementing an index counter. In Structured Text: myArray[indexVar] := value. Use cases include recipe management (selecting parameter sets by recipe number), sequencing (advancing through process steps), and batch processing (iterating over product lists). Indirect addressing reduces program size and simplifies maintenance.
In IEC 61131-3, what is the key characteristic of a Function Block Diagram (FBD) program?