Structured Text / SCL basics
Цель: Изучить тему «Structured Text / SCL basics» и закрепить её практическими заданиями и самопроверкой.
2 акад. часа чтение и разбор теории, решение задач, работа со схемой или виртуальным стендом и проверка понимания.
Основной материал
Structured Text is high-level IEC-style language using IF, CASE, FOR, arithmetic and functions. Siemens SCL is implementation. It is strong for calculations, arrays, loops, data processing and state machines.
Example:
IF StartCmd AND Permissive THEN RunCmd := TRUE; END_IF; IF StopCmd OR Fault THEN RunCmd := FALSE; END_IF;
Caution with loops
FOR loop executes within one scan. Large loops can increase scan time. WHILE with incorrect exit can trigger watchdog. Real-time constraints still apply.
Практическая работа
Write pseudo-ST for scaling 4-20 mA current to pressure with out-of-range fault. Then convert concept to FBD blocks.
Самопроверка
• Where ST useful?
• What does IF do?
• What risk of long loops?
• How ST differs LAD?
• Can same control algorithm be expressed different languages?
Что нужно запомнить
- Structured Text is high-level IEC-style language using IF, CASE, FOR, arithmetic and functions.
- It is strong for calculations, arrays, loops, data processing and state machines.
- Example: IF StartCmd AND Permissive THEN RunCmd := TRUE; END_IF; IF StopCmd OR Fault THEN RunCmd := FALSE; END_IF; FOR loop executes within one scan.
- Write pseudo-ST for scaling 4-20 mA current to pressure with out-of-range fault.