I've been searching for a while but I can't seem to think of a search string that will get my answer. Putting number or value in a programming search brings back all kinds of unrelated stuff.
Thanks
Shane
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I got it. The data types were DINT's. It's an Allen Bradley thing. You can operate on data using DINT's in AB but it rounds and drops the decimal. Codesys doesn't like that apparently. When I read your post and saw the REAL values it made me realize my mistake (see what I did there). I had to switch all the variables to REAL.
Thanks for your help again, super appreciate it :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi guys,
I feel a bit dumb having to ask this but how do I insert a number into my structured text program?
For example:
I've been searching for a while but I can't seem to think of a search string that will get my answer. Putting number or value in a programming search brings back all kinds of unrelated stuff.
Thanks
Shane
Try 100.0, or REAL#100 or LREAL#100.
If not, which datatypes are the three, and which compiler version, and which error?
https://help.codesys.com/webapp/_cds_operands_constant_real;product=codesys;version=3.5.15.0
I got it. The data types were DINT's. It's an Allen Bradley thing. You can operate on data using DINT's in AB but it rounds and drops the decimal. Codesys doesn't like that apparently. When I read your post and saw the REAL values it made me realize my mistake (see what I did there). I had to switch all the variables to REAL.
Thanks for your help again, super appreciate it :)