# How to get the current teach pendant tab?

**URL:** https://forum.universal-robots.com/t/how-to-get-the-current-teach-pendant-tab/26097
**Category:** Technical Questions
**Created:** [January 11, 2023, 9:37am UTC](https://forum.universal-robots.com/t/how-to-get-the-current-teach-pendant-tab/26097 "2023-01-11T09:37:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![boris.tityukov](https://avatars.discourse-cdn.com/v4/letter/b/b5ac83/32.png) [@boris.tityukov](https://forum.universal-robots.com/u/boris.tityukov)
#### Post date: [January 11, 2023, 9:37am UTC](https://forum.universal-robots.com/t/how-to-get-the-current-teach-pendant-tab/26097/1 "2023-01-11T09:37:54Z")

</div>

Hello,  
I have a problem when trying to prompt the operator to teach a position.

Here is the code:  
apiProvider.getUserInterfaceAPI().getUserInteraction().getUserDefinedRobotPosition(  
new RobotPositionCallback2() {

```
@Override
public void onOk(PositionParameters parameters) {
	System.out.println(parameters.getPose());
}

```

});

If the teach pendant is on the “Run” tab, this doesn’t work and instead writes an error in the console like this:

11:19:06.432 ERROR - Could not switch card. Unable to find card: com.ur.move.MoveTab. Currently in card: com.ur.polyscope.logging.internal.TimeCounterWidget[,0,0,400x250,layout=javax.swing.BoxLayout,alignmentX=0.0,alignmentY=0.0,border=com.ur.swing.g5.CardBorder@5fcc9354,flags=9,maximumSize=,minimumSize=,preferredSize=]. {thread: Thread-48 , loggerClass: com.ur.swing.SwitchSupport}

I tried to wrap the code with a try catch statement, but it doesn’t “throw” the error, it just prints it.  
My idea is to display a popup informing the operator to switch to a different tab if this happens.

Is there a way to catch this error or preemptively check on which tab is the teach pendant currently?

Thanks!

---

<div class="post-metadata">

### Author: ![boris.tityukov](https://avatars.discourse-cdn.com/v4/letter/b/b5ac83/32.png) [@boris.tityukov](https://forum.universal-robots.com/u/boris.tityukov)
#### Post date: [January 16, 2023, 9:17am UTC](https://forum.universal-robots.com/t/how-to-get-the-current-teach-pendant-tab/26097/2 "2023-01-16T09:17:34Z")

</div>

Hi, has anyone encountered this issue? It’s happening when prompted from a Toolbar URCap.
