Sign in to follow this  
Followers 0
okaneem

scaling?

5 posts in this topic

Hi Friends I would like to scale an analog input 4-20mA to -100/+100.I have 4000 resolution.I dive 4000 by 200,than I minus 100 from that and put it to D10.when it comes to -(under zero) the value goes to 65426.How can I see the number under 0.Also how can I show floating point.Can some one explain it. Thanks I

Share this post


Link to post
Share on other sites
Asuming you are using a CPU which supports function blocks, have a look here.. http://forums.mrplc.com/index.php?app=downloads&showfile=996

Share this post


Link to post
Share on other sites
Dear PdL, Thank you for function block.I am not able to put a value under 0.When I do it a red line occurs on,the left side.I can only do it on monitoring mode.Also could you mention about FLT function.I process input 2001,which is 0-4000,to floating point and write it to D10.And then I would like to divide it.I use /F D10 D12 D14.It is confusing me here.What should I write to D12 to divide D10 by 10 or an other value I decide.Can you help a little bit to understand.? Thank you so much Edited by okaneem

Share this post


Link to post
Share on other sites
Where are you trying to enter a negative value? About the division, why don't you integrate the division into the scaling block, so divide the minimum and maximum output value you enter on the scaling block parameters by 10? That gives the same result. If you still want to use the /F, enter a constant for the divisor word, or move the divisor value into D12. So /F D10 +10 D14 or MOVF +10 D12 and /F D10 D12 D14. See pictures.

Share this post


Link to post
Share on other sites
Using the Function block in the link that PDL provided (http://forums.mrplc.com/index.php?app=downloads&showfile=996), you could enter this and use the Floating point output from it to get your answer: As you can see a value of 1000 (25% input or a value of 8 mA) is received in the input word (2001 in this example), which would return a value of -50.0 (float, D0 in this example).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0