29 lines
1.0 KiB
Markdown
29 lines
1.0 KiB
Markdown
```pascal
|
|
FUNCTION "SyrupDensity" : Real
|
|
{ S7_Optimized_Access := 'FALSE' }
|
|
AUTHOR : 'Author'
|
|
FAMILY : 'Function'
|
|
NAME : 'Name'
|
|
VERSION : 1.0
|
|
VAR_INPUT
|
|
i_SyrupBrix : Real;
|
|
END_VAR
|
|
|
|
|
|
BEGIN
|
|
|
|
|
|
(* classic code: IF "Blender_Constants".gDens_Sucrose <> 0.0 AND ("Blender_Constants".gH2O_Density / "Blender_Constants".gDens_Sucrose) <> 1.0 THEN*)
|
|
IF "Blender_Constants".gDens_Sucrose <> REAL#0.0 AND ("Blender_Constants".gH2O_Density / "Blender_Constants".gDens_Sucrose) <> REAL#1.0 THEN
|
|
(* classic code: #SyrupDensity := "Blender_Constants".gH2O_Density /(1.0 + #i_SyrupBrix / 100.0 * (("Blender_Constants".gH2O_Density / "Blender_Constants".gDens_Sucrose) - 1.0)) ;*)
|
|
#SyrupDensity := "Blender_Constants".gH2O_Density /(REAL#1.0 + #i_SyrupBrix / REAL#100.0 * (("Blender_Constants".gH2O_Density / "Blender_Constants".gDens_Sucrose) - REAL#1.0)) ;
|
|
ELSE
|
|
(* classic code: #SyrupDensity := 0.0;*)
|
|
#SyrupDensity := REAL#0.0;
|
|
END_IF;
|
|
|
|
END_FUNCTION
|
|
|
|
|
|
```
|