TaskGetRobTarget Method (String, String) |
Namespace: ABB.Robotics.Controllers.RapidDomain
public RobTarget GetRobTarget( string tool, string wobj )
Exception | Condition |
---|---|
InvalidOperationException | The task is not a motiontask, i.e. no mechanical unit is connected to this task. |
ArgumentNullException | Either parameter tool or wobj is null. |
GeneralException | A General Exception has occurred. |
To get the position according to current jogging settings the method GetRobTarget can be used.
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; }