Hi! engineers:
I want to kown whether I can take a funciton, such as "real_to_int" to convert the DINT to DWORD by CoDeSys.
I have tried to use the keyword for DINT_TO_DWORD, but it can be realized by CoDeSys.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2013-04-10
Originally created by: M.Schaber
Hi, skytianlin,
skytianlin hat geschrieben:
I want to kown whether I can take a funciton, such as "real_to_int" to convert the DINT to DWORD by CoDeSys.
I have tried to use the keyword for DINT_TO_DWORD, but it can be realized by CoDeSys.
The type conversion functions are documentet in the online help, there is a chapter about type conversion operators.
In your case, the ANY_TO_INT() should work:
re:REAL:=1.234;i:INT:=ANY_TO_INT(re)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi! engineers:
I want to kown whether I can take a funciton, such as "real_to_int" to convert the DINT to DWORD by CoDeSys.
I have tried to use the keyword for DINT_TO_DWORD, but it can be realized by CoDeSys.
Originally created by: M.Schaber
Hi, skytianlin,
The type conversion functions are documentet in the online help, there is a chapter about type conversion operators.
In your case, the ANY_TO_INT() should work: