Forum

Passing variables across scripts  

  RSS

(@vince)
Active Member
Joined: 3 months ago
Posts: 8
December 17, 2018 6:52 am  

Is it possible to use the same variable in more than 1 script?

 


ReplyQuote
(@vince)
Active Member
Joined: 3 months ago
Posts: 8
December 17, 2018 7:33 pm  

I suppose if the answer is no, the question I'll be asked is why I want to do that... Here's an example, maybe someone can suggest strategies to deal with this:

I wanted to have a separate script that continuously monitors the volume in my BK and disables the heating element when the volume is lower than a minimum value. This has to be a separate script to ensures it is working all the time. I would prefer not to hard code this minimum value and have it as a variable/parameter that I can set.

I also want this value in my main brew script, because I want to start heating the boil during sparge as soon as this minimum volume is set. Again, it could be hard coded... but it really should be the same value in both scripts... it would be nice to have a single variable that can be used by both scripts.

Hope this helps.


ReplyQuote
(@pbruno3)
Estimable Member Admin
Joined: 2 years ago
Posts: 186
December 19, 2018 2:18 pm  

Correct - v1.0 cannot currently pass variables across scripts. You can combine scripts into one, and allow multiple loops to run in "real time" to have access to the variables, or sit tight for v1.1, which we will release in a beta to licensed users soon. v1.1 will have global variables.


ReplyQuote
(@vince)
Active Member
Joined: 3 months ago
Posts: 8
December 19, 2018 4:08 pm  

I can see how one could combine loops into one (but that seems like a lot of work). I don't understand how one would allow multiple loops to run at the same time in a single script...  Can you show me an example?


ReplyQuote
(@pbruno3)
Estimable Member Admin
Joined: 2 years ago
Posts: 186
December 19, 2018 4:45 pm  

Simply stated, don’t use ‘wait’ statements. Use ‘if’ checks so that continuous evaluations occur. That make sense?


ReplyQuote
(@vince)
Active Member
Joined: 3 months ago
Posts: 8
December 19, 2018 5:17 pm  

I'm not following...


ReplyQuote
Share: