khoi

Omron Analog with negative number

3 posts in this topic

Hi All,

I have a problem to work with negative numbers in CX Programmer. There is a sensor that measure from -50 to 150 degree ( 4-20mA) and I want to use SCL or APR to do.

but I cannot type -50, it always asks the entered number greater or equals 0.

Pls help me.

Thanks.

 

Share this post


Link to post
Share on other sites

SCL only works on positive numbers, so add 50 to your scaling parameters, switch to a signed datatype after the SCL, and subtract 50.

You should really be working with floating point datatypes to get the most resolution out of your input. The SCL function will cause you to lose resolution. The scaling equation is pretty simple and easy to implement with the floating point math instructions ( +F, -F, *F, and /F etc.).

 

In the picture E is your scaled max/min and R is your raw max/min.

Capture.PNG

Edited by photovoltaic
clarification on formula
2 people like this

Share this post


Link to post
Share on other sites

First question what card are you using? There are many different cards. A MAD42 is a good example all this stuff you can set it up in PLC IO window just click the card and you set it in the parameters of the card. no need for math. But if you have a AD041 you F* have to do all that math your self but it has faster timings. For my proces speed and resolution its not that important (oven slow clyce time is oke)  but if you are using is as a speed reffence then it is very important to have a fast card. 

analogekaartscaling.jpg

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