In PLCOpen's Coding Guidlines, section 5.28 says to avoid using deprecated features. Under Examples, it lists "Standard Function 'TRUNC.'" I assume that the preferred method at this point is to use a REAL_TO_INT conversion operator. Can someone elaborate on the differences, and why to use one over the other?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In PLCOpen's Coding Guidlines, section 5.28 says to avoid using deprecated features. Under Examples, it lists "Standard Function 'TRUNC.'" I assume that the preferred method at this point is to use a REAL_TO_INT conversion operator. Can someone elaborate on the differences, and why to use one over the other?
Trunc - Removes anything after the decimal.
Real_to_int - Rounds up if after decimal is >= 0.5.