RobotStudio event

How can I use the programmable buttons to interact with UIListView fields

I have an application where I have a UIListView that acts as a job selection menu. I would like to use the programmable buttons to interact with this menu instead of using the touch screen. Ideally i would highlight the job to run and press the #1 button to run the program instead of the OK button on the touch screen. Alternatively if I press the #2 button I should return to the previous menu. 

The way my lists are set up currently when I run a job the default selection increments by 1 meaning I should be able to  simply press the #1 button repeatedly until the task is complete or press #2 to abort the process and start again.

Answers

  • DenisFR
    DenisFR ✭✭✭
    Hello,
    You can make a cross connection with your two DO set by buttons doBreak=(doBtn1 OR doBtn2).
    Then use it as \DOBreak in UIListView with \BreakFlag. After, check your errnum and test with your doBtnX values to do what you want.


    ☑️2024 - RobotStudio® User Group

  • so something like this. 

    nMenuOption:=UIListView(\Result:=btnresMainMenu\Header:="Please select an option and press OK",ListOptions\Buttons:=btnOKCancel\Icon:=iconInfo\DOBreak:=(so_STN1_OP010_Active OR so_STN1_OP020_Active)\BreakFlag:=ERR_TP_DOBREAK);

    When I try it in simulation it just refreshed the list and does not run the test to compare the nMenuOption result with the case selected. Do I need to add an if statement before the test or am I missing something.

    It also appears to no longer run when the OK button is pressed.
  • lemster68
    lemster68 ✭✭✭
    How did you set up your programmable keys?  I.E., Toggle, pulse, etc.?
    Lee Justice
  • zanic07
    zanic07
    edited August 30
    They are currently set up to toggle. That way the condition can be passed through to the cases. I figured a SObutton1(or whatever the official button output will be called)=0 command to turn off the input would be simple enough to implement.
  • lemster68
    lemster68 ✭✭✭
    Have you written an error handler into that routine?
    Lee Justice
  • No I do not have an error handler in this routine and have not written anything other than basic error handlers.
  • DenisFR
    DenisFR ✭✭✭
    Hello,
    Did you test with cross connection?
    Not writing \DOBreak:=(so_STN1_OP010_Active OR so_STN1_OP020_Active)


    ☑️2024 - RobotStudio® User Group

  • I though cross connections were used to join IO to IO. How would I go about creating a cross connection between the touchscreen buttons of UI list view and the programmable buttons on the controller 
  • Try writing the error handler.  In it, TEST for that error number and do what you need to do in that CASE.  Then, determine which is appropriate to continue your program.  I.e., RETRY, TRYNEXT and so on.
    Lee Justice
  • I will give that a shot.