Structured Text Program Example - Mitsubishi Electric FX Series Training Manual

Programmable logic controllers
Hide thumbs Also See for FX Series:
Table of Contents

Advertisement

Structured Text Program Example

Structured Text Program Example
16.2
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
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
, FX2
2N
Create a new project called "Structured_Text".
Create a new POU named "Fahrenheit", of Class: FUN , Result Type: REAL , with a lan-
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);
Create a new POU with a name "Temp_Conv",
Class: PRG , Language: Function Block Diagram
16 - 2
´
Celsius
9
=
+
32
5
, FX
, FX
, and FX
NC
3G
3U
series.
3UC
IEC Structured Text
MITSUBISHI ELECTRIC

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents