I am a Codesys newbie. How do you subtract 5 hours from a DT variable? I searched Google, but could not find anything relating to this procedure.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2013-03-09
Originally created by: 99bobster99
I think I figured it out. Please let me know if there is an easier way to do this. I converted my DT variable to a DWORD, then subtracted 18000 from it. This seems to work for me, but kind of ugly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Originally created by: 99bobster99
Hello,
I am a Codesys newbie. How do you subtract 5 hours from a DT variable? I searched Google, but could not find anything relating to this procedure.
Originally created by: 99bobster99
I think I figured it out. Please let me know if there is an easier way to do this. I converted my DT variable to a DWORD, then subtracted 18000 from it. This seems to work for me, but kind of ugly.
make a var of same type like DT
fill it with t#5h
zonetime:DTIME:=t#5h;
then simple subtract this.
there is one drawback, when system overflows the time is not correct for 5 hours.
see also w www.oscat.de w (it is english)
Originally created by: 99bobster99
Thank you Shooter, I will give that a try!