I'm using a CR6 in a remote station. I need to turn a small pump once every 2 days, at 11:00 am for 5 secondes. My program main scan rate is 250mSec and I also use a slow sequence of 5 sec.
Can I use this code in my slow sequence scan:
If IfTime (660,2880,Min) Then SW12 (1,1 )
Else SW12 (1,0)
EndIf
Thanks,
Uri
Iftime is safer to use in the main scan. There would be less chance of it being skipped.
Note that the code you wrote would only have the SW12 on for 1 scan every 2 days. If you skipped that one scan, it won't happen.
Thank you JDavis.
I've put the code in the slow sequence because I need the SW12 port to be on for only 5 secondes (1 scan, as you noted). If I move the code to the main scan the SW12 port will turn on for only 0.25 secondes.
The main scan MaxProcTime is about 100,000 microsecond (from Status Table). Do you have a resone to think that my program will skipp scans?
Thanks again,
Uri
If you don't have any skipped slow scans recorded in the Status table, you are probably fine.
The new TimeIsBetween instruction is very useful and worth consideration.