IEC 61131-3 Program

Help Contents

Introduction

A Program is a sequence of statements executed in order. You can execute a Program in one of two ways:

A Program can reference other Functions and Function_Blocks.

A Program uses the following syntax:

Program name
    variable-declarations

    statement;
    statement;
    ...
    statement;
End_Program

Where:

Example

This example adds together three tag values and places the result in a global variable:

Var_Global
	(* Global variable storing total current *)
	PumpStationCurrent : LREAL;
End_Var

Program CalcTotalCurrent
	(* Calculate total current and store in a global variable *)
	PumpStationCurrent := %"PumpStation.Motor1Current" +
		%"PumpStation.Motor2Current" +
		%"PumpStation.Motor3Current";	
End_Program

Further Information

Program Units

To learn about other program units.

Variable Declarations

To learn about variable declarations.

Structured Text (ST) Statements

To learn about Structured Text (ST) Statements.

Glossary

For the meaning of terms used in Fernhill SCADA.