38 lines
1.1 KiB
Markdown
38 lines
1.1 KiB
Markdown
```pascal
|
|
FUNCTION_BLOCK "Signal Gen"
|
|
{ S7_Optimized_Access := 'FALSE' }
|
|
AUTHOR : 'Author'
|
|
FAMILY : TASK0
|
|
NAME : 'Name'
|
|
VERSION : 1.0
|
|
VAR
|
|
mRampOut : Real;
|
|
mRamp : "SlewLimit";
|
|
END_VAR
|
|
|
|
|
|
BEGIN
|
|
|
|
|
|
(* classic code: #mRamp(i_InValue := 0.4 * "Blender_Variables".gBlenderNomSpeed * BOOL_TO_INT ("gClock_120s"),
|
|
i_SlewMax:=(0.4 * "Blender_Variables".gBlenderNomSpeed / 10),
|
|
i_Cycle := "Time_50ms",
|
|
out := #mRampOut) ;*)
|
|
#mRamp(i_InValue := REAL#0.4 * "Blender_Variables".gBlenderNomSpeed * BOOL_TO_INT ("gClock_120s"),
|
|
i_SlewMax:=(REAL#0.4 * "Blender_Variables".gBlenderNomSpeed / 10),
|
|
i_Cycle := "Time_50ms",
|
|
out := #mRampOut) ;
|
|
|
|
IF "Procedure_Variables".First_Production.Done AND NOT "gBlenderAlarm" AND "gIN_Filler1ProductReq" THEN
|
|
(* classic code: "Blender_Variables".gFillerProductFlow := "Blender_Variables".gBlenderNomSpeed * 0.55 + #mRampOut ;*)
|
|
"Blender_Variables".gFillerProductFlow := "Blender_Variables".gBlenderNomSpeed * REAL#0.55 + #mRampOut ;
|
|
ELSE
|
|
"Blender_Variables".gFillerProductFlow := 0 ;
|
|
END_IF ;
|
|
|
|
|
|
END_FUNCTION_BLOCK
|
|
|
|
|
|
```
|