F_CheckPos Function

Description
Returns whether the specified position has met the trigger conditions set in the force motion restriction object.

Usage
F_CheckPos(Object [, Point1[, Point2]])

  • Object
    Object name
    The object is specified as either of FMR (numerical value) or FMR (label).

  • Point1
    Point data/point designation to show reference position. Can be omitted.

  • Point2
    Point data/point designation to show reference position. Can be omitted.

Return Values

Number Constant Description
0 False Trigger conditions not met
-1 True Trigger conditions met

Returns whether the specified position has met the trigger conditions set in the force motion restriction object.

Detailed Explanation
Returns whether the specified position has met the trigger conditions set in the force motion restriction object. This function determines whether trigger conditions have been met with HoldTimeThresh set to “0”.
The usage of this function varies depending on the monitored object specified by the TriggerMode property.
When FG_REL_COORD_SYS, FG_REL_TOOL, or FG_REL_JOINT is specified by TriggerMode.
This evaluates the achievement status for force motion restriction for the position and orientation, or joint angle of Point2 relative to Point1. The point of reference, Point1, cannot be omitted. An error will occur if omitted. If the point being evaluated, Point2, is omitted, the achievement status for force motion restriction for the position and orientation, or joint angle of current position (CurPos) will be evaluated relative to Point1.

When FG_ABS_COORD_SYS, FG_REL_POINT, or FG_ABS_JOINT is specified by TriggerMode.
This evaluates the achievement status for force motion restriction for the position and orientation, or joint angle of Point1 in relation to the coordinate system set by the force motion restriction object. Point2 cannot be specified. An error will occur if this is specified. Point1, the point being evaluated, may be omitted. If Point1 is omitted, this will evaluate the achievement status for force motion restriction for the position and orientation, or joint angle of current position (CurPos) in relation to the coordinate system set by the force motion restriction function.

When FG_FRC_CORRECTION is specified by TriggerMode.
This evaluates the achievement status for force motion restriction for the correction amount set by the force control function. Point1 and Point2 do not need to be set. An error will occur if these are specified.

Usage Example
This is an example for displaying whether the Z coordinate of the robot's current position (CurPos) in the base coordinate system is within the specified range (-10 to 10). If it is within the range, True(-1) will be displayed.

Function F_CheckPosTest
  Print F_CheckPos(FMR1)
Fend

Function F_CheckPosTest
  FSet FMR1.TriggerMode, FG_ABS_COORD_SYS
    ' Set to evaluate the position and orientation in the specified coordinate system
  FSet FMR1.PosEnabled, False, False, True, False, False
    ' Set enable only in the Z direction
  FSet FMR1.PosZ_Levels, -10, 10
    ' Set the upper and lower thresholds of Z to -10 to 10 mm
  FSet FMR1.PosZ_Polarity, FG_IN
    ' Set the achievement condition when it is within the range of the upper and lower thresholds
  FSet FMR1.RobotTool, FG_CURRENT_TOOL
    ' Set based on the currently selected tool
  FSet FMR1.RobotLocal, 0
    ' Set with reference to the base coordinate system

  Print F_CheckPos(FMR1)
Fend

See Also
TriggerMode, Force Motion Restriction Object FMR#