16.2 Structured Text Program Example
A new Function Block will be constructed to perform a simple “Centigrade to Fahrenheit” conver
-
sion similar to that used in a previous example, in order to illustrate the use of the ‘Structured
Text’ language editor.
The formula used is as follows:
Fahrenheit
Celsius
=
´
+
9
5
32
The input and result variables will be in Floating Point (REAL) format.
NOTE For the FX range of PLCs, floating point calculation is only possible with the main units of the
FX
2N,FX2NC,FX3G,FX3U, and FX3UC series.
햲
Create a new project called "Structured_Text".
햳
Create a new POU named "Fahrenheit", of Class:
FUN
, Result Type:
REAL
,withalan
-
guage of “ST” (
Structured Text
):
햴
Create an entry in the header (LVL) of the Function “Fahrenheit”:
햵
Open the Body of the Function “Fahrenheit” and enter the following simple ST program:
Fahrenheit := (Centigrade*9.0/5.0+32.0);
Structured Text Program Example IEC Structured Text
16 - 2 MITSUBISHI ELECTRIC
햶
Create a new POU with a name “Temp_Conv”,
Class:
PRG
, Language:
Function Block Diagram