Forum

Notifications
Clear all

Brewery Code

38 Posts
9 Users
5 Likes
32.3 K Views
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
 

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 5 years ago 2 times by oakbarn

   
ReplyQuote
(@pbruno3)
Reputable Member Admin
Joined: 7 years ago
Posts: 343
Topic starter  

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: 5 years ago
Posts: 64
 

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)
Reputable Member Admin
Joined: 7 years ago
Posts: 343
Topic starter  

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 reacted
ReplyQuote
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
 

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: 5 years ago
Posts: 64
 

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


   
ReplyQuote
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
 

Is i2c enabled on BruControl? (Pins 20 & 21)  I have some old i2c things hanging around that would be nice to use (Temp gauges).  If not: Futureware?


   
ReplyQuote
(@pbruno3)
Reputable Member Admin
Joined: 7 years ago
Posts: 343
Topic starter  

2 and 4 line LCDs are supported. We will enable general communication with other devices in the future. 


   
ReplyQuote
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
 

I am specifically talking about those 8 digit displays that BrewTroller used.


   
ReplyQuote
(@pbruno3)
Reputable Member Admin
Joined: 7 years ago
Posts: 343
Topic starter  

No, not yet. We will be creating a “Communication Element” where you can pass information through different connections. 

That said, and while we want to give our users flexibility, I have to mention that the intent of BC is to eliminate dead-end and dedicated hardware. Buttons, switches, PIDs, etc. The digital control panel gives the most freedom to customize the user interface as you like. For example, you can create these style PID displays on your workspace. 


   
ReplyQuote
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
 

Yes you can use virtual items.  But I also like Physical Gauges near my vessels.  That is somewhat why I like a Physical Button vs a Virtual one.    I have 5 physical buttons I can press on my Brewery wall that do things.  For example, I have my strike water ready based on Temperature.  I add my grain.  I want to start my modified HERMS circulation.  I could use a Virtual Switch or Button, but my hands are dirty or I am wearing heat proof gloves.  I can press a Physical Button.  It is near my brewery while the screen may be across the room.   I understand the concept, but having Physical Devices in addition work very well for me.

 

 


   
ReplyQuote
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
 

If you change the Name Property of an Element, the change is not refreshed on the screen

 

"Timer 1" Name = "Hops"

restart "Hops"

//this works fine, but the "name" on the screen is "Timer 1"

// ....do other things with the Hops Timer until I am done, then

"Hops" Name = "Timer 1"

 

 

I was thinking that I could change the Name of a Timer to reflect what the timer was counting or doing.   

I know I could just add another Timer Element but I was trying to un-complicate the Workspace where I did not have 8 Timers on the Workspace. I know you can use the Visible Property but when build a Workspace it gets to be "Who's on first" becuase of all the Elements on the screen.

The name is reflected if you close BruControl Application then reopen    Refresh (CTRL_F5 or CTRL _SHIFT_ R) does n0t refresh either.

It is refreshed if changed manually using the "Circle I"  Device Dialog. 

A nicer feature would be able to have a new Property "Text Displayed" for Elements  that is only a Screen Display where the Name is now.   Changing the new "Text Displayed"  Property would change the "Timer 1" displayed to "Hops", but the Name Property would remain "Timer 1".     That way, you could always use "Timer 1" in the scripts.

 

 

 


   
ReplyQuote
(@pbruno3)
Reputable Member Admin
Joined: 7 years ago
Posts: 343
Topic starter  

You should not change the Name of an Element. I realize by your post it will accept it in scripting... but this should be a read-only. 


   
ReplyQuote
(@diebeerery)
Eminent Member
Joined: 6 years ago
Posts: 25
 

You can just creat multiple timers and to unclutter use the “visibility” to view/hide them when needed.  


   
pbruno3 reacted
ReplyQuote
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
 

As I said in my post, it is not the "live" clutter but the "building clutter".    Minor issue but there are many ways to skin a cat.  

 

The issue is that you can only have one instance of a Port and Type.

On a Mega 2560

If I select Port 39 and Type Digital Out Named Blue Pump, I cannot create a Port 39 Type Digital Out on a different Workspace, regardless of a unique name.  Once a Port Port Type combination is used, it is fixed, and only available on the Workspace where it was created.

For that reason, it becomes necessary to build a brew day generally on a Single Workspace with all the Elements you need.

 

By that I mean  like trying to create a Workspace for each Major step in a Brew Day:

Strike

Mash

Sparge

Boil

Hops

Cool

 

 

Since Strike, Mash, and Sparge all use my "Blue Pump", they must be on the same Workspace.  

There are some widgets that I use for almost every major step.  I am still planning how my Workspaces will look and what I can divide.  For example, I will have a Workspace named "Water" where I control valves for both my tap water and HLT flow.    Although I would not be able to see the flow of the HLT during a Strike Step (unless I tabbed to Workspace Water), I do not care (I have a Voltmeter and LED Pushbutton on a Panel that shows it is flowing).  That unclutters a lot.  I will likely use the Visibility property to do what I need on other Workspaces.

Part of the issue is from the BCS world where there are separate Processes.   They are very limited as the only have 8 with eight steps each.  I guess that there are unlimited steps with BruControl.

 

I discovered this as I write some simple script to see what it does.    If the name change was refreshed, you reuse a Timer or Alarm.  I was not thinking of re nameing any device Elements.

 

 

 

 


   
ReplyQuote
Page 2 / 3
Share: