Let’s study the working of converter instruction in Siemens PLC programming using different ladder logics and programs.
It reads the input floating point value and converts it to double integer and round to nearest integer. The result is output by the parameter OUT.
It reads the input floating point value and converts it to double integer and round to zero mode. The result is output by the parameter OUT.
It reads the input floating point value and converts it to double integer. The result is the lowest integer which is greater than the floating point number i.e Round to + infinity mode. The result is output by the parameter OUT.
It reads the input floating point value and converts it to double integer. The result is the greatest integer component which is greater than the floating point number i.e Round to -infinity mode. The result is output by the parameter OUT.
If I0.0 is pressed, value in MD0 (99.78) is read as a floating point number and converted to the closest double integer(100). The result of round to integer is stored in MD4(100).
If I0.0 is pressed, value in MD0 (99.78) is read as a floating point number and converted to the double integer. The integer part of the floating point number is the result. The result is stored in MD12 (99).
If I0.0 is pressed, value in MD0 (99.78) is read as a floating point number and converted to the double integer by round function . The result is stored in MD12 (100).
If I0.0 is pressed, value in MD0 (99.78)is read as a floating point number and converted to the double integer by the round to – infinity mode. The result is stored in MD16(99).
Note: For positive numbers, trunc and floor give the same result. But for negative numbers, floor rounds down and trunc rounds up. This is because trunc always rounds toward 0.
Author: Hema Sundaresan
If you liked this article, then please subscribe to our YouTube Channel for PLC and SCADA video tutorials.
You can also follow us on Facebook and Twitter to receive daily updates.
Read Next:
In the PLC timer application for security camera recording, when motion is detected then camera…
In this example, we will learn batch mixing with PLC ladder logic program using timer…
This PLC example on manufacturing line assembly is an intermediate-level PLC program prepared for the…
In this article, you will learn the PLC programming example with pushbutton and motor control…
This article teaches how to convert Boolean logic to PLC programming ladder logic with the…
In this article, you will learn the PLC programming example on timers function block using…