Add Temp Gauge As A Widget In HMI Builder

Things to come.
User avatar
MaxOut
Posts: 26
Joined: Thu Apr 14, 2011 1:53 pm
Bot?: No

Add Temp Gauge As A Widget In HMI Builder

Post by MaxOut »

I would like to overlay the temp gauges onto my brewery kettles (picture) and do away with the large gauges above. This would make it easier to look at the kettle diagram with the temp gauge on it for a quick reference. Custom pump, burner, RIM, fermentor widgets would be nice as well. Anybody hove some they would like to share? Would also be nice to edit the background picture in each process to represent that process?
kapavita
Posts: 20
Joined: Tue Feb 09, 2010 11:22 am
Bot?: No
Location: Palo Alto, CA

Re: Add Temp Gauge As A Widget In HMI Builder

Post by kapavita »

I hope this code helps you.
To use it, You will need to adjust the following (based on your setup):
TYP_TEMP_GAUGE (match your numbering scheme)
HLT_temp (ultemps array position for your HLT temperature)
MLT_temp (ultemps array position for your MLT temperature)
BK_temp (ultemps array position for your Boil Kettle temperature)
RIMS_temp (ultemps array position for your RIMS temperature)


var TYP_TEMP_GAUGE = 51;
newWidgetObj.desc = "Temperature Gauge";
newWidgetObj.typ = TYP_TEMP_GAUGE;
registerNewWidget(newWidgetObj);

drawExtWidget = function (widgetObj){
// variable declaration
// ultemps array positions for temps
var HLT_temp = 3;
var MLT_temp = 4;
var BK_temp = 5;
var RIMS_temp = 6;


// section to check for widget to use
...
else if (widgetObj.typ == TYP_TEMP_GAUGE){
//get widgetObj.txt by either register, output or process... change the names accordingly
if (widgetObj.txt == "HLT") {temp_pos = HLT_temp;}
else if (widgetObj.txt == "MLT") {temp_pos = MLT_temp;}
else if (widgetObj.txt == "BOIL") {temp_pos = BK_temp;}
else if (widgetObj.txt == "RIMS") {temp_pos = RIMS_temp;}
else {temp_pos = 0;}
if (temp_pos > 0){
ctx.fillStyle = "#00FFFF";
ctx.beginPath();
ctx.fillRect(widgetObj.xcoord,widgetObj.ycoord, 32,14);
ctx.font="normal 10px sans-serif";
ctx.fillStyle="black";
ctx.fillText(ultemps[temp_pos]/10 + "F",widgetObj.xcoord+16,widgetObj.ycoord+10);
ctx.closePath();
}
}
}
User avatar
MaxOut
Posts: 26
Joined: Thu Apr 14, 2011 1:53 pm
Bot?: No

Re: Add Temp Gauge As A Widget In HMI Builder

Post by MaxOut »

Thanks for the quick response, though I believe it is over my head. I have not tampered with the code in my BCS yet and need to become a little more familiar before I will feel comfortable doing so. I was referring to adding a temp gauge in the drop down options and be able to drag it where you need it in the picture. Like the current colored circles. Furthermore add the option of removing the existing gauges to make room for more detail in the picture area and making the rest of the features fit better on the page. Not sure that makes any sense or not? Ultimately I would like to custom design the visual interface to remove items I do not use and make one i do use larger and easier to understand.

Ideas -
A different background picture for each process and process state illustrating process dynamics like liquid flow, pump operation and burner heat.

More widgets that are associated with brewing like pumps, burners, RIMS tube, HERMS coil etc.

Add blue circles for cooling states

I'm just rambling but on my screen I have to scroll to see the flow charts and gauges and would like to see more of what I use and get rid of the things I do not use.

Here is a picture I am using for my back ground that is an example of my brewery. I want to show the temp gauges on the front of the kettles and remove them from above and also on fermenters.
Attachments
MaxOut Brewstation.gif
MaxOut Brewstation.gif (4.51 KiB) Viewed 15318 times
kapavita
Posts: 20
Joined: Tue Feb 09, 2010 11:22 am
Bot?: No
Location: Palo Alto, CA

Re: Add Temp Gauge As A Widget In HMI Builder

Post by kapavita »

I believe it has been mentioned in other threads that some of the changes/features that you listed
are considered by ECC.

I am afraid that you will need to do some programming if you want to implement them in the short term.
User avatar
Baron Ken
Posts: 99
Joined: Fri Jan 15, 2010 2:50 pm
Bot?: No

Re: Add Temp Gauge As A Widget In HMI Builder

Post by Baron Ken »

Here's a quick pic of what I've got going. Note that I have the temp0 value hard-coded at 150 for testing, but the setpoint indicator on the bezel is determined from ultemps.
I also have a widget that shows the setpoint (in text, placed on the keg in picture) that I will probably remove now that I have the setpoint indicator on the bezel. I also need to see if I can get a custom index.html page working so I can remove the gauge section above the HMI. ;) I might also try to add the ability to show the setpoint on the bezel in the gauge section for those who don't want to add a gauge to the HMI.
Image
Last edited by Baron Ken on Thu Nov 12, 2015 8:50 am, edited 3 times in total.
User avatar
Baron Ken
Posts: 99
Joined: Fri Jan 15, 2010 2:50 pm
Bot?: No

Re: Add Temp Gauge As A Widget In HMI Builder

Post by Baron Ken »

Baron Ken wrote:I might also try to add the ability to show the setpoint on the bezel in the gauge section for those who don't want to add a gauge to the HMI.
I can get the indicator to show up briefly, but the refresh code for the page (which is in the BCS box and I can't modify (at this time)) keeps refreshing the bezel, which overlays the indicator, effectively removing it.

EDIT: nevermind, I just overloaded the function that draws the gauges and added the draw setpoint function call after the draw bezel call. :D Working great now.
User avatar
Baron Ken
Posts: 99
Joined: Fri Jan 15, 2010 2:50 pm
Bot?: No

Re: Add Temp Gauge As A Widget In HMI Builder

Post by Baron Ken »

Here's a PID display that shows actual temp (PV) and setpoint (SV). It is scalable in size (though the scaling value has to be set in the external.js script).

In the pics there is no temp input (i.e 0.0 F for PV) and I have a process going that enables a setpoint of 156.0F (the SV value). The °F also gets its value from the system.
Also, the yellow setpoint widget is still out there because I haven't removed it, heh.

Yes, I'm having fun messing around to see what all I can add. :P

Small version.
Image

Scaled up a little.
Image
User avatar
Baron Ken
Posts: 99
Joined: Fri Jan 15, 2010 2:50 pm
Bot?: No

Re: Add Temp Gauge As A Widget In HMI Builder

Post by Baron Ken »

Baron Ken wrote:... I also need to see if I can get a custom index.html page working so I can remove the gauge section above the HMI. ;)
This was simpler than I made it out to be. I just overloaded the toggle_gauge function to add a 5th state, i.e. no display. :)
User avatar
ECC
Posts: 676
Joined: Fri Sep 12, 2008 12:29 pm
Bot?: No
Contact:

Re: Add Temp Gauge As A Widget In HMI Builder

Post by ECC »

Nice!
User avatar
Baron Ken
Posts: 99
Joined: Fri Jan 15, 2010 2:50 pm
Bot?: No

Re: Add Temp Gauge As A Widget In HMI Builder

Post by Baron Ken »

My latest interface. I expanded the background image canvas size to allow including the PIDs, but I probably won't keep the PIDs on there, especially since I only use a setpoint for the brew kettle and the dial gauges have the setpoint indicators on them too.

Custom changes:
  • 'Hose' widgets that appear when I want (by setting registers in states).
  • Ability to minimize gauge section.
  • Only when gauge section is minimized do the HMI gauges/PIDs show up in HMI section (may change this behavior).
  • Gauges in gauge section have setpoint indicators.
  • Gauges (with setpoint indicators) in HMI section (scalable by changing setting in external.js).
  • PIDs in HMI section (scalable by changing setting in external.js).
  • Automatic changing of displayed process when the next process starts (this is pretty specific to my setup in that I have a linear progression of processes and only have 1 process active at a time...customizable with registers, but YMMV).
I have verified the above works well on my iPad.

Next up is to do a custom index.html page so I can lay out the other controls/displays more to my liking.

EDIT: I just noticed the alarm is on, LOL. No sound from firefox (I was testing to see if it worked and forgot to disable the alarm after).

Click image for larger version:
Image
Post Reply