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
write_output_Boolean_register(0,var_1)
Else
var_1 = False
write_output_Boolean_register(0,var_1)

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
write_output_Boolean_register(0,var_1)
Else
var_1 = False
write_output_Boolean_register(0,var_1)

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:

Current_Pose:=get_actual_tcp_pose()
Positional_Tolerance:=0.001
Is_Home:=True
i:=0
While(i<6) {
   if(norm(Current_Pose[i]-const_Home[i])>Positional_Tolerance)
      Is_Home:=False
   i:=i+1
}
if(Is_Home=False)
   write_output_boolean_register(0,False)
   // move Home code here
   write_output_boolean_register(0, True)
else()
   // Robot is home
   write_output_boolean_register(0,True)

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.