Decimal Places and Integers

Ktn

Member
Join Date
Sep 2008
Location
Cape Town
Posts
9
I would really appreciate some feedback on the following: If for eg. I have a double integer with a value of 88965 and divide this value by 10, I will have 8896.5. Will this number that needs to be displayed be converted to 8897 or will .5 just be ingored and the display will show 8896. Any help will be much appreciated. Thanks
 
Hi

If the value is in the PLC and represents xxxxxx.x units but is actually xxxxxxxx in the PLC you can simply scale most HMI's to show 1 decimal place without ANY PLC changes.

That is what i usually do.
 
Integer division gives an integer result. In Step7,

Code:
L L#88965
L L#10
/D

gives a result of 8896
 
Thanks very much, that answers my question. Now back to changing all of my ladder logic since i was under the impression that it would get rounded off to the nearest whole integer.
 

Similar Topics

Hi there, Does anyone know how to limit the # of decimal places of all floating integers displayed on the HMI? I want to display one decimal...
Replies
4
Views
7,466
In S7/TIA Portal, is there a function to round a real to a specified number of decimal places? e.g. If I have 22.519432 and I want to round it to...
Replies
16
Views
1,890
Hello, I have googled my question without much luck. I am using the FGEN instruction and trying to find out how to control the number of decimal...
Replies
15
Views
5,570
Hello everyone, I have met the following issue in a project: there is an I/O field where you can set parameter "number of decimal places" for an...
Replies
0
Views
1,180
I am displaying inch position values in numerous places on a Kadet G307K2. The display format is three decimal places, i.e. 00.000. I need to...
Replies
3
Views
2,210
Back
Top Bottom