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
, FX2
NC
, FX
3G
, FX
3U
, and FX
3UC
series.
햲
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);
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
Summary of Contents for FX2N-32CAN
Page 1: ...MITSUBISHI ELECTRIC FACTORY AUTOMATION Programmable Logic Controllers GX IEC Developer ...
Page 2: ......
Page 4: ......
Page 6: ......
Page 10: ...IV MITSUBISHI ELECTRIC ...
Page 18: ...Modular PLC Training Hardware Course Overview and Requirements 1 2 MITSUBISHI ELECTRIC ...
Page 176: ...Device Edit 8 4 MITSUBISHI ELECTRIC ...
Page 190: ...Assigning DUT Variables to Function Blocks Data Unit Types DUT 10 10 MITSUBISHI ELECTRIC ...
Page 198: ...Array Example Single Dimension Array Arrays 11 8 MITSUBISHI ELECTRIC ...
Page 219: ...Sequential Function Chart SFC SFC Elements Training Manual GX IEC Developer 14 3 ...
Page 230: ...Structured Text Program Example IEC Structured Text 16 4 MITSUBISHI ELECTRIC ...
Page 278: ...PLC Components Glossary Appendix A 18 MITSUBISHI ELECTRIC ...
Page 283: ......