Class RsMoveInstruction
Represents a RAPID instruction for moving the robot to a specified target in a specified manner.
Implements
Inherited Members
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
[Persistent("MoveInstructionCall")]
public sealed class RsMoveInstruction : RsInstruction, ISupportCopy
Remarks
The Name property corresponds to the name of the RAPID instruction and should not be changed.
Constructors
View SourceRsMoveInstruction(RsTask, string, string, MotionType, string, string, string)
Initializes a new instance of the RsMoveInstruction class, which is based on the specified instruction description and template.
Declaration
public RsMoveInstruction(RsTask task, string processDefinitionName, string processTemplateName, MotionType motionType, string wobjName, string toPointName, string toolName)
Parameters
| Type | Name | Description |
|---|---|---|
| RsTask | task | The task to create the Move Instruction for. |
| string | processDefinitionName | The name of the process definition of the Move Instruction. |
| string | processTemplateName | The name of the process template of the Move Instruction. |
| MotionType | motionType | The MotionType of the Move Instruction. |
| string | wobjName | The name of the work object of the Move Instruction. |
| string | toPointName | The name of the to point ,i.e. the name of a RobTarget in the station, of the Move Instruction. |
| string | toolName | The name of the tool of the Move Instruction. |
Examples
Create Move Instruction.
Project.UndoContext.BeginUndoStep("RsMoveInstructionCreate");
try
{
#region RsMoveInstructionCreateStep1
Station station = Station.ActiveStation;
#endregion
// First import a robot (a mechanism) and add it to the station.
#region RsMoveInstructionCreateStep2
GraphicComponentLibrary mechLib = await GraphicComponentLibrary.LoadAsync("IRB140_6_81_C_G_03.rslib", true);
Mechanism mechGfx = (Mechanism)mechLib.RootComponent.CopyInstance();
mechGfx.Name = "IRB140_6_81_C_G_03";
station.GraphicComponents.Add(mechGfx);
#endregion
// Set the active task to the mechanism task.
#region RsMoveInstructionCreateStep3
station.ActiveTask = mechGfx.Task;
#endregion
// Create a WorkObject and add it to the ActiveTask.
#region RsMoveInstructionCreateStep4
RsWorkObject myWobj = new RsWorkObject();
myWobj.Name = station.ActiveTask.GetValidRapidName("myWobj", "_", 1);
station.ActiveTask.DataDeclarations.Add(myWobj);
#endregion
// Create a ToolData and add it to the ActiveTask.
#region RsMoveInstructionCreateStep5
RsToolData myTool = new RsToolData();
myTool.Name = station.ActiveTask.GetValidRapidName("myTool", "_", 1);
station.ActiveTask.DataDeclarations.Add(myTool);
#endregion
// Create a new RobTarget and add it to the ActiveTask.
#region RsMoveInstructionCreateStep6
RsRobTarget toPoint = new RsRobTarget();
toPoint.Name = station.ActiveTask.GetValidRapidName("myRobTarget", "_", 1);
station.ActiveTask.DataDeclarations.Add(toPoint);
#endregion
// Create a graphic representation of the RobTarget and RsTarget.
#region RsMoveInstructionCreateStep7
RsTarget myRsTarget = new RsTarget(myWobj, toPoint);
myRsTarget.Name = toPoint.Name;
station.ActiveTask.Targets.Add(myRsTarget);
#endregion
// Create a PathProcedure.
#region RsMoveInstructionCreateStep8
RsPathProcedure myPath = new RsPathProcedure("myPath");
station.ActiveTask.PathProcedures.Add(myPath);
#endregion
// Create a linear move instruction using the move definition and the default template.
#region RsMoveInstructionCreateStep9
RsMoveInstruction myMoveL = new RsMoveInstruction
(station.ActiveTask, "Move", "Default",
MotionType.Linear, myWobj.Name, toPoint.Name, myTool.Name);
myPath.Instructions.Add(myMoveL);
#endregion
// Create a new RobTarget to use as cirPoint and add it to the ActiveTask.
#region RsMoveInstructionCreateStep10
RsRobTarget cirPoint = new RsRobTarget();
cirPoint.Name = station.ActiveTask.GetValidRapidName("myRobTarget", "_", 1);
cirPoint.Frame.X = cirPoint.Frame.X + 0.10;
cirPoint.Frame.Z = cirPoint.Frame.Z + 0.10;
station.ActiveTask.DataDeclarations.Add(cirPoint);
#endregion
// Create a graphic representation of the RobTarget and RsTarget.
#region RsMoveInstructionCreateStep11
RsTarget myRsTarget_2 = new RsTarget(myWobj, cirPoint);
myRsTarget_2.Name = cirPoint.Name;
station.ActiveTask.Targets.Add(myRsTarget_2);
#endregion
// Create a circular move instruction.
#region RsMoveInstructionCreateStep12
RsMoveInstruction myMoveCirc = new RsMoveInstruction(station.ActiveTask,
"Move", "Default", myWobj.Name, cirPoint.Name, toPoint.Name, myTool.Name);
myPath.Instructions.Add(myMoveCirc);
#endregion
// Create a joint target to be able to create a MoveAbsJ move instruction.
#region RsMoveInstructionCreateStep13
RsJointTarget myJointTarget = new RsJointTarget();
myJointTarget.Name = station.ActiveTask.GetValidRapidName("myJointTarget", "_", 1);
station.ActiveTask.DataDeclarations.Add(myJointTarget);
#endregion
// Set the robot axis values.
#region RsMoveInstructionCreateStep14
RobotAxisValues rbAxis = new RobotAxisValues();
rbAxis.Rax_1 = 70.0000000000001;
rbAxis.Rax_2 = -30;
rbAxis.Rax_3 = 30;
rbAxis.Rax_4 = -55.0000000000001;
rbAxis.Rax_5 = 40;
rbAxis.Rax_6 = 10;
myJointTarget.SetRobotAxes(rbAxis, false);
#endregion
// Create a MoveAbsJ move instruction (this only makes sense if there is a mechanism in the station).
#region RsMoveInstructionCreateStep15
RsMoveInstruction myMoveAbsJ =
new RsMoveInstruction(station.ActiveTask, "MoveAbs", "Default", myJointTarget.Name);
myPath.Instructions.Add(myMoveAbsJ);
#endregion
// Create a MoveAbsL move instruction (this only makes sense if there is a mechanism in the station).
#region RsMoveInstructionCreateStep16
RsMoveInstruction myMoveAbsL =
new RsMoveInstruction(station.ActiveTask, "MoveAbs", "Default", myJointTarget.Name, MotionType.Linear);
myPath.Instructions.Add(myMoveAbsL);
#endregion
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
RsMoveInstruction(RsTask, string, string, string)
Creates and initializes a new RsMoveInstruction object that uses a joint position, no consideration is made regarding tool or workobject
Declaration
public RsMoveInstruction(RsTask task, string processDefinitionName, string processTemplateName, string jointTargetName)
Parameters
| Type | Name | Description |
|---|---|---|
| RsTask | task | The task to create the Move Instruction for |
| string | processDefinitionName | The name of the process definition of the Move Instruction |
| string | processTemplateName | The name of the process template of the Move Instruction |
| string | jointTargetName | The name of a joint target in the station |
Remarks
This constructor uses the template for joint motion; use RsMoveInstruction(RsTask, string, string, string, MotionType) to specify the motion type.
Examples
Create Move Instruction
Project.UndoContext.BeginUndoStep("RsMoveInstructionCreate");
try
{
#region RsMoveInstructionCreateStep1
Station station = Station.ActiveStation;
#endregion
// First import a robot (a mechanism) and add it to the station.
#region RsMoveInstructionCreateStep2
GraphicComponentLibrary mechLib = await GraphicComponentLibrary.LoadAsync("IRB140_6_81_C_G_03.rslib", true);
Mechanism mechGfx = (Mechanism)mechLib.RootComponent.CopyInstance();
mechGfx.Name = "IRB140_6_81_C_G_03";
station.GraphicComponents.Add(mechGfx);
#endregion
// Set the active task to the mechanism task.
#region RsMoveInstructionCreateStep3
station.ActiveTask = mechGfx.Task;
#endregion
// Create a WorkObject and add it to the ActiveTask.
#region RsMoveInstructionCreateStep4
RsWorkObject myWobj = new RsWorkObject();
myWobj.Name = station.ActiveTask.GetValidRapidName("myWobj", "_", 1);
station.ActiveTask.DataDeclarations.Add(myWobj);
#endregion
// Create a ToolData and add it to the ActiveTask.
#region RsMoveInstructionCreateStep5
RsToolData myTool = new RsToolData();
myTool.Name = station.ActiveTask.GetValidRapidName("myTool", "_", 1);
station.ActiveTask.DataDeclarations.Add(myTool);
#endregion
// Create a new RobTarget and add it to the ActiveTask.
#region RsMoveInstructionCreateStep6
RsRobTarget toPoint = new RsRobTarget();
toPoint.Name = station.ActiveTask.GetValidRapidName("myRobTarget", "_", 1);
station.ActiveTask.DataDeclarations.Add(toPoint);
#endregion
// Create a graphic representation of the RobTarget and RsTarget.
#region RsMoveInstructionCreateStep7
RsTarget myRsTarget = new RsTarget(myWobj, toPoint);
myRsTarget.Name = toPoint.Name;
station.ActiveTask.Targets.Add(myRsTarget);
#endregion
// Create a PathProcedure.
#region RsMoveInstructionCreateStep8
RsPathProcedure myPath = new RsPathProcedure("myPath");
station.ActiveTask.PathProcedures.Add(myPath);
#endregion
// Create a linear move instruction using the move definition and the default template.
#region RsMoveInstructionCreateStep9
RsMoveInstruction myMoveL = new RsMoveInstruction
(station.ActiveTask, "Move", "Default",
MotionType.Linear, myWobj.Name, toPoint.Name, myTool.Name);
myPath.Instructions.Add(myMoveL);
#endregion
// Create a new RobTarget to use as cirPoint and add it to the ActiveTask.
#region RsMoveInstructionCreateStep10
RsRobTarget cirPoint = new RsRobTarget();
cirPoint.Name = station.ActiveTask.GetValidRapidName("myRobTarget", "_", 1);
cirPoint.Frame.X = cirPoint.Frame.X + 0.10;
cirPoint.Frame.Z = cirPoint.Frame.Z + 0.10;
station.ActiveTask.DataDeclarations.Add(cirPoint);
#endregion
// Create a graphic representation of the RobTarget and RsTarget.
#region RsMoveInstructionCreateStep11
RsTarget myRsTarget_2 = new RsTarget(myWobj, cirPoint);
myRsTarget_2.Name = cirPoint.Name;
station.ActiveTask.Targets.Add(myRsTarget_2);
#endregion
// Create a circular move instruction.
#region RsMoveInstructionCreateStep12
RsMoveInstruction myMoveCirc = new RsMoveInstruction(station.ActiveTask,
"Move", "Default", myWobj.Name, cirPoint.Name, toPoint.Name, myTool.Name);
myPath.Instructions.Add(myMoveCirc);
#endregion
// Create a joint target to be able to create a MoveAbsJ move instruction.
#region RsMoveInstructionCreateStep13
RsJointTarget myJointTarget = new RsJointTarget();
myJointTarget.Name = station.ActiveTask.GetValidRapidName("myJointTarget", "_", 1);
station.ActiveTask.DataDeclarations.Add(myJointTarget);
#endregion
// Set the robot axis values.
#region RsMoveInstructionCreateStep14
RobotAxisValues rbAxis = new RobotAxisValues();
rbAxis.Rax_1 = 70.0000000000001;
rbAxis.Rax_2 = -30;
rbAxis.Rax_3 = 30;
rbAxis.Rax_4 = -55.0000000000001;
rbAxis.Rax_5 = 40;
rbAxis.Rax_6 = 10;
myJointTarget.SetRobotAxes(rbAxis, false);
#endregion
// Create a MoveAbsJ move instruction (this only makes sense if there is a mechanism in the station).
#region RsMoveInstructionCreateStep15
RsMoveInstruction myMoveAbsJ =
new RsMoveInstruction(station.ActiveTask, "MoveAbs", "Default", myJointTarget.Name);
myPath.Instructions.Add(myMoveAbsJ);
#endregion
// Create a MoveAbsL move instruction (this only makes sense if there is a mechanism in the station).
#region RsMoveInstructionCreateStep16
RsMoveInstruction myMoveAbsL =
new RsMoveInstruction(station.ActiveTask, "MoveAbs", "Default", myJointTarget.Name, MotionType.Linear);
myPath.Instructions.Add(myMoveAbsL);
#endregion
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
RsMoveInstruction(RsTask, string, string, string, MotionType)
Creates and initializes a new RsMoveInstruction object that uses a joint position and either joint or linear motion.
Declaration
public RsMoveInstruction(RsTask task, string processDefinitionName, string processTemplateName, string jointTargetName, MotionType motionType)
Parameters
| Type | Name | Description |
|---|---|---|
| RsTask | task | The task to create the Move Instruction for |
| string | processDefinitionName | The name of the process definition of the Move Instruction |
| string | processTemplateName | The name of the process template of the Move Instruction |
| string | jointTargetName | The name of a joint target in the station |
| MotionType | motionType | The MotionType of the Move Instruction. |
Examples
Create Move Instruction
Project.UndoContext.BeginUndoStep("RsMoveInstructionCreate");
try
{
#region RsMoveInstructionCreateStep1
Station station = Station.ActiveStation;
#endregion
// First import a robot (a mechanism) and add it to the station.
#region RsMoveInstructionCreateStep2
GraphicComponentLibrary mechLib = await GraphicComponentLibrary.LoadAsync("IRB140_6_81_C_G_03.rslib", true);
Mechanism mechGfx = (Mechanism)mechLib.RootComponent.CopyInstance();
mechGfx.Name = "IRB140_6_81_C_G_03";
station.GraphicComponents.Add(mechGfx);
#endregion
// Set the active task to the mechanism task.
#region RsMoveInstructionCreateStep3
station.ActiveTask = mechGfx.Task;
#endregion
// Create a WorkObject and add it to the ActiveTask.
#region RsMoveInstructionCreateStep4
RsWorkObject myWobj = new RsWorkObject();
myWobj.Name = station.ActiveTask.GetValidRapidName("myWobj", "_", 1);
station.ActiveTask.DataDeclarations.Add(myWobj);
#endregion
// Create a ToolData and add it to the ActiveTask.
#region RsMoveInstructionCreateStep5
RsToolData myTool = new RsToolData();
myTool.Name = station.ActiveTask.GetValidRapidName("myTool", "_", 1);
station.ActiveTask.DataDeclarations.Add(myTool);
#endregion
// Create a new RobTarget and add it to the ActiveTask.
#region RsMoveInstructionCreateStep6
RsRobTarget toPoint = new RsRobTarget();
toPoint.Name = station.ActiveTask.GetValidRapidName("myRobTarget", "_", 1);
station.ActiveTask.DataDeclarations.Add(toPoint);
#endregion
// Create a graphic representation of the RobTarget and RsTarget.
#region RsMoveInstructionCreateStep7
RsTarget myRsTarget = new RsTarget(myWobj, toPoint);
myRsTarget.Name = toPoint.Name;
station.ActiveTask.Targets.Add(myRsTarget);
#endregion
// Create a PathProcedure.
#region RsMoveInstructionCreateStep8
RsPathProcedure myPath = new RsPathProcedure("myPath");
station.ActiveTask.PathProcedures.Add(myPath);
#endregion
// Create a linear move instruction using the move definition and the default template.
#region RsMoveInstructionCreateStep9
RsMoveInstruction myMoveL = new RsMoveInstruction
(station.ActiveTask, "Move", "Default",
MotionType.Linear, myWobj.Name, toPoint.Name, myTool.Name);
myPath.Instructions.Add(myMoveL);
#endregion
// Create a new RobTarget to use as cirPoint and add it to the ActiveTask.
#region RsMoveInstructionCreateStep10
RsRobTarget cirPoint = new RsRobTarget();
cirPoint.Name = station.ActiveTask.GetValidRapidName("myRobTarget", "_", 1);
cirPoint.Frame.X = cirPoint.Frame.X + 0.10;
cirPoint.Frame.Z = cirPoint.Frame.Z + 0.10;
station.ActiveTask.DataDeclarations.Add(cirPoint);
#endregion
// Create a graphic representation of the RobTarget and RsTarget.
#region RsMoveInstructionCreateStep11
RsTarget myRsTarget_2 = new RsTarget(myWobj, cirPoint);
myRsTarget_2.Name = cirPoint.Name;
station.ActiveTask.Targets.Add(myRsTarget_2);
#endregion
// Create a circular move instruction.
#region RsMoveInstructionCreateStep12
RsMoveInstruction myMoveCirc = new RsMoveInstruction(station.ActiveTask,
"Move", "Default", myWobj.Name, cirPoint.Name, toPoint.Name, myTool.Name);
myPath.Instructions.Add(myMoveCirc);
#endregion
// Create a joint target to be able to create a MoveAbsJ move instruction.
#region RsMoveInstructionCreateStep13
RsJointTarget myJointTarget = new RsJointTarget();
myJointTarget.Name = station.ActiveTask.GetValidRapidName("myJointTarget", "_", 1);
station.ActiveTask.DataDeclarations.Add(myJointTarget);
#endregion
// Set the robot axis values.
#region RsMoveInstructionCreateStep14
RobotAxisValues rbAxis = new RobotAxisValues();
rbAxis.Rax_1 = 70.0000000000001;
rbAxis.Rax_2 = -30;
rbAxis.Rax_3 = 30;
rbAxis.Rax_4 = -55.0000000000001;
rbAxis.Rax_5 = 40;
rbAxis.Rax_6 = 10;
myJointTarget.SetRobotAxes(rbAxis, false);
#endregion
// Create a MoveAbsJ move instruction (this only makes sense if there is a mechanism in the station).
#region RsMoveInstructionCreateStep15
RsMoveInstruction myMoveAbsJ =
new RsMoveInstruction(station.ActiveTask, "MoveAbs", "Default", myJointTarget.Name);
myPath.Instructions.Add(myMoveAbsJ);
#endregion
// Create a MoveAbsL move instruction (this only makes sense if there is a mechanism in the station).
#region RsMoveInstructionCreateStep16
RsMoveInstruction myMoveAbsL =
new RsMoveInstruction(station.ActiveTask, "MoveAbs", "Default", myJointTarget.Name, MotionType.Linear);
myPath.Instructions.Add(myMoveAbsL);
#endregion
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
RsMoveInstruction(RsTask, string, string, string, string, string, string)
Creates and initializes a new RsMoveInstruction object with circular motiontype
Declaration
public RsMoveInstruction(RsTask task, string processDefinitionName, string processTemplateName, string wobjName, string cirPointName, string toPointName, string toolName)
Parameters
| Type | Name | Description |
|---|---|---|
| RsTask | task | The task to create the Move Instruction for |
| string | processDefinitionName | The name of the process definition of the Move Instruction |
| string | processTemplateName | The name of the process template of the Move Instruction |
| string | wobjName | The name of the work object of the Move Instruction |
| string | cirPointName | The name of the cir point ,i.e. the name of a RobTarget in the station, of the Move Instruction |
| string | toPointName | The name of the to point ,i.e. the name of a RobTarget in the station, of the Move Instruction |
| string | toolName | The name of the tool of the Move Instruction |
Examples
Create Move Instruction
Project.UndoContext.BeginUndoStep("RsMoveInstructionCreate");
try
{
#region RsMoveInstructionCreateStep1
Station station = Station.ActiveStation;
#endregion
// First import a robot (a mechanism) and add it to the station.
#region RsMoveInstructionCreateStep2
GraphicComponentLibrary mechLib = await GraphicComponentLibrary.LoadAsync("IRB140_6_81_C_G_03.rslib", true);
Mechanism mechGfx = (Mechanism)mechLib.RootComponent.CopyInstance();
mechGfx.Name = "IRB140_6_81_C_G_03";
station.GraphicComponents.Add(mechGfx);
#endregion
// Set the active task to the mechanism task.
#region RsMoveInstructionCreateStep3
station.ActiveTask = mechGfx.Task;
#endregion
// Create a WorkObject and add it to the ActiveTask.
#region RsMoveInstructionCreateStep4
RsWorkObject myWobj = new RsWorkObject();
myWobj.Name = station.ActiveTask.GetValidRapidName("myWobj", "_", 1);
station.ActiveTask.DataDeclarations.Add(myWobj);
#endregion
// Create a ToolData and add it to the ActiveTask.
#region RsMoveInstructionCreateStep5
RsToolData myTool = new RsToolData();
myTool.Name = station.ActiveTask.GetValidRapidName("myTool", "_", 1);
station.ActiveTask.DataDeclarations.Add(myTool);
#endregion
// Create a new RobTarget and add it to the ActiveTask.
#region RsMoveInstructionCreateStep6
RsRobTarget toPoint = new RsRobTarget();
toPoint.Name = station.ActiveTask.GetValidRapidName("myRobTarget", "_", 1);
station.ActiveTask.DataDeclarations.Add(toPoint);
#endregion
// Create a graphic representation of the RobTarget and RsTarget.
#region RsMoveInstructionCreateStep7
RsTarget myRsTarget = new RsTarget(myWobj, toPoint);
myRsTarget.Name = toPoint.Name;
station.ActiveTask.Targets.Add(myRsTarget);
#endregion
// Create a PathProcedure.
#region RsMoveInstructionCreateStep8
RsPathProcedure myPath = new RsPathProcedure("myPath");
station.ActiveTask.PathProcedures.Add(myPath);
#endregion
// Create a linear move instruction using the move definition and the default template.
#region RsMoveInstructionCreateStep9
RsMoveInstruction myMoveL = new RsMoveInstruction
(station.ActiveTask, "Move", "Default",
MotionType.Linear, myWobj.Name, toPoint.Name, myTool.Name);
myPath.Instructions.Add(myMoveL);
#endregion
// Create a new RobTarget to use as cirPoint and add it to the ActiveTask.
#region RsMoveInstructionCreateStep10
RsRobTarget cirPoint = new RsRobTarget();
cirPoint.Name = station.ActiveTask.GetValidRapidName("myRobTarget", "_", 1);
cirPoint.Frame.X = cirPoint.Frame.X + 0.10;
cirPoint.Frame.Z = cirPoint.Frame.Z + 0.10;
station.ActiveTask.DataDeclarations.Add(cirPoint);
#endregion
// Create a graphic representation of the RobTarget and RsTarget.
#region RsMoveInstructionCreateStep11
RsTarget myRsTarget_2 = new RsTarget(myWobj, cirPoint);
myRsTarget_2.Name = cirPoint.Name;
station.ActiveTask.Targets.Add(myRsTarget_2);
#endregion
// Create a circular move instruction.
#region RsMoveInstructionCreateStep12
RsMoveInstruction myMoveCirc = new RsMoveInstruction(station.ActiveTask,
"Move", "Default", myWobj.Name, cirPoint.Name, toPoint.Name, myTool.Name);
myPath.Instructions.Add(myMoveCirc);
#endregion
// Create a joint target to be able to create a MoveAbsJ move instruction.
#region RsMoveInstructionCreateStep13
RsJointTarget myJointTarget = new RsJointTarget();
myJointTarget.Name = station.ActiveTask.GetValidRapidName("myJointTarget", "_", 1);
station.ActiveTask.DataDeclarations.Add(myJointTarget);
#endregion
// Set the robot axis values.
#region RsMoveInstructionCreateStep14
RobotAxisValues rbAxis = new RobotAxisValues();
rbAxis.Rax_1 = 70.0000000000001;
rbAxis.Rax_2 = -30;
rbAxis.Rax_3 = 30;
rbAxis.Rax_4 = -55.0000000000001;
rbAxis.Rax_5 = 40;
rbAxis.Rax_6 = 10;
myJointTarget.SetRobotAxes(rbAxis, false);
#endregion
// Create a MoveAbsJ move instruction (this only makes sense if there is a mechanism in the station).
#region RsMoveInstructionCreateStep15
RsMoveInstruction myMoveAbsJ =
new RsMoveInstruction(station.ActiveTask, "MoveAbs", "Default", myJointTarget.Name);
myPath.Instructions.Add(myMoveAbsJ);
#endregion
// Create a MoveAbsL move instruction (this only makes sense if there is a mechanism in the station).
#region RsMoveInstructionCreateStep16
RsMoveInstruction myMoveAbsL =
new RsMoveInstruction(station.ActiveTask, "MoveAbs", "Default", myJointTarget.Name, MotionType.Linear);
myPath.Instructions.Add(myMoveAbsL);
#endregion
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
Properties
View SourceColor
Gets or sets the color of the path segment that this instruction corresponds to
Declaration
public Color Color { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
Name
Gets or Sets the name of the Move Instruction
Declaration
public override string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Examples
Get/Set Name
Project.UndoContext.BeginUndoStep("RsMoveInstructionProperties");
try
{
Station station = Station.ActiveStation;
// Create a move instruction in the constructor examples.
RsMoveInstruction myMove = (RsMoveInstruction)station.ActiveTask.FindPathProcedureFromModuleScope("myPath", "").Instructions[0];
// Set the color of the move instruction to yellow.
myMove.Color = Color.Yellow;
// Make the thickness of the move instruction twice as thick.
myMove.Thickness = myMove.Thickness * 2;
// Output some info regarding the move instruction.
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessDefinitionName '" + myMove.ProcessDefinitionName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessTemplateName '" + myMove.ProcessTemplateName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction '" + myMove.Name + "' has '" + myMove.InstructionArguments.Count + "' Instruction Arguments"));
RsInstructionArgument myCirPointArg = myMove.GetCirPointArgument();
if (myCirPointArg != null)
{
Logger.AddMessage(new LogMessage("CirPointArg Name: '" + myCirPointArg.Name + "' Value: '" + myCirPointArg.Value + "'"));
}
RsProcessTemplate myProcTempl = myMove.GetProcessTemplate();
if (myProcTempl != null)
{
Logger.AddMessage(new LogMessage("ProcessTemplate Name: '" + myProcTempl.Name + "' ActiveMotionType: '" + myProcTempl.ActiveMotionType + "'"));
}
RsInstructionArgument myToJointPosArg = myMove.GetToJointPosArgument();
if (myToJointPosArg != null)
{
Logger.AddMessage(new LogMessage("ToJointPosArg Name: '" + myToJointPosArg.Name + "' Value: '" + myToJointPosArg.Value + "'"));
}
RsInstructionArgument myToolArg = myMove.GetToolArgument();
if (myToolArg != null)
{
Logger.AddMessage(new LogMessage("ToolArg Name: '" + myToolArg.Name + "' Value: '" + myToolArg.Value + "'"));
}
RsInstructionArgument myToPointArg = myMove.GetToPointArgument();
if (myToPointArg != null)
{
Logger.AddMessage(new LogMessage("ToPointArgument Name: '" + myToPointArg.Name + "' Value: '" + myToPointArg.Value + "'"));
}
RsInstructionArgument myViaPointArg = myMove.GetViaPointArgument();
if (myViaPointArg != null)
{
Logger.AddMessage(new LogMessage("ViaPointArg Name: '" + myViaPointArg.Name + "' Value: '" + myViaPointArg.Value + "'"));
}
RsInstructionArgument myWObjArgument = myMove.GetWObjArgument();
if (myWObjArgument != null)
{
Logger.AddMessage(new LogMessage("WObjArgument Name: '" + myWObjArgument.Name + "' Value: '" + myWObjArgument.Value + "'"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
ProcessDefinitionName
Gets the name of the Process Definition of the Move Instruction
Declaration
public string ProcessDefinitionName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Examples
Get ProcessDefinitionName
Project.UndoContext.BeginUndoStep("RsMoveInstructionProperties");
try
{
Station station = Station.ActiveStation;
// Create a move instruction in the constructor examples.
RsMoveInstruction myMove = (RsMoveInstruction)station.ActiveTask.FindPathProcedureFromModuleScope("myPath", "").Instructions[0];
// Set the color of the move instruction to yellow.
myMove.Color = Color.Yellow;
// Make the thickness of the move instruction twice as thick.
myMove.Thickness = myMove.Thickness * 2;
// Output some info regarding the move instruction.
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessDefinitionName '" + myMove.ProcessDefinitionName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessTemplateName '" + myMove.ProcessTemplateName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction '" + myMove.Name + "' has '" + myMove.InstructionArguments.Count + "' Instruction Arguments"));
RsInstructionArgument myCirPointArg = myMove.GetCirPointArgument();
if (myCirPointArg != null)
{
Logger.AddMessage(new LogMessage("CirPointArg Name: '" + myCirPointArg.Name + "' Value: '" + myCirPointArg.Value + "'"));
}
RsProcessTemplate myProcTempl = myMove.GetProcessTemplate();
if (myProcTempl != null)
{
Logger.AddMessage(new LogMessage("ProcessTemplate Name: '" + myProcTempl.Name + "' ActiveMotionType: '" + myProcTempl.ActiveMotionType + "'"));
}
RsInstructionArgument myToJointPosArg = myMove.GetToJointPosArgument();
if (myToJointPosArg != null)
{
Logger.AddMessage(new LogMessage("ToJointPosArg Name: '" + myToJointPosArg.Name + "' Value: '" + myToJointPosArg.Value + "'"));
}
RsInstructionArgument myToolArg = myMove.GetToolArgument();
if (myToolArg != null)
{
Logger.AddMessage(new LogMessage("ToolArg Name: '" + myToolArg.Name + "' Value: '" + myToolArg.Value + "'"));
}
RsInstructionArgument myToPointArg = myMove.GetToPointArgument();
if (myToPointArg != null)
{
Logger.AddMessage(new LogMessage("ToPointArgument Name: '" + myToPointArg.Name + "' Value: '" + myToPointArg.Value + "'"));
}
RsInstructionArgument myViaPointArg = myMove.GetViaPointArgument();
if (myViaPointArg != null)
{
Logger.AddMessage(new LogMessage("ViaPointArg Name: '" + myViaPointArg.Name + "' Value: '" + myViaPointArg.Value + "'"));
}
RsInstructionArgument myWObjArgument = myMove.GetWObjArgument();
if (myWObjArgument != null)
{
Logger.AddMessage(new LogMessage("WObjArgument Name: '" + myWObjArgument.Name + "' Value: '" + myWObjArgument.Value + "'"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
ProcessTemplateName
Gets the name of the Process Template of the Move Instruction
Declaration
public string ProcessTemplateName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Examples
Get ProcessTemplateName
Project.UndoContext.BeginUndoStep("RsMoveInstructionProperties");
try
{
Station station = Station.ActiveStation;
// Create a move instruction in the constructor examples.
RsMoveInstruction myMove = (RsMoveInstruction)station.ActiveTask.FindPathProcedureFromModuleScope("myPath", "").Instructions[0];
// Set the color of the move instruction to yellow.
myMove.Color = Color.Yellow;
// Make the thickness of the move instruction twice as thick.
myMove.Thickness = myMove.Thickness * 2;
// Output some info regarding the move instruction.
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessDefinitionName '" + myMove.ProcessDefinitionName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessTemplateName '" + myMove.ProcessTemplateName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction '" + myMove.Name + "' has '" + myMove.InstructionArguments.Count + "' Instruction Arguments"));
RsInstructionArgument myCirPointArg = myMove.GetCirPointArgument();
if (myCirPointArg != null)
{
Logger.AddMessage(new LogMessage("CirPointArg Name: '" + myCirPointArg.Name + "' Value: '" + myCirPointArg.Value + "'"));
}
RsProcessTemplate myProcTempl = myMove.GetProcessTemplate();
if (myProcTempl != null)
{
Logger.AddMessage(new LogMessage("ProcessTemplate Name: '" + myProcTempl.Name + "' ActiveMotionType: '" + myProcTempl.ActiveMotionType + "'"));
}
RsInstructionArgument myToJointPosArg = myMove.GetToJointPosArgument();
if (myToJointPosArg != null)
{
Logger.AddMessage(new LogMessage("ToJointPosArg Name: '" + myToJointPosArg.Name + "' Value: '" + myToJointPosArg.Value + "'"));
}
RsInstructionArgument myToolArg = myMove.GetToolArgument();
if (myToolArg != null)
{
Logger.AddMessage(new LogMessage("ToolArg Name: '" + myToolArg.Name + "' Value: '" + myToolArg.Value + "'"));
}
RsInstructionArgument myToPointArg = myMove.GetToPointArgument();
if (myToPointArg != null)
{
Logger.AddMessage(new LogMessage("ToPointArgument Name: '" + myToPointArg.Name + "' Value: '" + myToPointArg.Value + "'"));
}
RsInstructionArgument myViaPointArg = myMove.GetViaPointArgument();
if (myViaPointArg != null)
{
Logger.AddMessage(new LogMessage("ViaPointArg Name: '" + myViaPointArg.Name + "' Value: '" + myViaPointArg.Value + "'"));
}
RsInstructionArgument myWObjArgument = myMove.GetWObjArgument();
if (myWObjArgument != null)
{
Logger.AddMessage(new LogMessage("WObjArgument Name: '" + myWObjArgument.Name + "' Value: '" + myWObjArgument.Value + "'"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
Reachable
Gets whether the robot can reach the target(s) in the Move Instruction.
Declaration
public ReachabilityState Reachable { get; set; }
Property Value
| Type | Description |
|---|---|
| ReachabilityState |
Remarks
The value is automatically updated when instruction or target properties change. This property is not undoable.
Thickness
Gets or sets the thickness (in pixels) of the line, in the graphics, leading to the the Move Instruction
Declaration
public double Thickness { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Examples
Get Thickness
Project.UndoContext.BeginUndoStep("RsMoveInstructionProperties");
try
{
Station station = Station.ActiveStation;
// Create a move instruction in the constructor examples.
RsMoveInstruction myMove = (RsMoveInstruction)station.ActiveTask.FindPathProcedureFromModuleScope("myPath", "").Instructions[0];
// Set the color of the move instruction to yellow.
myMove.Color = Color.Yellow;
// Make the thickness of the move instruction twice as thick.
myMove.Thickness = myMove.Thickness * 2;
// Output some info regarding the move instruction.
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessDefinitionName '" + myMove.ProcessDefinitionName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessTemplateName '" + myMove.ProcessTemplateName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction '" + myMove.Name + "' has '" + myMove.InstructionArguments.Count + "' Instruction Arguments"));
RsInstructionArgument myCirPointArg = myMove.GetCirPointArgument();
if (myCirPointArg != null)
{
Logger.AddMessage(new LogMessage("CirPointArg Name: '" + myCirPointArg.Name + "' Value: '" + myCirPointArg.Value + "'"));
}
RsProcessTemplate myProcTempl = myMove.GetProcessTemplate();
if (myProcTempl != null)
{
Logger.AddMessage(new LogMessage("ProcessTemplate Name: '" + myProcTempl.Name + "' ActiveMotionType: '" + myProcTempl.ActiveMotionType + "'"));
}
RsInstructionArgument myToJointPosArg = myMove.GetToJointPosArgument();
if (myToJointPosArg != null)
{
Logger.AddMessage(new LogMessage("ToJointPosArg Name: '" + myToJointPosArg.Name + "' Value: '" + myToJointPosArg.Value + "'"));
}
RsInstructionArgument myToolArg = myMove.GetToolArgument();
if (myToolArg != null)
{
Logger.AddMessage(new LogMessage("ToolArg Name: '" + myToolArg.Name + "' Value: '" + myToolArg.Value + "'"));
}
RsInstructionArgument myToPointArg = myMove.GetToPointArgument();
if (myToPointArg != null)
{
Logger.AddMessage(new LogMessage("ToPointArgument Name: '" + myToPointArg.Name + "' Value: '" + myToPointArg.Value + "'"));
}
RsInstructionArgument myViaPointArg = myMove.GetViaPointArgument();
if (myViaPointArg != null)
{
Logger.AddMessage(new LogMessage("ViaPointArg Name: '" + myViaPointArg.Name + "' Value: '" + myViaPointArg.Value + "'"));
}
RsInstructionArgument myWObjArgument = myMove.GetWObjArgument();
if (myWObjArgument != null)
{
Logger.AddMessage(new LogMessage("WObjArgument Name: '" + myWObjArgument.Name + "' Value: '" + myWObjArgument.Value + "'"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
Visible
Gets or sets if the graphical representation of this instruction should be visible.
Declaration
public bool Visible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
View SourceAfterLoad(PimDocument)
Declaration
protected override void AfterLoad(PimDocument doc)
Parameters
| Type | Name | Description |
|---|---|---|
| PimDocument | doc |
Overrides
View SourceGetAllRobTargets()
Gets all RsRobTargets referenced by the instruction.
Declaration
public IEnumerable<RsRobTarget> GetAllRobTargets()
Returns
| Type | Description |
|---|---|
| IEnumerable<RsRobTarget> |
GetCirPointArgument()
Gets the RsInstructionArgument corresponding to the CirPoint argument of the instruction.
Declaration
public RsInstructionArgument GetCirPointArgument()
Returns
| Type | Description |
|---|---|
| RsInstructionArgument | The RsInstructionArgument. |
Examples
GetCirPointArgument.
Project.UndoContext.BeginUndoStep("RsMoveInstructionProperties");
try
{
Station station = Station.ActiveStation;
// Create a move instruction in the constructor examples.
RsMoveInstruction myMove = (RsMoveInstruction)station.ActiveTask.FindPathProcedureFromModuleScope("myPath", "").Instructions[0];
// Set the color of the move instruction to yellow.
myMove.Color = Color.Yellow;
// Make the thickness of the move instruction twice as thick.
myMove.Thickness = myMove.Thickness * 2;
// Output some info regarding the move instruction.
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessDefinitionName '" + myMove.ProcessDefinitionName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessTemplateName '" + myMove.ProcessTemplateName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction '" + myMove.Name + "' has '" + myMove.InstructionArguments.Count + "' Instruction Arguments"));
RsInstructionArgument myCirPointArg = myMove.GetCirPointArgument();
if (myCirPointArg != null)
{
Logger.AddMessage(new LogMessage("CirPointArg Name: '" + myCirPointArg.Name + "' Value: '" + myCirPointArg.Value + "'"));
}
RsProcessTemplate myProcTempl = myMove.GetProcessTemplate();
if (myProcTempl != null)
{
Logger.AddMessage(new LogMessage("ProcessTemplate Name: '" + myProcTempl.Name + "' ActiveMotionType: '" + myProcTempl.ActiveMotionType + "'"));
}
RsInstructionArgument myToJointPosArg = myMove.GetToJointPosArgument();
if (myToJointPosArg != null)
{
Logger.AddMessage(new LogMessage("ToJointPosArg Name: '" + myToJointPosArg.Name + "' Value: '" + myToJointPosArg.Value + "'"));
}
RsInstructionArgument myToolArg = myMove.GetToolArgument();
if (myToolArg != null)
{
Logger.AddMessage(new LogMessage("ToolArg Name: '" + myToolArg.Name + "' Value: '" + myToolArg.Value + "'"));
}
RsInstructionArgument myToPointArg = myMove.GetToPointArgument();
if (myToPointArg != null)
{
Logger.AddMessage(new LogMessage("ToPointArgument Name: '" + myToPointArg.Name + "' Value: '" + myToPointArg.Value + "'"));
}
RsInstructionArgument myViaPointArg = myMove.GetViaPointArgument();
if (myViaPointArg != null)
{
Logger.AddMessage(new LogMessage("ViaPointArg Name: '" + myViaPointArg.Name + "' Value: '" + myViaPointArg.Value + "'"));
}
RsInstructionArgument myWObjArgument = myMove.GetWObjArgument();
if (myWObjArgument != null)
{
Logger.AddMessage(new LogMessage("WObjArgument Name: '" + myWObjArgument.Name + "' Value: '" + myWObjArgument.Value + "'"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
GetCirRobTarget()
Gets the RsRobTarget corresponding to the CirPoint argument of the instruction.
Declaration
public RsRobTarget GetCirRobTarget()
Returns
| Type | Description |
|---|---|
| RsRobTarget | A RsRobTarget if there is a CirPoint argument, otherwise null. |
GetProcessTemplate()
Gets the RsProcessTemplate corresponding to the to process template argument of the Move Instruction.
Declaration
public RsProcessTemplate GetProcessTemplate()
Returns
| Type | Description |
|---|---|
| RsProcessTemplate | The RsProcessTemplate. |
Examples
GetProcessTemplate.
Project.UndoContext.BeginUndoStep("RsMoveInstructionProperties");
try
{
Station station = Station.ActiveStation;
// Create a move instruction in the constructor examples.
RsMoveInstruction myMove = (RsMoveInstruction)station.ActiveTask.FindPathProcedureFromModuleScope("myPath", "").Instructions[0];
// Set the color of the move instruction to yellow.
myMove.Color = Color.Yellow;
// Make the thickness of the move instruction twice as thick.
myMove.Thickness = myMove.Thickness * 2;
// Output some info regarding the move instruction.
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessDefinitionName '" + myMove.ProcessDefinitionName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessTemplateName '" + myMove.ProcessTemplateName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction '" + myMove.Name + "' has '" + myMove.InstructionArguments.Count + "' Instruction Arguments"));
RsInstructionArgument myCirPointArg = myMove.GetCirPointArgument();
if (myCirPointArg != null)
{
Logger.AddMessage(new LogMessage("CirPointArg Name: '" + myCirPointArg.Name + "' Value: '" + myCirPointArg.Value + "'"));
}
RsProcessTemplate myProcTempl = myMove.GetProcessTemplate();
if (myProcTempl != null)
{
Logger.AddMessage(new LogMessage("ProcessTemplate Name: '" + myProcTempl.Name + "' ActiveMotionType: '" + myProcTempl.ActiveMotionType + "'"));
}
RsInstructionArgument myToJointPosArg = myMove.GetToJointPosArgument();
if (myToJointPosArg != null)
{
Logger.AddMessage(new LogMessage("ToJointPosArg Name: '" + myToJointPosArg.Name + "' Value: '" + myToJointPosArg.Value + "'"));
}
RsInstructionArgument myToolArg = myMove.GetToolArgument();
if (myToolArg != null)
{
Logger.AddMessage(new LogMessage("ToolArg Name: '" + myToolArg.Name + "' Value: '" + myToolArg.Value + "'"));
}
RsInstructionArgument myToPointArg = myMove.GetToPointArgument();
if (myToPointArg != null)
{
Logger.AddMessage(new LogMessage("ToPointArgument Name: '" + myToPointArg.Name + "' Value: '" + myToPointArg.Value + "'"));
}
RsInstructionArgument myViaPointArg = myMove.GetViaPointArgument();
if (myViaPointArg != null)
{
Logger.AddMessage(new LogMessage("ViaPointArg Name: '" + myViaPointArg.Name + "' Value: '" + myViaPointArg.Value + "'"));
}
RsInstructionArgument myWObjArgument = myMove.GetWObjArgument();
if (myWObjArgument != null)
{
Logger.AddMessage(new LogMessage("WObjArgument Name: '" + myWObjArgument.Name + "' Value: '" + myWObjArgument.Value + "'"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
GetToJointPosArgument()
Gets the RsInstructionArgument corresponding to the ToJointPos argument of the instruction.
Declaration
public RsInstructionArgument GetToJointPosArgument()
Returns
| Type | Description |
|---|---|
| RsInstructionArgument | The RsInstructionArgument. |
Examples
GetToJointPosArgument.
Project.UndoContext.BeginUndoStep("RsMoveInstructionProperties");
try
{
Station station = Station.ActiveStation;
// Create a move instruction in the constructor examples.
RsMoveInstruction myMove = (RsMoveInstruction)station.ActiveTask.FindPathProcedureFromModuleScope("myPath", "").Instructions[0];
// Set the color of the move instruction to yellow.
myMove.Color = Color.Yellow;
// Make the thickness of the move instruction twice as thick.
myMove.Thickness = myMove.Thickness * 2;
// Output some info regarding the move instruction.
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessDefinitionName '" + myMove.ProcessDefinitionName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessTemplateName '" + myMove.ProcessTemplateName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction '" + myMove.Name + "' has '" + myMove.InstructionArguments.Count + "' Instruction Arguments"));
RsInstructionArgument myCirPointArg = myMove.GetCirPointArgument();
if (myCirPointArg != null)
{
Logger.AddMessage(new LogMessage("CirPointArg Name: '" + myCirPointArg.Name + "' Value: '" + myCirPointArg.Value + "'"));
}
RsProcessTemplate myProcTempl = myMove.GetProcessTemplate();
if (myProcTempl != null)
{
Logger.AddMessage(new LogMessage("ProcessTemplate Name: '" + myProcTempl.Name + "' ActiveMotionType: '" + myProcTempl.ActiveMotionType + "'"));
}
RsInstructionArgument myToJointPosArg = myMove.GetToJointPosArgument();
if (myToJointPosArg != null)
{
Logger.AddMessage(new LogMessage("ToJointPosArg Name: '" + myToJointPosArg.Name + "' Value: '" + myToJointPosArg.Value + "'"));
}
RsInstructionArgument myToolArg = myMove.GetToolArgument();
if (myToolArg != null)
{
Logger.AddMessage(new LogMessage("ToolArg Name: '" + myToolArg.Name + "' Value: '" + myToolArg.Value + "'"));
}
RsInstructionArgument myToPointArg = myMove.GetToPointArgument();
if (myToPointArg != null)
{
Logger.AddMessage(new LogMessage("ToPointArgument Name: '" + myToPointArg.Name + "' Value: '" + myToPointArg.Value + "'"));
}
RsInstructionArgument myViaPointArg = myMove.GetViaPointArgument();
if (myViaPointArg != null)
{
Logger.AddMessage(new LogMessage("ViaPointArg Name: '" + myViaPointArg.Name + "' Value: '" + myViaPointArg.Value + "'"));
}
RsInstructionArgument myWObjArgument = myMove.GetWObjArgument();
if (myWObjArgument != null)
{
Logger.AddMessage(new LogMessage("WObjArgument Name: '" + myWObjArgument.Name + "' Value: '" + myWObjArgument.Value + "'"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
GetToJointTarget()
Gets the RsJointTarget corresponding to the ToJointPos argument of the instruction.
Declaration
public RsJointTarget GetToJointTarget()
Returns
| Type | Description |
|---|---|
| RsJointTarget |
GetToPointArgument()
Gets the RsInstructionArgument corresponding to the ToPoint argument of the instruction.
Declaration
public RsInstructionArgument GetToPointArgument()
Returns
| Type | Description |
|---|---|
| RsInstructionArgument | The RsInstructionArgument. |
Examples
GetToPointArgument.
Project.UndoContext.BeginUndoStep("RsMoveInstructionProperties");
try
{
Station station = Station.ActiveStation;
// Create a move instruction in the constructor examples.
RsMoveInstruction myMove = (RsMoveInstruction)station.ActiveTask.FindPathProcedureFromModuleScope("myPath", "").Instructions[0];
// Set the color of the move instruction to yellow.
myMove.Color = Color.Yellow;
// Make the thickness of the move instruction twice as thick.
myMove.Thickness = myMove.Thickness * 2;
// Output some info regarding the move instruction.
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessDefinitionName '" + myMove.ProcessDefinitionName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessTemplateName '" + myMove.ProcessTemplateName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction '" + myMove.Name + "' has '" + myMove.InstructionArguments.Count + "' Instruction Arguments"));
RsInstructionArgument myCirPointArg = myMove.GetCirPointArgument();
if (myCirPointArg != null)
{
Logger.AddMessage(new LogMessage("CirPointArg Name: '" + myCirPointArg.Name + "' Value: '" + myCirPointArg.Value + "'"));
}
RsProcessTemplate myProcTempl = myMove.GetProcessTemplate();
if (myProcTempl != null)
{
Logger.AddMessage(new LogMessage("ProcessTemplate Name: '" + myProcTempl.Name + "' ActiveMotionType: '" + myProcTempl.ActiveMotionType + "'"));
}
RsInstructionArgument myToJointPosArg = myMove.GetToJointPosArgument();
if (myToJointPosArg != null)
{
Logger.AddMessage(new LogMessage("ToJointPosArg Name: '" + myToJointPosArg.Name + "' Value: '" + myToJointPosArg.Value + "'"));
}
RsInstructionArgument myToolArg = myMove.GetToolArgument();
if (myToolArg != null)
{
Logger.AddMessage(new LogMessage("ToolArg Name: '" + myToolArg.Name + "' Value: '" + myToolArg.Value + "'"));
}
RsInstructionArgument myToPointArg = myMove.GetToPointArgument();
if (myToPointArg != null)
{
Logger.AddMessage(new LogMessage("ToPointArgument Name: '" + myToPointArg.Name + "' Value: '" + myToPointArg.Value + "'"));
}
RsInstructionArgument myViaPointArg = myMove.GetViaPointArgument();
if (myViaPointArg != null)
{
Logger.AddMessage(new LogMessage("ViaPointArg Name: '" + myViaPointArg.Name + "' Value: '" + myViaPointArg.Value + "'"));
}
RsInstructionArgument myWObjArgument = myMove.GetWObjArgument();
if (myWObjArgument != null)
{
Logger.AddMessage(new LogMessage("WObjArgument Name: '" + myWObjArgument.Name + "' Value: '" + myWObjArgument.Value + "'"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
GetToRobTarget()
Gets the RsRobTarget corresponding to the ToPoint argument of the instruction.
Declaration
public RsRobTarget GetToRobTarget()
Returns
| Type | Description |
|---|---|
| RsRobTarget |
GetToolArgument()
Gets the RsInstructionArgument corresponding to the to Tool argument of the instruction.
Declaration
public RsInstructionArgument GetToolArgument()
Returns
| Type | Description |
|---|---|
| RsInstructionArgument | The RsInstructionArgument. |
Examples
GetToolArgument.
Project.UndoContext.BeginUndoStep("RsMoveInstructionProperties");
try
{
Station station = Station.ActiveStation;
// Create a move instruction in the constructor examples.
RsMoveInstruction myMove = (RsMoveInstruction)station.ActiveTask.FindPathProcedureFromModuleScope("myPath", "").Instructions[0];
// Set the color of the move instruction to yellow.
myMove.Color = Color.Yellow;
// Make the thickness of the move instruction twice as thick.
myMove.Thickness = myMove.Thickness * 2;
// Output some info regarding the move instruction.
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessDefinitionName '" + myMove.ProcessDefinitionName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessTemplateName '" + myMove.ProcessTemplateName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction '" + myMove.Name + "' has '" + myMove.InstructionArguments.Count + "' Instruction Arguments"));
RsInstructionArgument myCirPointArg = myMove.GetCirPointArgument();
if (myCirPointArg != null)
{
Logger.AddMessage(new LogMessage("CirPointArg Name: '" + myCirPointArg.Name + "' Value: '" + myCirPointArg.Value + "'"));
}
RsProcessTemplate myProcTempl = myMove.GetProcessTemplate();
if (myProcTempl != null)
{
Logger.AddMessage(new LogMessage("ProcessTemplate Name: '" + myProcTempl.Name + "' ActiveMotionType: '" + myProcTempl.ActiveMotionType + "'"));
}
RsInstructionArgument myToJointPosArg = myMove.GetToJointPosArgument();
if (myToJointPosArg != null)
{
Logger.AddMessage(new LogMessage("ToJointPosArg Name: '" + myToJointPosArg.Name + "' Value: '" + myToJointPosArg.Value + "'"));
}
RsInstructionArgument myToolArg = myMove.GetToolArgument();
if (myToolArg != null)
{
Logger.AddMessage(new LogMessage("ToolArg Name: '" + myToolArg.Name + "' Value: '" + myToolArg.Value + "'"));
}
RsInstructionArgument myToPointArg = myMove.GetToPointArgument();
if (myToPointArg != null)
{
Logger.AddMessage(new LogMessage("ToPointArgument Name: '" + myToPointArg.Name + "' Value: '" + myToPointArg.Value + "'"));
}
RsInstructionArgument myViaPointArg = myMove.GetViaPointArgument();
if (myViaPointArg != null)
{
Logger.AddMessage(new LogMessage("ViaPointArg Name: '" + myViaPointArg.Name + "' Value: '" + myViaPointArg.Value + "'"));
}
RsInstructionArgument myWObjArgument = myMove.GetWObjArgument();
if (myWObjArgument != null)
{
Logger.AddMessage(new LogMessage("WObjArgument Name: '" + myWObjArgument.Name + "' Value: '" + myWObjArgument.Value + "'"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
GetToolData()
Gets the RsToolData corresponding to the to Tool argument of the instruction.
Declaration
public RsToolData GetToolData()
Returns
| Type | Description |
|---|---|
| RsToolData |
GetViaPointArgument()
Gets the RsInstructionArgument corresponding to the to ViaPoint argument of the Move Instruction.
Declaration
public RsInstructionArgument GetViaPointArgument()
Returns
| Type | Description |
|---|---|
| RsInstructionArgument | The RsInstructionArgument. |
Examples
GetViaPointArgument.
Project.UndoContext.BeginUndoStep("RsMoveInstructionProperties");
try
{
Station station = Station.ActiveStation;
// Create a move instruction in the constructor examples.
RsMoveInstruction myMove = (RsMoveInstruction)station.ActiveTask.FindPathProcedureFromModuleScope("myPath", "").Instructions[0];
// Set the color of the move instruction to yellow.
myMove.Color = Color.Yellow;
// Make the thickness of the move instruction twice as thick.
myMove.Thickness = myMove.Thickness * 2;
// Output some info regarding the move instruction.
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessDefinitionName '" + myMove.ProcessDefinitionName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessTemplateName '" + myMove.ProcessTemplateName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction '" + myMove.Name + "' has '" + myMove.InstructionArguments.Count + "' Instruction Arguments"));
RsInstructionArgument myCirPointArg = myMove.GetCirPointArgument();
if (myCirPointArg != null)
{
Logger.AddMessage(new LogMessage("CirPointArg Name: '" + myCirPointArg.Name + "' Value: '" + myCirPointArg.Value + "'"));
}
RsProcessTemplate myProcTempl = myMove.GetProcessTemplate();
if (myProcTempl != null)
{
Logger.AddMessage(new LogMessage("ProcessTemplate Name: '" + myProcTempl.Name + "' ActiveMotionType: '" + myProcTempl.ActiveMotionType + "'"));
}
RsInstructionArgument myToJointPosArg = myMove.GetToJointPosArgument();
if (myToJointPosArg != null)
{
Logger.AddMessage(new LogMessage("ToJointPosArg Name: '" + myToJointPosArg.Name + "' Value: '" + myToJointPosArg.Value + "'"));
}
RsInstructionArgument myToolArg = myMove.GetToolArgument();
if (myToolArg != null)
{
Logger.AddMessage(new LogMessage("ToolArg Name: '" + myToolArg.Name + "' Value: '" + myToolArg.Value + "'"));
}
RsInstructionArgument myToPointArg = myMove.GetToPointArgument();
if (myToPointArg != null)
{
Logger.AddMessage(new LogMessage("ToPointArgument Name: '" + myToPointArg.Name + "' Value: '" + myToPointArg.Value + "'"));
}
RsInstructionArgument myViaPointArg = myMove.GetViaPointArgument();
if (myViaPointArg != null)
{
Logger.AddMessage(new LogMessage("ViaPointArg Name: '" + myViaPointArg.Name + "' Value: '" + myViaPointArg.Value + "'"));
}
RsInstructionArgument myWObjArgument = myMove.GetWObjArgument();
if (myWObjArgument != null)
{
Logger.AddMessage(new LogMessage("WObjArgument Name: '" + myWObjArgument.Name + "' Value: '" + myWObjArgument.Value + "'"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
GetViaRobTarget()
Gets the RsRobTarget corresponding to the ViaPoint argument of the instruction.
Declaration
public RsRobTarget GetViaRobTarget()
Returns
| Type | Description |
|---|---|
| RsRobTarget | A RsRobTarget if there is a ViaPoint argument, otherwise null. |
GetWObjArgument()
Gets the RsInstructionArgument corresponding to the WObj argument of the instruction.
Declaration
public RsInstructionArgument GetWObjArgument()
Returns
| Type | Description |
|---|---|
| RsInstructionArgument | The RsInstructionArgument. |
Examples
GetWObjArgument.
Project.UndoContext.BeginUndoStep("RsMoveInstructionProperties");
try
{
Station station = Station.ActiveStation;
// Create a move instruction in the constructor examples.
RsMoveInstruction myMove = (RsMoveInstruction)station.ActiveTask.FindPathProcedureFromModuleScope("myPath", "").Instructions[0];
// Set the color of the move instruction to yellow.
myMove.Color = Color.Yellow;
// Make the thickness of the move instruction twice as thick.
myMove.Thickness = myMove.Thickness * 2;
// Output some info regarding the move instruction.
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessDefinitionName '" + myMove.ProcessDefinitionName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction has ProcessTemplateName '" + myMove.ProcessTemplateName + "'"));
Logger.AddMessage(new LogMessage("The Move Instruction '" + myMove.Name + "' has '" + myMove.InstructionArguments.Count + "' Instruction Arguments"));
RsInstructionArgument myCirPointArg = myMove.GetCirPointArgument();
if (myCirPointArg != null)
{
Logger.AddMessage(new LogMessage("CirPointArg Name: '" + myCirPointArg.Name + "' Value: '" + myCirPointArg.Value + "'"));
}
RsProcessTemplate myProcTempl = myMove.GetProcessTemplate();
if (myProcTempl != null)
{
Logger.AddMessage(new LogMessage("ProcessTemplate Name: '" + myProcTempl.Name + "' ActiveMotionType: '" + myProcTempl.ActiveMotionType + "'"));
}
RsInstructionArgument myToJointPosArg = myMove.GetToJointPosArgument();
if (myToJointPosArg != null)
{
Logger.AddMessage(new LogMessage("ToJointPosArg Name: '" + myToJointPosArg.Name + "' Value: '" + myToJointPosArg.Value + "'"));
}
RsInstructionArgument myToolArg = myMove.GetToolArgument();
if (myToolArg != null)
{
Logger.AddMessage(new LogMessage("ToolArg Name: '" + myToolArg.Name + "' Value: '" + myToolArg.Value + "'"));
}
RsInstructionArgument myToPointArg = myMove.GetToPointArgument();
if (myToPointArg != null)
{
Logger.AddMessage(new LogMessage("ToPointArgument Name: '" + myToPointArg.Name + "' Value: '" + myToPointArg.Value + "'"));
}
RsInstructionArgument myViaPointArg = myMove.GetViaPointArgument();
if (myViaPointArg != null)
{
Logger.AddMessage(new LogMessage("ViaPointArg Name: '" + myViaPointArg.Name + "' Value: '" + myViaPointArg.Value + "'"));
}
RsInstructionArgument myWObjArgument = myMove.GetWObjArgument();
if (myWObjArgument != null)
{
Logger.AddMessage(new LogMessage("WObjArgument Name: '" + myWObjArgument.Name + "' Value: '" + myWObjArgument.Value + "'"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
GetWorkObject()
Gets the RsWorkObject corresponding to the WObj argument of the instruction.
Declaration
public RsWorkObject GetWorkObject()
Returns
| Type | Description |
|---|---|
| RsWorkObject |
Highlight(Color)
Sets a temporary color of the graphical representation.
Declaration
public void Highlight(Color color)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | color |
JumpToAsync(bool)
Jumps the mechanism, of corresponding task, to the position of the move instruction. Optionally updates the joint values in the virtual controller. Updating the joint values in the controller is time consuning compared to only updating the Mechanism joint value. If you need to frequently call this method, it is recomended to update the joint values in the controller, only for the last call.
Declaration
public Task<bool> JumpToAsync(bool updateController)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | updateController | Specifies if the joint values in the controller shall be updated in addition to the joint values of the mechanism. |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if the operation is successful, otherwise false. |
Examples
View Source
JumpToAsync(bool, ConfigurationMode)
Jumps the mechanism, of corresponding task, to the position of the move instruction. Optionally updates the joint values in the virtual controller. Updating the joint values in the controller is time consuning compared to only updating the Mechanism joint value. If you need to frequently call this method, it is recomended to update the joint values in the controller, only for the last call.
Declaration
public Task<JumpResult> JumpToAsync(bool updateController, ConfigurationMode configurationMode)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | updateController | Specifies if the joint values in the controller shall be updated in addition to the joint values of the mechanism. |
| ConfigurationMode | configurationMode | Specifies how the arm configuration stored in the target shall be used. In this case this method returns true only if the mechanism can move to the specified target with its specified arm configuration. Only valid for RsRobTargets. |
Returns
| Type | Description |
|---|---|
| Task<JumpResult> | True if the operation is successful, otherwise false. |
Examples
View Source
MoveToAsync()
Moves the mechanism, of corresponding task, to the position of the move- instruction using its settings. A temporary RAPID program is created on the controller and is executed.
Declaration
public Task<bool> MoveToAsync()
Returns
| Type | Description |
|---|---|
| Task<bool> | True if the operation succeeded, false if there was an error executing the RAPID program. Any other error will raise an exception. |
Examples
MoveTo.
View Source
MoveToAsync(List<SyncLogMessage>)
Moves the mechanism, of corresponding task, to the position of the move- instruction using its settings. A temporary RAPID program is created on the controller and is executed. The temporary RAPID program is created by using RapidSync. The synchronization log is returned from this overload.
Declaration
public Task<bool> MoveToAsync(List<SyncLogMessage> logMessageList)
Parameters
| Type | Name | Description |
|---|---|---|
| List<SyncLogMessage> | logMessageList | The list of log messages from the underlying RapidSync operation. |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if the operation succeeded, false if there was an error executing the RAPID program. Any other error will raise an exception. |
Examples
MoveTo.
View Source
ResetHighlight()
Resets the graphical representation to the default color.
Declaration
public void ResetHighlight()