RobotStudio event

change Bar Backcolor

I am playing around with ScreenMaker and have come across something that I cannot figure out.  IF you have a bar control and it is getting its value from a RAPID data num variable, how can you change the color of the Bar when it reaches like 95 out of 100.  Like from green when its 0 to 75 and then yellow from 76 to 95 and red when its 96 to 100.

Comments

  • Hi David,


    The bar control does not support multiple states to allow this type of runtime behavior. But there are ways you could accomplish this, but any of this will require .NET programming:

    - You can create a .NET method that could change the barcolor property based on the value

    - You can save the ScreenMaker project as a VS 2008 project, and continue the development there.

    Hope this helps.


    BR

    Carlos Martinez
    ABB
  • How do you save the ScreenMaker project as a VS 2008 project?  When I am in the ScreenMaker tab and I right click on my project, there is a option to Save project as a Flexpendant app, but I don't see anything for saving as VS project.  By the way the Save as Flexpendant project is greyout for some reason,  do you know why?


  • Hi David,

    This might be because not all the required software is installed in your PC to allows that. I was thinking on another way accomplish this.Are you flexible of changing the UI you have in mind, but still provide "similar" message to the operator. This is a suggestion:

    - The bar control only shows the bar in one color

    - You put a picturebox in the back. This is the control that will change its background based on a RAPID data variable. The reason this control can do that, is that it supports "allowmultiplestates", in which you can define that the backcolor will change based on an specific value

    - Now, you will need to have in RAPID a variable for this (e.g. RAPID variable called backColorType); in RAPID you will define the range of the value, and an integer related to that range. Kind of a table:

    - if value < 75 THEN  backColorType = 0 <----> Green Color assigned to Picture Box

    - if value < 96 THEN  backColorType = 0 <----> Orange Color assigned to Picture Box

    - if value < 96 THEN  backColorType = 0 <----> Red Color assigned to Picture Box

    You can play with this inside the ScreenMaker designer to check if this user feedback is OK for your screen.

    BR

    Carlos Martinez
    ABB