Please, Could you also tell me how to Call in a SubRoutine Program file? (like in Allen Bradley where JSR Instruction is used)How can I do this in GXWork3?
Khaled: I suggest you start a new thread unless you are doing it in GXWorks3 as the answer has already been posted, stating what PLC etc.
There area lot of old Threads here regarding scaling for example a simple one is if the min and max raw value is 0-32000 and your scale you want is 0-5.0
then divide 32000 by 50 = 640 (or 64.0)
Then divide the raw value by 640 so if the raw value = 16000 then 16000 / 640 = 25 (2.5) so that is half of the 5.0 which corresponds to half the max raw value. It is best to convert them all to real numbers do the maths then you will have more accurate results.
However, if your analogue raw does not start at 0 then you need to subtract the offset first.
Which PLC are you using as it matters, if FX5U then it is slightly different than say FX3 or Q series.
So for FX5 I suggest you create your code in an FB (Function Block) then you can call it in your program especially if you want to call it on a condition.
or if it is just another program block you want to call in the main scan then just create a new Program Block and add it to the Task.
Function Blocks do not need to pass parameters but then the labels (symbols) should be global ones so they are accessible by other programs.