Let's get this right, first the operator enters the values as integers, the PLC converts these to floats, does the maths, adds 0.5 then converts back to an integer, the operator does not need to do anything. it's simple maths if the result is 2.0 to 2.4 then by adding 0.5 & convert it to an integer it comes out at 2, if the result is 2.5 to 2.9 then adding 0.5 the float is 3.0.0 to 3.4 so converted it is 3
so there is no need for the operator to enter anything more than the values for the calculation it's that simple. in other words as per naormal math conversions it rounds down if the decimal places are less than 0.4 or rounds up if the decimal places are 0.5 to 0.9
I will try to make it simple:
Step 1 operator enters the values 8 & 3
Step 2 the PLC then converts them to floats using INT_TO_Float, 8.0 & 3.0
Step 3 the PLC divides them giving 2.66666
Step 4 the PLC adds 0.5 to the result (2.66666) so you end up with 3.16666
Step 5 the PLC converts that to an integer FLT_TO_INT the result is 3
so there is no need for the operator to enter anything more than the values for the calculation it's that simple. in other words as per naormal math conversions it rounds down if the decimal places are less than 0.4 or rounds up if the decimal places are 0.5 to 0.9
I will try to make it simple:
Step 1 operator enters the values 8 & 3
Step 2 the PLC then converts them to floats using INT_TO_Float, 8.0 & 3.0
Step 3 the PLC divides them giving 2.66666
Step 4 the PLC adds 0.5 to the result (2.66666) so you end up with 3.16666
Step 5 the PLC converts that to an integer FLT_TO_INT the result is 3
