Question On Sequencing


Recommended Posts



I am a beginner, and my question might have a very simple answer. 


I am trying to set up a sequence such that a part of an instrument (controlled by LabJack U12) would turn on, and then after a set period (e.g. 30 minutes), turn off, and then repeat this for a prespecified interval of time (e.g. 48 hours). In short, over a 48 hour interval, I want the instrument to turn on after every 30 minutes, stay on for 2-3 minutes, and then turn off again. 


Is it possible to do with DAQfactory? 


How do I begin? Should I just use the while (1)> set> delay> endwhile steps? 



Link to comment
Share on other sites

Sure, just use some basic script.  Something like:


private onTime = 30 * 60 // 30 minutes * 60 seconds per minute

private offTime = 3 * 60

private totalTime = 48*60*60

private startTime = systime() // get currentTime

while (systime() < startTime + totalTime)

   output = 1 // turn on


   output = 0




Note that I use wait().  You could use delay() too, but you'll get some propagation (i.e. the actual loop time will be, in my case 3 minutes + 30 minutes + a few milliseconds for the LabJack calls and script execution).  Using wait() eliminates this, though can cause problems in some instances, thus the warning you get.  Not an issue here.

Link to comment
Share on other sites

Thank you very much. I am using two LabJacks and they typically run at the same time. I have two different sets of outputs (for both sets of instruments). How can I include channel information (i.e. specify which channel this sequence should work on)? 

Link to comment
Share on other sites

  • 2 weeks later...


This topic is now archived and is closed to further replies.