Sie sind auf Seite 1von 1

Totally Integrated

Automation Portal

Project2-S7_300 ec gr II / PLC_1 [CPU 319-3 PN/DP] / Program blocks


solutii_SCL [FB1]
solutii_SCL Properties
General
Name solutii_SCL Number 1 Type FB Language SCL
Numbering Automatic
Information
Title Author Comment Family
Version 0.1 User-defined ID

solutii_SCL
Name Data type Offset Default value Accessible Writ‐ Visible in Setpoint Supervi‐ Comment
from able HMI engi‐ sion
HMI/OPC UA from neering
HMI/
OPC
UA
Input
input_a Real 0.0 0.0 True True True False
input_b Real 4.0 0.0 True True True False
input_c Real 8.0 0.0 True True True False
Output
sol_x1 Real 12.0 0.0 True True True False
sol_x2 Real 16.0 0.0 True True True False
delta Real 20.0 0.0 True True True False
sol_complexe Real 24.0 0.0 True True True False
sol_impos Real 28.0 0.0 True True True False
sol_orice Real 32.0 0.0 True True True False
InOut
Static
Temp
Constant

0001 #delta := (SQR(#input_b) - 4 * #input_a * #input_c);


0002 IF (#delta < 0) THEN
0003 // Statement section IF
0004 #sol_complexe := 1.0;
0005 #sol_x1 := 0.0;
0006 #sol_x2 := #sol_x1;
0007 ELSE
0008 IF (#delta = 0) THEN
0009 // Statement section IF
0010 #sol_x1 := (- #input_b ) / (2 * #input_a);
0011 #sol_x2 := #sol_x1;
0012 ELSE
0013 // Statement section ELSE
0014 #sol_x1 := (- #input_b + SQRT(#delta)) / (2 * #input_a);
0015 #sol_x2 := (- #input_b - SQRT(#delta)) / (2 * #input_a);
0016 END_IF;
0017
0018 // Statement section ELSE
0019 ;
0020 END_IF;
0021
0022
0023

Symbol Address Type Comment


#delta Real
#input_a Real
#input_b Real
#input_c Real
#sol_complexe Real
#sol_x1 Real
#sol_x2 Real

Das könnte Ihnen auch gefallen