Obtener en un PLC la posición home por comunicaciones

Creando un punto en el menú - Instalación - Funciones - Punto. Lo llamamos “Home”

Porque no funciona el siguiente código

If get_actual_tcp_pose() = Home
var_1 = True
var_1 = False

La línea 1 del programa no funciona, he probado varias cosas, conociendo el punto exacto home he probado lo siguiente

If get_actual_tcp_pose() = p[0.23,0.45,-1.14,0,0,0]
var_1 = True
var_1 = False

La línea 1 tampoco la entiende el programa

Gracias de antemano

When comparing the get_actual_tcp_pose() to your Home position, your looking for an exact match of co-ordinates.

due to the robot being under servo control the robot is continually adjusting to keep the position.

So when the get_actual_tcp_pose() is taken there are some small discrepancies.

You will never get var_1 = True.

You can use the built in Home position and assign Safe Home to a Configurable Output

Could you perform a check at Start of Program? I’m thinking something like below:

While(i<6) {
   // move Home code here
   write_output_boolean_register(0, True)
   // Robot is home

I’m not a great coder but I think this might be a decent duct tape and bandaid solution you can try. Note: this is off the top of my head so I’m not 100% sure it will work. You may have to play around with the tolerance variable

There may also already be a URscript function already developed for checking this as in manual mode the program wants to jog you to the start position if you are not already there. The UR dev team might have a better answer or they might be using the distance URscript function between two points to check if the robot is out of start position for the beginning of the program (I guess I could have also used that above as well or compared the joint angles with get_actual_joint_pose() as well, but oh well I’m sure there are several ways to skin this cat).

Anyways sorry for the long post, hope this helps and best of luck!

Thank for the answer.

First for Hammerton.
Is curious but in my system the E-Series that opcion does not appear. What do you version use?

For Michael

I have checked his code in a script, for the moment there is much fault, I have found some.
I am tryed correct it.

Thank you so much

Good morning @victor.ciudad

Did u configure a “Safe Home” position?

To do this you have to go to “Installation”-> “Safety” → “Safe Home”:

After that you can select at “Safety” → “I/O” , “Safe Home”:

Greetings from Luxembourg!

Muchas Gracias
Así funciona correctamente.