How do I verify the robot’s current location? I am trying to use this but it just falls through.
FUNC bool CheckLocation(
num DistanceMM,
robtarget Location,
obtarget Loc2
obtarget Loc3
obtarget Loc4
obtarget Loc5
obtarget Loc6
obtarget Loc7
obtarget Loc8)
VAR robtarget CurRobT2;
VAR num nDistance:=0;
!
! get the current location
CurRobT2:=CRobT();
!
! check location distance and axis configuration
IF RobtToRobtDist(Location,CurRobT2)<DistanceMM AND RobtToRobtConf(Location,CurRobT2Approx) THEN
RETURN TRUE;
ENDIF
!
IF Present(Loc2) THEN
! check alternate location 2
IF RobtToRobtDist(Loc2,CurRobT2)<DistanceMM AND RobtToRobtConf(Loc2,CurRobT2Approx) THEN
RETURN TRUE;
ENDIF
ENDIF
!
IF Present(Loc3) THEN
! check alternate location 3
IF RobtToRobtDist(Loc3,CurRobT2)<DistanceMM AND RobtToRobtConf(Loc3,CurRobT2Approx) THEN
RETURN TRUE;
ENDIF
ENDIF
…
and so on…
The pointer passes by the IF Present(Loc) command even though its in the top of the function. Any help is appreciated.
Thanks