PaulKim1003

Is it safe to divide an INT to Real ?

5 posts in this topic

Hi guys,

Is it safe to divide an INT to Real?

 

Capture1.thumb.PNG.ce90af66f7e1441b101b5

Thanks

Share this post


Link to post
Share on other sites

As long as source B is never zero it should work. I'm not sure how a raw analog value can be divided by a constant and end up with a useful floating point value but that's not the question is it? :o)

Share this post


Link to post
Share on other sites

Posted (edited)

Capture1.thumb.PNG.6940fec0e307876c13deeThanks Michael,

I am trying to get 4-20 mA from the sensor and based on the current i am going generate an alarm on HMI 

Am i doing it wrong??

 

 

Edited by PaulKim1003

Share this post


Link to post
Share on other sites

Posted (edited)

It looks like your PLC is a Control Logix not an SLC. If that is correct I would scale the Analog input on the card of it's an IF8 or IF16.

You can scale it as a real and do a compare. 

or

Take a look at the example program. The IO is scaled on the card. Then a loop pulls the scaled data into an analog alarm block. You can set alarms and shutdown setpoints in the alarm block. Alarm bits for each tag are in the block. Deadband. Etc. All tags can be referenced by an HMI

Example of a LACT.ACD

Edited by Michael Lloyd

Share this post


Link to post
Share on other sites

It's never a great idea to mix and match data types when applying math instructions as even under the best of circumstances, the results are always subject to rounding and truncating errors. Also, as Lloyd has stated above, if you're using a ControlLogix platform, just get a diagnostic analog input card (such as the two he suggested) and set the scaling in the card. This not only eliminates possible errors in the math instruction(s), you're not wasting valuable controller card scan time on scaling logic since the input card would be multicasting scaled data across the backplane.

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