How to change color of selected button in WinCC SCADA

Поділитися
Вставка
  • Опубліковано 17 вер 2024
  • Join this channel to get access to perks:
    / @winccguru
    In this video I show you how to change the color of the selected navigation button in WinCC. This solution will work in any WinCC SCADA version 6 and higher.
    #siemens #siemensscada #winccstepbystep

КОМЕНТАРІ • 14

  • @Aeeeeelex
    @Aeeeeelex 5 місяців тому +1

    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.

    • @WinCCGURU
      @WinCCGURU  5 місяців тому +1

      awesome! thank you for your comments! Sounds like a good solution you have there!

    • @WinCCGURU
      @WinCCGURU  5 місяців тому +1

      I started this channel last may, so only about 9 months active. Hopefully the channel will grow :D

  • @sinanartemis6176
    @sinanartemis6176 5 місяців тому +1

    bob we miss you. where were you for a long time.) great job

    • @WinCCGURU
      @WinCCGURU  5 місяців тому +1

      working on the wincc database programming course :D

  • @markgaudy1752
    @markgaudy1752 5 місяців тому

    Much appreciated!

  • @ptsushil2010
    @ptsushil2010 5 місяців тому

    Exlnt...........

  • @markgaudy1752
    @markgaudy1752 5 місяців тому

    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?

    • @WinCCGURU
      @WinCCGURU  5 місяців тому

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

    • @markgaudy1752
      @markgaudy1752 5 місяців тому

      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

    • @WinCCGURU
      @WinCCGURU  5 місяців тому

      any chance its either a really slow PC or a heavy script load on that page? @@markgaudy1752

    • @WinCCGURU
      @WinCCGURU  5 місяців тому

      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

    • @markgaudy1752
      @markgaudy1752 5 місяців тому

      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