VDefTool Method

Description
Using vision detection, calculates a tool offset value for TPC and mobile camera position.
Note: When the tool type is other than FixedCameraWithCal, the robot operates automatically based on the detection results of the target. Be careful of interference between the robot and peripherals. Also, use with avoiding singularity nearby posture that each axis extends to prevent an error during the tool set.

Syntax
Sub VDefTool(ToolNumber As Integer, ToolDefType As SpelToolDefType, Sequence As String, Object As String)
Sub VDefTool(ToolNumber As Integer, ToolDefType As SpelToolDefType, Sequence As String, Object As String, Parent As Form)
Sub VDefTool(ToolNumber As Integer, ToolDefType As SpelToolDefType, Sequence As String, FinalAngle As Double, InitAngle As Double, TargetTolerance As Double)
Sub VDefTool(ToolNumber As Integer, ToolDefType As SpelToolDefType, Sequence As String, FinalAngle As Double, InitAngle As Double, TargetTolerance As Double, Parent As Form)
Sub VDefTool(ToolNumber As Integer, ToolDefType As SpelToolDefType, Sequence As String, FinalAngle As Double, InitAngle As Double, TargetTolerance As Double, RobotSpeed As Integer, RobotAccel As Integer)
Sub VDefTool(ToolNumber As Integer, ToolDefType As SpelToolDefType, Sequence As String, FinalAngle As Double, InitAngle As Double, TargetTolerance As Double, RobotSpeed As Integer, RobotAccel As Integer, Parent As Form)

Parameters

  • ToolNumber
    An integer (1 to 15) indicating the tool number to set.
  • ToolDefType
    An integer indicating the tool type. FixedCamera: Tool set using a fixed camera which is not calibrated. J4Camera: Calculates image center of the mobile J4 camera. J6Camera: Calculates image center of the mobile J6 camera. FixedCameraWithCal: Tool set by using the fixed camera which is calibrated.
  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating a vision object in the current project. This parameter is required when ToolDefType is FixedCameraWithCal. When ToolDefType is not FixedCameraWithCal, Object should be an empty string.
  • FinalAngle
    A real number indicating an angle (degrees) to rotate the tool or camera tool. Value range: 0, 5 to 180, −5 to −180 If omitted, set to “90”.
  • InitAngle
    A real value indicating an angle (degrees) to rotate the tool or camera tool when setting a temporary tool. This value must be smaller than FinalAngle. Value range: −10 to 10 If omitted, set to “5”.
  • TargetTolerance
    A real number indicating the pixel distance at which the vision detection result is considered to match the target position. Value range: 0 to 3 pixels. If omitted, set to “1”.
  • Parent
    Optional. A .NET form that is the parent of the window.
  • RobotSpeed
    Optional. Integer variable indicating the robot speed (%). Value range: 0 to 100 If omitted, set to “5”.
  • RobotAccel
    Optional. Integer variable indicating the robot acceleration (%). Value range: 0 to 99 If omitted, set to “5”.

See Also
VDefArm Method, VDefGetMotionRange Method, VDefLocal Method, VDefSetMotionRange Method, VGoCenter Method

VDefTool Example
VB Example:

m_spel.VDefTool(1, SpelToolDefType.J6Camera, "myseq", 45, 5, 3.0)  
m_spel.VDefTool(1, SpelToolDefType.FixedCameraWithCal, "myseq", "myobj")  

C# Example:

m_spel.VDefTool(1, SpelToolDefType.J6Camera, "myseq", 45, 5, 3.0);  
m_spel.VDefTool(1, SpelToolDefType.FixedCameraWithCal, "myseq", "myobj");