RobotStudio event

Cannot bind to VAR

From my reading of the documentation I think that it should be possible to bind to a VAR so long as it is not shared between tasks.

When attempting to bind the 'Enabled' property of a button to a VAR bool which is exclusive to my foreground task the VAR is not visible in the drop-down list, even after refreshing.

If I change the declaration to PERS, it becomes visible so I can bind to it. I can then change the declaration back to VAR and the binding still works although the VAR is again not visible in the drop-down list.

Any comments appreciated.

Kevin



Comments

  • Hi Kevin,
     

    The runtime limitation is that VARs does not propagate a change event, so the control in the Screen will never be updated. The only type of data which support change event is PERS. This is why ScreenMaker filters the data.

     

    But, is the UI updating corretly when it is bind to a VAR for you?

     

    Thanks
    Carlos Martinez
    ABB
  • Kevin
    Kevin ✭✭

    Hi Carlos,

    I have just re-tested what I did in a previous experiment passing three different values from the ScreenMaker project to the Rapid program:

    My experiment has three buttons and three application num variables set to the values 1,2,3.

    My Rapid variable was declared as PERS, then the MouseUp events for the three buttons were set up to copy the three application variables to the Rapid variable.

    I then changed the declaration of the Rapid Variable to VAR and built and deployed the ScreenMaker project.

    When my Rapid program displays the screen using UIShow the three different values are returned depending on which button is pressed.

    Regards,

    Kevin

    Kevin2009-04-21 17:38:06
  • HI ...Every time the screen is activated, the Controls will read the latest values in the controller. The risk is that if while your UI is opened, the RAPID data changes its value. In this case, the UI will not get a notification of this change. This is why ScreenMaker is not showing RAPID VAR since these does not notify changes.

    VAR data can be read and write, but it will not notify you for updates.
     

    Example, you link a UI to the value of a RAPID VAR. While your UI is opened, run a RAPID program that modifies the RAPID data. In this case, the UI will not show the real value.

     

    Are you only trying to write and read RAPID data as an actions?

     

    BR

     

     

     

     

     

     

     
    Carlos Martinez
    ABB
  • Kevin
    Kevin ✭✭
    Hi Carlos,

    My real project would have a mix of live changing data and data changed by actions. I can use PERS instead of VAR variables with no problem, but will have to be sure to initialise them.

    Thanks for the clarification.

    Kevin