Running a sequence once in 8 days


Gorkhali
 Share

Recommended Posts

Hi,

I want one of my sequence to run once in 8 days such that the rebooting of the computer in between should also not hamper the regular sequence operation. For eg., if my first date and time of the sequence run are 04/01/2019 3:00 am, the next run time of the sequence should be 04/09/2019 3:00 am. The next run time should still be the same even if the computer or the DaqFactory was turned off sometime in the middle.

What would be the best way?

FYI, it might be an easy fix but I'm pretty new to the DaqFactory.

Thanks!!

Link to comment
Share on other sites

I would probably create a Test channel with a History and Persist of 1 to store the next time the sequence should run, then have another sequence always running looking to see if that time has past.  So, the Test channel could be like "NextMySequenceTime", Device Type: "Test", D#: 0, I/O type D to A, Channel #0, Timing 0, History 1, Persist 1.

Then create a sequence marked auto-start, or that is started by your auto-start sequence:

if (isempty(nextMySequenceTime))
   nextMySequenceTime = systime()
endif

while(1)
   if (systime() < nextMySequenceTime)
      beginseq(mySequence)
      nextMySequenceTime = systime()
   endif
   delay(1)
endwhile

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share