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
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"?
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.
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.