Teach_mode() and end_teach_mode does not work

Ur version3.3.2.266
In my project,I need to calibrate pose to extend function of ur.
I wrote scripe code “teach_mode” and “end_teach_mode” during play the program.

I expect after 1st popup,ur enable teach mode so that user could move robot to particular pose.Then user would click on confirmation popup button,then teach mode would be disabled.

Please advice,thank

it work for me,

teach_mode()
Popup
end_teach_mode()

the robot will continue in teach mode and there will be a popup on pendant. robot will end teach mode after click ok on popup.

what your ur version?

UR version 3.3.3.292

It work after update ur version to 3.3.3.292.
thank

Consider that the first popup may be “blocking”, hence the “teach_mode()” might not be called, before pushing the first popup.

Issue resolved after update from version 3.3.2.266 to 3.3.3.292.
close case.
Thank

want to use script to control ur in teachmode,
i write c++ prog
tcpclient->write(“movej……\n”) it works
but tcpclient->write(“teachmode()\n”) it does not works, the log in teachpendant show the teachmode prog is over
i also try put this script in a timer, but it alse dose not works
please tell me why?

@lvyq83
When you send a single line of URScript to the client interface, the program will terminate as soon as the line is executed.

In the movej-example, the script-function is blocking, and will complete the motion, before the program ends.
teach_mode() is not a blocking call, it enters teach mode, but then the program terminates immediately after, thus ending teach-mode again.
To make the robot remain in teach-mode, you need to keep the program running until teach-mode should end by wrapping the necessary commands into a function such as:

def myprog():
   teach_mode()
   sleep(5)
   end_teach_mode()
end

This will put the robot in teach-mode, wait for 5 seconds (or you could wait for a digital input) and then end teach-mode before terminating the program.