Hello Pav,
One thing you might be looking for is the use of triggers, interrupts and traps.
You can create a triggdata which you can link to an interrupt. This interrupt should be linked to a trap that you want executed once the interrupt occurs.
You can move the robot towards the point and when it reaches an X distance from the point, the trigger triggers and activates the interrupt. The code would look somewhat like this:
TRAP tTrap ! Defined the trap
! Do what you want to be done, stop movement and drop object
ENDTRAP
PROC Trigger()
VAR triggdata Trigger;
VAR intnum interrupt;
VAR num X;
VAR robtarget endPoint;
X := 5; ! amount of millimeters you want the robot to stop near your place point
CONNECT interrupt WITH tTrap; ! Connecting the interrupt with the trap
TriggInt Trigger, X, interrupt; ! Trigger occurs when robot passes the virtual sphere with diameter X around endpoint.
! You can also define this trigger to trigger when the robot passes a virtual sphere with diameter X around startpoint.
! You can do this with the following statement: “TriggInt Trigger, X \Start, interrupt;” Please check ABB documentation
! for more info on triggers and uses for these triggers.
TriggL endPoint, v10, Trigger, fine, tool0 \wobj wobj0;
! Replace speed, zone, tool and workobject with the ones you’re currently using.
ENDPROC
In this code i gave some explanation in the comments.
The way this code is executed is as follows:
The function creates the trigger, interrupt and other vars needed (you can use the variables you’re using in your code).
It connects the interruptnumber interrupt with trap tTrap, meaning whenever the interrupt gets activated, the program pointer will jump to tTrap and execute this one.
Then the trigger Trigger will be linked to the interruptNumber Interrupt. whenever the robot gets within X millimeter around the endpoint, the trigger will occur and activate the interrupt (which will lead the program pointer to enter the trap tTrap).
The robot gets moved with the TriggL function. This is comparable with the MoveL function (TriggJ and MoveJ, check ABB Documentation for more).
Whenever the robot moves within X mm around the destination (endPoint), it will trigger Trigger.
I hope this helps!
Cheers