Skip to content

Commit

Permalink
Update variable names in SCALE function for clarity and consistency.
Browse files Browse the repository at this point in the history
- Renamed variables in SCALE function for better understanding and consistency.
- Updated variable names to reflect their purpose accurately.
  • Loading branch information
franz-hoepfinger-4diac authored and azoitl committed Sep 20, 2024
1 parent 5aef5b0 commit 4e9d319
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions data/typelibrary/signalprocessing-1.0.0/typelib/SCALE.fct
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<EventInputs>
<Event Name="REQ" Type="Event" Comment="">
<With Var="IN"/>
<With Var="MAX1"/>
<With Var="MIN1"/>
<With Var="MAX2"/>
<With Var="MIN2"/>
<With Var="MAX_IN"/>
<With Var="MIN_IN"/>
<With Var="MAX_OUT"/>
<With Var="MIN_OUT"/>
</Event>
</EventInputs>
<EventOutputs>
Expand All @@ -23,10 +23,10 @@
</EventOutputs>
<InputVars>
<VarDeclaration Name="IN" Type="REAL" Comment="Input to be Scaled"/>
<VarDeclaration Name="MAX1" Type="REAL" Comment="Maximum Input"/>
<VarDeclaration Name="MIN1" Type="REAL" Comment="Minimum Input"/>
<VarDeclaration Name="MAX2" Type="REAL" Comment="Maximum Ouput"/>
<VarDeclaration Name="MIN2" Type="REAL" Comment="Minimum Output"/>
<VarDeclaration Name="MAX_IN" Type="REAL" Comment="Maximum Input"/>
<VarDeclaration Name="MIN_IN" Type="REAL" Comment="Minimum Input"/>
<VarDeclaration Name="MAX_OUT" Type="REAL" Comment="Maximum Ouput"/>
<VarDeclaration Name="MIN_OUT" Type="REAL" Comment="Minimum Output"/>
</InputVars>
<OutputVars>
<VarDeclaration Name="" Type="REAL" Comment=""/>
Expand All @@ -39,13 +39,13 @@
FUNCTION SCALE : REAL
VAR_INPUT
IN : REAL; // Input to be Scaled
MAX1 : REAL; // Maximum Input
MIN1 : REAL; // Minimum Input
MAX2 : REAL; // Maximum Ouput
MIN2 : REAL; // Minimum Output
MAX_IN : REAL; // Maximum Input
MIN_IN : REAL; // Minimum Input
MAX_OUT : REAL; // Maximum Ouput
MIN_OUT : REAL; // Minimum Output
END_VAR
SCALE := (IN - MIN1) * (MAX2 - MIN2) / (MAX1 - MIN1) + MIN2;
SCALE := (IN - MIN_IN) * (MAX_OUT - MIN_OUT) / (MAX_IN - MIN_IN) + MIN_OUT;
END_FUNCTION
Expand Down

0 comments on commit 4e9d319

Please sign in to comment.