Forum

Brewery Code  

Page 2 / 2 Prev
  RSS

(@oakbarn)
Trusted Member
Joined: 3 months ago
Posts: 55
January 31, 2019 2:53 am  

I see in your sample code that you insure devices are off.  Is there a reason?  Are devices all not enabled when you close a brew day.  Maybe a good idea at the end of a script to

State = Off

Enable = False

on all devices.   

 

[prep_fill]
Status = "Prep Fill"
restart "Step"
restart "Master"
"Valve 1" State = on
"Valve 2" State = off
"Valve 3" State = off

This post was modified 3 weeks ago 2 times by oakbarn

ReplyQuote
(@pbruno3)
Estimable Member Admin
Joined: 2 years ago
Posts: 186
January 31, 2019 4:20 am  

Device states and values are either kept through shutdown or disabled depending on the shutdown confirmation box button you select.


ReplyQuote
(@oakbarn)
Trusted Member
Joined: 3 months ago
Posts: 55
February 11, 2019 2:14 am  

in your sample code you have the following:

"Water Input" Enabled = false
"Boil Temp" Enabled = false
"Chill Temp" Enabled = false
"Chill Flush" Enabled = false
"Panel Alarm" Enabled = true

 

What type of devices are these.   I figured out that something like "RIMS Heat Duty" was a Digital i/o as Duty Cycle Control.   The ones above I am not sure about.

 

"Water Input" makes me want to say the is a Device Type = Variable.

 

Likewise, "Boil Temp" could be a Variable or a Probe.

Same could apply to "Chill Temp"

 

I have no idea what "Chill Flush" would be.

 

The "Panel Alarm"?


ReplyQuote
(@pbruno3)
Estimable Member Admin
Joined: 2 years ago
Posts: 186
February 11, 2019 5:53 am  

These are all device elements. Note the names shouldn’t really matter to you as they apply to this particular system - you can pick whatever names you want for your device elements. 

“Water Input” is a Digital Output device. You can enable or disable these. It could not be a variable because you cannot enable or disable those. 

I suggest you spend some time with the manual to see what elements have which possible properties. Not trying to be snarky, but I think you’ll understand BC a little better from the documentation at first before tacking example scripts. 


oakbarn liked
ReplyQuote
(@oakbarn)
Trusted Member
Joined: 3 months ago
Posts: 55
February 11, 2019 10:23 pm  

I have read the user manual at least 10 times.   I quite understand what a Device Element is.  I understand the “name” and most other attributes of a Device Element.   I have placed Device Elements like a Digital Output and lit an LED on my Tester PCB (just a bunch of LEDs) manually.   I have written very simple scripts to change the state on Element.  

 

  • I was was not asking about the “name” of the Element, but its type. 
  • I ask about variable because there is a Device Element type Variable.

you might not have recognized the “name” that I was asking about but they are from your sample code.   I had deduced that they  were Device Elements because your code used the “enable” attribute which is NOT and attribute of a declared variable. 

 

What at I am trying to do is “recreate” your code with your workspace.   If I copy your code and add it to a script, it will not work if it does not find the required Element.   In fact, I was using the Error code to add forgotten Elements to the workspace.

 

it would make a difference as to the Device Type if your code was looking for. a Digital Input (like “Water Input”) and I created a Device of that name as. Digital Output.    I was assuming that you could use a Device Element type Variable to get an input into the code.   

 

So so having the Device Element Type is crucial in building a model from your code.   With my test PCB I have switches, LEDs as Digital Outs, One Wire Temp Probes and even a small cup heater attached to an SSR.   I could likely duplicate a model brewery based on your code (except Analog Inputs but I could do a work around those)

 

That was why I ask the question.  

 

 

 

 

 


ReplyQuote
(@oakbarn)
Trusted Member
Joined: 3 months ago
Posts: 55
February 23, 2019 2:34 am  

Has anyone created a Notepad++ plugin for BruControl scripts?


ReplyQuote
Page 2 / 2 Prev
Share: