Forum

Brewery Code  

Page 3 / 3
  RSS

(@natebrews)
Active Member
Joined: 7 months ago
Posts: 12
March 2, 2019 9:03 pm  

If you want to control the element (pump) couldn't you make a button on the other workspace and have a script in the background that looks for that button to be pushed and changes the state of the pump control on the other worksheet?

I had been planning to do just that.

 

I just tried it with my boil kettle purge gas valve (BK_Gas), and put a control button "Change_BKgas" on my control box status workspace, then have the script below watching it to reflect the change.

[bloop1]
wait "Change_BKgas" State == true

if "BK_Gas" State == false
"BK_Gas" State = true
else
"BK_Gas" State = false
endif
//sleep 1000
"Change_BKgas" State = false
goto bloop1
This post was modified 6 months ago by natebrews

ReplyQuote
(@pbruno3)
Estimable Member Admin
Joined: 2 years ago
Posts: 240
March 3, 2019 7:24 pm  

Good idea. You should have some sleep time in there to keep the cpu from running flat out. 


ReplyQuote
(@natebrews)
Active Member
Joined: 7 months ago
Posts: 12
March 3, 2019 7:37 pm  

Do you need the sleep time in it if you are using a wait statement?  Does it work like a poll or an interrupt (clearly from my perspective it is an interrupt, but inside the guts I'm guessing it is more of a poll thing based on your comment)?  

 

I just checked my system and with that script running the CPU usage is 0.7%.

This post was modified 6 months ago by natebrews

ReplyQuote
(@pbruno3)
Estimable Member Admin
Joined: 2 years ago
Posts: 240
March 6, 2019 2:49 am  

No, you don't need a sleep if there is some buffer time sitting on a wait.


ReplyQuote
Page 3 / 3
Share: