Can we access a setpoint value for display in a widget
Re: Can we access a setpoint value for display in a widget
Probably not needed, but I've gotten used to doing it. It forces the variable to be a number. Since Javascript it a typeless language, sometimes it treats variables as text by default, so it concatenates variables instead of adding when you use +.
Re: Can we access a setpoint value for display in a widget
So for Mike's example above where it would not update on the tab where he didn't change anything, with a real brewing situation the temperature fluctuations would cause a refresh of the HMI gui?ECC wrote:The interface is setup to reduce network traffic, it attempts to only load files when it needs to.
ultemp.dat = This is the control file that is always read every refresh, on every BCS interface page.
If anything in ultemp.dat changes from one refresh to the next like state changes, process start/stop, (but not temp value or timer values), all of the following files are refreshed.
EDIT: I mean, the temperature fluctuations would NOT cause a refresh? So it won't update the HMI without a manual page refresh or a ultemp.dat change?
Re: Can we access a setpoint value for display in a widget
widgetObj.num is what is producing the NaN for me. I just changed it to:var tempSetPt = ultemps[ULTMP_SETP + widgetObj.num/1]/10;
Code: Select all
var tempnumber=0; //set to whichever output you want
var tempSetPt = ultemps[ULTMP_SETP + tempnumber]/10;
tempSetPt = (tempSetPt == -409.6)? "----" : tempSetPt ;
ctx.fillText(tempSetPt + "°F", widgetObj.xcoord,widgetObj.ycoord);
-
- Posts: 383
- Joined: Wed Feb 09, 2011 3:43 pm
- Bot?: No
- Location: Clearwater, FL
- Contact:
Re: Can we access a setpoint value for display in a widget
OK, this is working better and better!
stop all processes
start my P1 process 'MASH 60'
the HLT setpoint shows --- then goes to my 170 <---nice!
jump to S2 'MASH 154'
both setpoints show --- then go to correct value, no more HLT value in MLT space for a few seconds <--- VERY Nice!!!
open 'Edit Processes' in new tab in Firefox, select P1 and then S2, and change setpoint of OUT2 (Mash)
toggle to 1st tab, it shows new value fairly quickly... <--- PERFECT
BUT MASH TIMER STOPS!
(and not just the display, the actual timer!)
stop all processes
start my P1 process 'MASH 60'
the HLT setpoint shows --- then goes to my 170 <---nice!
jump to S2 'MASH 154'
both setpoints show --- then go to correct value, no more HLT value in MLT space for a few seconds <--- VERY Nice!!!
open 'Edit Processes' in new tab in Firefox, select P1 and then S2, and change setpoint of OUT2 (Mash)
toggle to 1st tab, it shows new value fairly quickly... <--- PERFECT
BUT MASH TIMER STOPS!
(and not just the display, the actual timer!)
Code: Select all
else if(widgetObj.typ==TYP_HLT_Out_Pump1_In)
{
ctx.beginPath();
if(widgetObj.act)
{
var tempSetPt = ultemps[ULTMP_SETP]/10;
tempSetPt = (tempSetPt == -409.6)? "----" : tempSetPt ;
ctx.lineWidth=6;
ctx.strokeStyle='#4080FF';
ctx.lineCap='round';
ctx.moveTo(75,175);
ctx.lineTo(75,205);
ctx.lineTo(105,205);
ctx.stroke();
ctx.font = 'italic 18px sans-serif';
ctx.fillStyle = '#00f';
ctx.fillText(tempSetPt + "°F", 75, 90);
}
ctx.closePath();
}
Re: Can we access a setpoint value for display in a widget
I could not duplicate this. When I went to a process that had a timer, I changed the setpoint in Edit Processes and when I went back to the other tab, the setpoint updated and the timer kept going.clearwaterbrewer wrote:BUT MASH TIMER STOPS!
(and not just the display, the actual timer!)
-
- Posts: 383
- Joined: Wed Feb 09, 2011 3:43 pm
- Bot?: No
- Location: Clearwater, FL
- Contact:
Re: Can we access a setpoint value for display in a widget
Current firmware version is
BCS-462 v3.4.4
Timer 0: 60 minute timer
Enable: yes
Count: Down
Continue from prev: no
Init value 1:00:00
BCS-462 v3.4.4
Timer 0: 60 minute timer
Enable: yes
Count: Down
Continue from prev: no
Init value 1:00:00
Re: Can we access a setpoint value for display in a widget
What are the exit conditions? Did changing the setpoint cause an exit to happen?
-
- Posts: 383
- Joined: Wed Feb 09, 2011 3:43 pm
- Bot?: No
- Location: Clearwater, FL
- Contact:
Re: Can we access a setpoint value for display in a widget
It did not exit the state, it has actually been in that same state since I verified the issue by carefully doing it a second time, probably 2 hours now, and the timer is stuck at 59:30
exit conditions, however are
WIN0 (manually go to next state, for testing and demo purposes)
60 minute timer <=0
exit conditions, however are
WIN0 (manually go to next state, for testing and demo purposes)
60 minute timer <=0
-
- Posts: 383
- Joined: Wed Feb 09, 2011 3:43 pm
- Bot?: No
- Location: Clearwater, FL
- Contact:
Re: Can we access a setpoint value for display in a widget
Must have been a Firefox issue, I tried to open a new browser to check something and if I changed the SP there, it started working.,.. I closed all Firefox windows and problem is gone...
Re: Can we access a setpoint value for display in a widget
Here's how I implemented getting an Auto-change process displayed on the Main Control page (another topic). I have 3 processes I use for brewing, so in the external.js I added a variable and a couple new widgets:JonW wrote:Here's a function I use for setting the active process. Call the function with the process # as the parameter.Baron Ken wrote:Note: I'm still hoping for a way to set the main page process being displayed programmatically (vs. using the dropdown box). I would imagine if it were implemented to be possible to set the displayed process, then you would also be able to read which process was being displayed.
function btn_cp(cp) {
// This allows direct selection of which process to display the details for.
// This forces the dropdown to the selected process and then calls the function to update the screen.
gid("psel").selectedIndex = cp ;
upd_cp() ;
};
You can get the current process from the dropdown object.
cp = parseInt(gid("psel").selectedIndex);
Code: Select all
...
var previousultemp = 0;
var goto_process1 = 48; // other one is goto_process2
newWidgetObj.desc = "goto Process1";
newWidgetObj.typ = goto_process1;
registerNewWidget(newWidgetObj);
...
//in the drawExtWidget section
...
else if(widgetObj.typ==goto_process1)
{
if (widgetObj.act) //does nothing unless widget activated.
//i.e the proper register turned on
{
if (gid("psel")) //checks to see if on Main Control page
{
if (ultemps[0]!=0) //meaning there is at least 1 process running
{
if (ultemps[0]!=previousultemp) //if the processes haven't changed, no need to do anything
{
gid("psel").selectedIndex = 1 ; //change the Process dropdown on the Main Control page
upd_cp() ; //cause an update
previousultemp = 2; //2 indicates Process 1 (only) is running.
//use 4 for the goto_process2 widget
}
}
else
{
previousultemp=0; //this 'resets' the widget if no processes are
//running, so if I start from the beginning again without
//refreshing the page, it still works fine
}
}
}
}
...
Note that I ONLY have 1 process running at a time, so the above works well for me. If you have multiple processes running at the same time, you could possibly modify the above to fit your setup (especially if the other processes were always on, for example). YMMV
Seems to work great. When it finishes the last state of Process 0, it ends process0 and spawns Process 1. When Process 1 starts on state 0, the register is enabled and the widget causes the selected process on the Main Control page to display Process 1. I also have it set up to change the display when going to Process 2 as well.