Check the PROJECT-OPTIONS-BUILD menu from CoDeSys there is a check box for treat LREAL as REAL. Make sure your PLC supports LREAL. I had some problems in the past when a project would not compile. Why do you need 10 decimal places? In other words is this your calculation? Can you do this with interger math?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-06-23
Originally created by: Carmichael_keith
Thanks Spfeif, just had a similar problem as this dude and ur idea solved it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I need to use a real value, in order to have a precision with 10 decimal figures, eg: 1234.567891
The problem is that codesys truncates, my variable at 7 figures eg: 1234.568
There is a way to use a "double precision" of a 64 bit Real number?
I tryed to use the LREAL but when I try to build the project a message say me that LREAL is unsuported type.
Thank you in advance,
Claudio
p.s.: I used like target device a ESX micro.
go to http://www.oscat.de/ get the latest Oscat.lib and work with double precision real numbers
Check the PROJECT-OPTIONS-BUILD menu from CoDeSys there is a check box for treat LREAL as REAL. Make sure your PLC supports LREAL. I had some problems in the past when a project would not compile. Why do you need 10 decimal places? In other words is this your calculation? Can you do this with interger math?
Originally created by: Carmichael_keith
Thanks Spfeif, just had a similar problem as this dude and ur idea solved it.
a real has low precision by nature.
better to solve it in INT or with textbased math like mathcad,
if possible try indeed oscat for this, and if still having problems contact us again and we will do your math in text.
almost inifinte precision is possible.