Is it possible to write to a variable of type TIME without converting.
If I use a rectangle with %d, it will display 1000 (meaning T#1S).
But if I try to write to it, it does not work.
I would like to be able to write 2000 and then my variable would be set to T#2S.
I know I can do it by converting in the program but I was thinking that if it can read correctly it would be possible to write also.
Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yannickasselin1 hat geschrieben:
Is this possible or not?
Very old post but yes, it's possible. I personnally use REAL type variables to set time values. For example, enter your time value in seconds in real type (%.1f) on HMI. Lets say 1.5s. Then on the program side you have to make conversion to type TIME:
tTime := REAL_TO_TIME ( fTime * 1000). Code turns given time value (1.5s) in real type to time format t#1500ms...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Is it possible to write to a variable of type TIME without converting.
If I use a rectangle with %d, it will display 1000 (meaning T#1S).
But if I try to write to it, it does not work.
I would like to be able to write 2000 and then my variable would be set to T#2S.
I know I can do it by converting in the program but I was thinking that if it can read correctly it would be possible to write also.
Thank you.
Is this possible or not?
Originally created by: scott_cunningham
I believe you have to enter T#2000ms or T#2s. Just like you have it in the code. I always just convert a number to time in the code.
Very old post but yes, it's possible. I personnally use REAL type variables to set time values. For example, enter your time value in seconds in real type (%.1f) on HMI. Lets say 1.5s. Then on the program side you have to make conversion to type TIME:
tTime := REAL_TO_TIME ( fTime * 1000). Code turns given time value (1.5s) in real type to time format t#1500ms...
Hi,
attached an example:
BR
Edwin
testinvisu.project [66.23 KiB]