Structured Text Programming in WindLDR
Key Takeaway
How to write Structured Text programs in WindLDR for IDEC FC6A PLCs — syntax, data types, conditional logic, loops, and practical examples.
Quick Answer
WindLDR supports Structured Text (ST) as an IEC 61131-3 programming language for the FC6A. ST uses high-level text syntax for complex calculations, data manipulation, and sequencing algorithms that would be cumbersome in ladder diagram.
When to Use Structured Text
- Complex math — Multi-step calculations, floating-point operations, and engineering unit conversions
- State machines — Multi-step sequences using CASE statements
- Data processing — Array operations, string handling, and data table manipulation
- Algorithm implementation — Custom PID variants, statistical calculations, and protocol handling
Variable Declaration
VAR
Pressure : REAL;
PumpRunning : BOOL;
StepNumber : INT;
TankLevel : REAL := 0.0;
END_VARConditional Logic
IF Pressure > 150.0 THEN
HighPressureAlarm := TRUE;
ShutdownValve := TRUE;
ELSIF Pressure > 120.0 THEN
HighPressureWarning := TRUE;
ELSE
HighPressureAlarm := FALSE;
HighPressureWarning := FALSE;
END_IF;CASE Statement for Sequencing
CASE StepNumber OF
0: (* Idle *)
IF StartCommand THEN StepNumber := 10; END_IF;
10: (* Open inlet valve *)
InletValve := TRUE;
IF InletOpen THEN StepNumber := 20; END_IF;
20: (* Start pump *)
PumpStart := TRUE;
IF PumpRunning THEN StepNumber := 30; END_IF;
30: (* Running *)
IF StopCommand THEN StepNumber := 0; END_IF;
END_CASE;FOR Loop Example
TotalFlow := 0.0;
FOR i := 0 TO 9 DO
TotalFlow := TotalFlow + FlowRate[i];
END_FOR;
AverageFlow := TotalFlow / 10.0;For cross-platform comparison, see how Allen-Bradley handles Structured Text in Studio 5000.
Need help with scada & programming?
Texas-based licensed engineers — get a free, no-obligation assessment.
Frequently Asked Questions
Yes. WindLDR supports Structured Text as part of its IEC 61131-3 language set for the FC6A.
Variables are declared in a VAR/END_VAR block with name, data type, and optional initial value. WindLDR automatically allocates them to IDEC memory addresses.
Still have questions about your setup? Talk to an engineer or call (210) 405-4248.