Your First Statement
Part of the Structured Text section of Coddy's PLC Programming journey. Lesson 1 of 17.
Ladder is not the only way to program a PLC. Structured Text (ST) is the main text language of IEC 61131-3: you type the program instead of drawing it. Big programs, math and step sequences are often easier to read as text.
This rung lights Green while PB1 is held:
In Structured Text it is one statement:
Green := PB1;Read := as "becomes": every scan, Green becomes whatever PB1 is. The ; ends the statement. Statements run top to bottom on every scan, just like rungs. Text after //, or between (* and *), is a comment: the PLC skips it.
Challenge
EasyWrite one statement that makes Green follow PB1.
Press Run, try it on the machine, then Check.
Try it yourself
// Write your statement below this line
All lessons in Structured Text
1From Rungs to Text
Your First StatementAND, OR and NOTThe Seal-In in TextIF and THENVariables in VARPractice on your own: PLC playground