Click or drag to resize

TaskGetRobTarget Method

Get the current position for mechanical unit connected to task as RobTarget, using tool and workobject active for jogging.

Namespace:  ABB.Robotics.Controllers.RapidDomain
Assembly:  ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax
C#
public RobTarget GetRobTarget()

Return Value

Type: RobTarget
RobTarget contaning the current position for the mechanical unit connected to the task.
Exceptions
ExceptionCondition
InvalidOperationExceptionThe task is not a motiontask, i.e. no mechanical unit is connected to this task.
GeneralExceptionA General Exception has occurred.
Remarks
This method returns the position using the current tool and workobject set for jogging.

To get the position to a spcified tool and/or workobject call method GetRobTarget(String, String).

Examples
This example shows different ways to get the mechanical units, connected to the parameter task, position as RobTarget.
public RobTarget GetRobTarget(Task task)
{
  RobTarget target = RobTarget.Empty;

  try
  {
    // Get RobTarget according to current jogging settings
    target = task.GetRobTarget();

    // Get RobTarget with parameters according to current jogging settings
    target = task.GetRobTarget(string.Empty, string.Empty);

    // Get RobTarget according to tool0 and workobject set for jogging
    target = task.GetRobTarget("tool0", string.Empty);

    // Get RobTarget according to wobj0 and tool set for jogging
    target = task.GetRobTarget(string.Empty, "wobj0");

    // Get RobTarget according to tool0 and wobj0
    target = task.GetRobTarget("tool0", "wobj0");
  }
  catch //(System.Exception ex)
  {
    // Exception handling
  }

  return target;
}
See Also