I got a problem with my project.
I must be convert my data from a memory location (ex: MD40 ) with the data type is "Real"
to another location (ex: MD50) with the data type is "Time".
Please help me!
How can i covert data from "Real" type to "Time" type
Thanks so much!
[?]: Convert "Floating_Point"=>"Time"
-
- Posts: 33
- Joined: Thu Mar 27, 2008 2:18 am
- Location: Vietnam
- Contact:
A variable with data type REAL is a fractional number which is stored as a 32-bit floating point number.
A variable with the data type TIME occupies one double word. The contents of the variable is interpreted as milliseconds and is stored as a 32-bit fixed point number.
Use conversion (and may be multiplication) functions.
A variable with the data type TIME occupies one double word. The contents of the variable is interpreted as milliseconds and is stored as a 32-bit fixed point number.
Use conversion (and may be multiplication) functions.
Code: Select all
L MD40 // 45.6
L 1000.0
*R
RND
T MD50 // 45s600ms
-
- Posts: 33
- Joined: Thu Mar 27, 2008 2:18 am
- Location: Vietnam
- Contact:
Yury ! you're right.
Because the "Time" data type will be converted from the "Real" data type like that:
Thanks so much.
Because the "Time" data type will be converted from the "Real" data type like that:
Code: Select all
EX: we have : 100000.0 "real" then
Time = 100000/1000=100/60=1
=> Time = 1minutes40second0minlisecond
Many thanks.Schtiel wrote:A variable with data type REAL is a fractional number which is stored as a 32-bit floating point number.
A variable with the data type TIME occupies one double word. The contents of the variable is interpreted as milliseconds and is stored as a 32-bit fixed point number.
Use conversion (and may be multiplication) functions.