Click or drag to resize

TaskGetRobTarget Method (String, String)

Get the current position for mechanical unit connected to task as RobTarget.

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

Parameters

tool
Type: SystemString
Name of tool to use for position. An empty string will get the position with tool active for jogging.
wobj
Type: SystemString
Name of workobject to use for position. An empty string will get the position with workobject active for jogging.

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.
ArgumentNullExceptionEither parameter tool or wobj is null.
GeneralExceptionA General Exception has occurred.
Remarks
If any of the parameters tool or wobj is an empty string, the current jogging setting for the parameter will be used.

To get the position according to current jogging settings the method GetRobTarget can be used.

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