dalporto
Lifetime Supporting Member
Good morning.
I'm doing a rehab and I need to recycle some part of the old code that won't change and that I need. This is a calculation that looks to 3 instruments and a couple coefficients.
I don't work much with Structured Text since the customers mainly don't want us too, their staff is mainly "trained in" LD and FBD. Anyway.
I'm not sure if this is weird, or if there is something that I don't understand about ST.
1- Energy_Kinematic_Global calculation is after the line that uses it;
2 - The Hn IF/THEN + the calculation seems an odd way to do it. The calculation, then the limiter using the same tag?
Also when I run it (without instrumentation present (Q, P1, P2)) and I pass the Hn value to InTouch, I'm getting 25.000, but I can clearly see the value flash to 2.208 from time to time. What is the Q**2 operation by the way?
Thanks.
K1 := 10.197;
C1 := -0.82;
Q := TUR_FT13;
P1 := (TUR_PT15 / 100);
P2 := (TUR_PT16 / 100);
Hn := ((P1 - P2) * K1) + C1+ Energy_Kinematic_Global;
Energy_Kinematic_Global := (Q**2)/274;
IF Hn >= 68.0 THEN
Hn := 68.0;
END_IF;
IF Hn <= 25.0 THEN
Hn := 25.0;
END_IF;
I'm doing a rehab and I need to recycle some part of the old code that won't change and that I need. This is a calculation that looks to 3 instruments and a couple coefficients.
I don't work much with Structured Text since the customers mainly don't want us too, their staff is mainly "trained in" LD and FBD. Anyway.
I'm not sure if this is weird, or if there is something that I don't understand about ST.
1- Energy_Kinematic_Global calculation is after the line that uses it;
2 - The Hn IF/THEN + the calculation seems an odd way to do it. The calculation, then the limiter using the same tag?
Also when I run it (without instrumentation present (Q, P1, P2)) and I pass the Hn value to InTouch, I'm getting 25.000, but I can clearly see the value flash to 2.208 from time to time. What is the Q**2 operation by the way?
Thanks.
K1 := 10.197;
C1 := -0.82;
Q := TUR_FT13;
P1 := (TUR_PT15 / 100);
P2 := (TUR_PT16 / 100);
Hn := ((P1 - P2) * K1) + C1+ Energy_Kinematic_Global;
Energy_Kinematic_Global := (Q**2)/274;
IF Hn >= 68.0 THEN
Hn := 68.0;
END_IF;
IF Hn <= 25.0 THEN
Hn := 25.0;
END_IF;