About This File
I sometimes need to scale an analog value, so I had to do a function to better suit my needs than Siemes "Scale" function.
It has 5 inputs, all in integer format.
_In - The value to be scaled
_In_Min - Lowest value of the "_In" signal.
_In_Max - Highest value of the "_In" signal.
_Out_Min - Lowest allowed value of the scaled output.
_Out_Max - Highest allowed value of the scaled output.
The output "_Out" is the calculated value in integer format.
Edit.
It's saved as a global library.
TIA Portal V13 SP1 Upd. 4