Jeyjey Posted August 24, 2020 Share Posted August 24, 2020 So I have 3 digital outputs set on DF linked to Labjack (Pump, Solenoid 1 and Solenoid 2) Initially the pump is activated with a button on the DF page. If solenoid 1 and 2 are not active for a minute (just an example), I want to be able to turn off the pump with a timer (1 minute). If either of the solenoids turn on while the pump is off, I would like the pump to turn on again. Do you have a solution to this scenario? Any assistance is appreciated. See below the section of my rough script: if ((Up == 0) && (Down == 0)) //if solenoid is OFF for more than a minute, turn off pump starttime = systime() tim = systime() - starttime if (tim >= 60) //1800 seconds = 30mins * 60sec //60 seconds = 1min x 60sec APump = 0 //turn OFF pump command endif else tim = 0 starttime = 0 APump = 1 endif endif Quote Link to comment Share on other sites More sharing options...
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.