For many reasons I always make an internal tag @screennumber type INT. When a page is loaded, an INT value is written to this tag. Main pages 1000, 2000, 3000, etc. Sub pages x100, x200, x300, etc. Sub sub pages xx10, xx20, xx30, etc and so on. In the dynamic properties of the button I link the background color to this internal tag. This principle I also apply to (TIA Portal) HMI panels. Maybe less convenient, but it works the best for me. I still appreciate your great content Bob. Regarding WinCC, you're the best on UA-cam. Too less appreciation in my opinion. With more or les 2K subscribers it's a shame that too less people hit the like button. Keep up the good work! All the best from The Netherlands.
I noticed that I had a small lag between when I press the navigation button and the color updating for that button (somewhere between 1 to 2 seconds). Is there something I can do to mitigate this?
Mark -- are you using the same method I do here, i.e. direct connect and text change event? If so, I am surprised there is a lag. If so, you could move the script to the picture name change event on the picture window -- you would need to add a line to set the textbox text as well...
I moved the vbs script to the Picture Window >> Picture Name attribute and I am observing the same lag. I also tried vbBlue & vbBlack instead of my RGB(182,182,182) and RGB(73,73,73) and I had the same issue. My Main screen update cycle is 250ms. I am not sure if this is relavent. Any thoughts? @@WinCCGURU
you could try to move the script to the button's SetFocus event, which should turn the color of the button immediately, and then reset the previous button. but then you would have a script on every button. @@markgaudy1752
bob we miss you. where were you for a long time.) great job
working on the wincc database programming course :D
For many reasons I always make an internal tag @screennumber type INT. When a page is loaded, an INT value is written to this tag. Main pages 1000, 2000, 3000, etc. Sub pages x100, x200, x300, etc. Sub sub pages xx10, xx20, xx30, etc and so on. In the dynamic properties of the button I link the background color to this internal tag. This principle I also apply to (TIA Portal) HMI panels. Maybe less convenient, but it works the best for me.
I still appreciate your great content Bob. Regarding WinCC, you're the best on UA-cam. Too less appreciation in my opinion. With more or les 2K subscribers it's a shame that too less people hit the like button. Keep up the good work!
All the best from The Netherlands.
awesome! thank you for your comments! Sounds like a good solution you have there!
I started this channel last may, so only about 9 months active. Hopefully the channel will grow :D
Much appreciated!
Glad to help!
Exlnt...........
I noticed that I had a small lag between when I press the navigation button and the color updating for that button (somewhere between 1 to 2 seconds). Is there something I can do to mitigate this?
Mark -- are you using the same method I do here, i.e. direct connect and text change event? If so, I am surprised there is a lag. If so, you could move the script to the picture name change event on the picture window -- you would need to add a line to set the textbox text as well...
I moved the vbs script to the Picture Window >> Picture Name attribute and I am observing the same lag.
I also tried vbBlue & vbBlack instead of my RGB(182,182,182) and RGB(73,73,73) and I had the same issue.
My Main screen update cycle is 250ms. I am not sure if this is relavent. Any thoughts? @@WinCCGURU
any chance its either a really slow PC or a heavy script load on that page? @@markgaudy1752
you could try to move the script to the button's SetFocus event, which should turn the color of the button immediately, and then reset the previous button. but then you would have a script on every button.
@@markgaudy1752
Yes that works! Lag fixed!
Button #1 Events >> Focus >> Focus Change VBS-Action
'Highlight selected nav Button when text changes.
If ActiveScreenItem.ObjectName = "btnNav1" Then
ScreenItems("btnNav1").BackColor = RGB(182,182,182)
ScreenItems("btnNav2").BackColor = RGB(73,73,73)
ScreenItems("btnNav3").BackColor = RGB(73,73,73)
ScreenItems("btnNav4").BackColor = RGB(73,73,73)
ScreenItems("btnNav5").BackColor = RGB(73,73,73)
ScreenItems("btnNav6").BackColor = RGB(73,73,73)
ScreenItems("btnNav7").BackColor = RGB(73,73,73)
End If
Button #2 Events >> Focus >> Focus Change VBS-Action
'Highlight selected nav Button when text changes.
If ActiveScreenItem.ObjectName = "btnNav2" Then
ScreenItems("btnNav1").BackColor = RGB(73,73,73)
ScreenItems("btnNav2").BackColor = RGB(182,182,182)
ScreenItems("btnNav3").BackColor = RGB(73,73,73)
ScreenItems("btnNav4").BackColor = RGB(73,73,73)
ScreenItems("btnNav5").BackColor = RGB(73,73,73)
ScreenItems("btnNav6").BackColor = RGB(73,73,73)
ScreenItems("btnNav7").BackColor = RGB(73,73,73)
End If
.
.
.
etc
@@WinCCGURU