Rounding in the PLC

Another thing.. you have to know what your weight scale does its weight values. If it just truncates then rounding would seem to be even more destructive to limit numbers? does it round to the nearest 10th.. how? just strictly Up from anything over the lower whole, down on anything less than the higher hole? Or from the half?
 
Another thing.. you have to know what your weight scale does its weight values. If it just truncates then rounding would seem to be even more destructive to limit numbers? does it round to the nearest 10th.. how? just strictly Up from anything over the lower whole, down on anything less than the higher hole? Or from the half?

That is the exact precision of the scale itself.
 
I'm still not seeing the sense to round limits. I know their asking you for it, i get that.. but I'm just confused why they would want to make their tolerance limits less accurate.

If they say they want 1.9 but then want you to round it... do they really want 1.8 or 2.0? By rounding they are altering their tolerance.

If you round the high tolerance down and the low tolerance up because of where athe hundredths lands you, you narrow the tolerance. or if high goes up and low down, you expand it. both up or both down.. you slide it. I just don't see how this would be a viable limit.

A standard tolerance is.. take your measured value, test it against your high and low limits based on a percentage from the target value. if it falls within its down. Rounding is going to completely skew your tolerance target what could be within 2% if the rounding brought the limits both inwards towards the target resulting in a less than 2% tolerance, you get a false out of tolerance.


as a ridiculous side note.. I've worked at a place and done a weekly scale calibration with 5 and 25LBs weights to ensure a product scale would read right. Tare out the package and plastic cryovac bags.. Production would still take and stick a package where it would block rejects that fell outside tolerance and ship the rejects. when measured they were outside shipping tolerance, over and under. I just had to verify scale calibration for QA to be happy. Production gave zero damns. Shipped it all. This and a mirade of other stupid actions at that place gave me zero surprise when the company closed that plant. Fortunately I'd booked it years before the plant closed.
 
Thanks for continuing to add detail. My only question is would it be safe to still perform the DIV by 10 at the end? These values are all stored in a database, so if I can keep the number is the "correct" format, then I don't need to touch the reports. Thanks again.


Yes, it is safe to divide by 10 for storing the value in the DB, but don't use it for the compare. Caveat: that may put values in DB that appear to pass or fail when the stored pass/fail value declares the opposite.

Not that it matters: I agree with other comments that client/customer is asking for summat that is irrational, but whatever.

The best thing to do would be to convert the limits to the format of the measurement that comes directly from the scale itself, even if that is a string, and compare those.
 
Yes, it is safe to divide by 10 for storing the value in the DB, but don't use it for the compare. Caveat: that may put values in DB that appear to pass or fail when the stored pass/fail value declares the opposite.

Not that it matters: I agree with other comments that client/customer is asking for summat that is irrational, but whatever.

The best thing to do would be to convert the limits to the format of the measurement that comes directly from the scale itself, even if that is a string, and compare those.

See and that's what started this whole ordeal. If I simply round the display values on the web report, I get "passable" values that show as failed.

Thanks for all the input everyone.
 
See and that's what started this whole ordeal. If I simply round the display values on the web report, I get "passable" values that show as failed.

Thanks for all the input everyone.


If they fail, add or subtract 0.1, then send to DB.


update: I think my method, which ADDs 0.5 and TRNs after MULtiplying by 10, and does the pass-fail test before the DIV, ensures any failed value will never appear "passable" against a 0.1-resolution limit. So maybe my last caveat was incorrect.
 
Last edited:

Similar Topics

Dear All, I need to round off the analog value FOR EXAMPLE: 123.45 to 123 Please prove solution. Thanks
Replies
14
Views
20,795
Hi all, Grounding and earthing problems are hardest to find. in our plant we are having Ctrl logix plc. each 4-20 ma instrument is showing display...
Replies
1
Views
1,903
I am installing a panel mounted hard-wired UPS to protect a Versaview and a ControlLogix processor. The UPS has grounding connections on the input...
Replies
7
Views
3,885
Hi all, I'm connecting several 4-20mA sensors together in parallel (only one shown below) The enclosure is ABS plastic with metal backplate DAQ...
Replies
5
Views
261
I have Rhino 120 to 24 dc power supply and it has 2 Positive and 2 negative terminals on the DC side but no ground terminal. Should I connect one...
Replies
9
Views
432
Back
Top Bottom