It is possible to add new instructions by right clicking a program or from the Program menu, as shown in the previous section.
This section describes the instructions supported by the RoboDK graphical user interface for robot offline programming.
Select Program➔
Unless a target is selected before adding the instruction, the movement instruction will create a new target and they will be linked. If the target is moved the movement is also modified.
If this is the first instruction that is added to the program, two more instructions will be added before the movement instruction: a Reference Frame selection and a Tool Frame selection. This will make sure that when the program reaches the movement instruction the robot is using the same reference and tool frames used to create this new target.

Select Program➔
Unless a target is selected before adding the instruction, the movement instruction will create a new target and they will be linked. If the target is moved the movement is also modified.
Joint Moves and Linear Moves behave the same way and can be easily switched from one type to the other.
Same as with the Joint Move Instruction, if this is the first instruction that is added to a program, two more instructions will be added before the movement instruction: a Reference Frame selection and a Tool Frame selection.
Contrary to Joint Movements, Linear Movements are sensitive to robot singularities and axis limits. For example, most robot arms can’t cross a singularity while performing a linear movement. The following image shows an example saying Joint 5 is too close to a singularity (0 degrees). Consider a Joint move instead.

If a linear move is not strictly necessary, right-click the movement instruction and change it to a Joint Move Instruction.

Alternatively, the target, the TCP or the position of the reference frame must be modified to avoid the singularity.
Select Program➔ 
The reference frame is a variable also known as Work Object (ABB robots), UFRAME (Fanuc robots), FRAME (for Motoman robots) or $BASE (for KUKA robots).

Select Program➔ 
The reference frame is a variable also known as ToolData (ABB robots), UTOOL (Fanuc robots), TOOL (for Motoman robots) or $TOOL (for KUKA robots).

Select Program➔
Unless two targets are selected before adding the instruction, the movement instruction will create no new targets. It is required to add two more targets separately and link them from the circular move instruction, as shown in the next image.

The circular path is an arc created from the point where the robot is located, passing through the first circular point (Target Linked 1) and ending at the end point (Target Linked 2).
Select Program➔
Activate the corresponding cases to impose a specific speed and/or acceleration in the program. The robot speed is applied from the moment this instruction is executed.
The robot speed can also be changed in the robot parameters menu: Double click the robot, then, select parameters.

Select Program➔

Select Program➔

Select Program➔
By default, this is a blocking call to a specific program. However, it is possible to switch to Insert Code to enter code specific at the location of this instruction. This might be useful for a specific application and a specific controller.


Switch from Program Call to Start Thread to provoke a non-blocking call to a sub program. In this case, the controller will start a new thread. This option is only available for certain controllers and only works for specific operations.
Select Program➔
The IO Name can be a number or a text value if it is a named variable. The IO Value can be a number (0 for False and 1 for True) or a text value if it is a named state.

Set to Wait for Digital Input to stop the program execution until a specific input changes to a specific value. Furthermore, most robot controllers support a timeout delay to raise an error if the waiting time exceeds a specific value. Check the Timeout (ms) option to activate this feature.

Altering simulated Digital Inputs and Digital Outputs will create new station variables. To check the state of these variables you can right click the station and select Station Parameters. It is also possible to read or modify these variables through the API.
Select Program➔
Without a rounding instruction, the robot will reach the speed of 0 at the end of each movement (unless the next movement is tangent with the previous movement). This will provoke high accelerations and quick speed changes to ensure the best accuracy for each movement.
This value is also known as Blending radius (Universal Robots), ZoneData (ABB robots), CNT/FINE (Fanuc robots), Cornering (Mecademic robots) or $APO.CDIS/$APO.CPTP/Advance (KUKA robots).

Some controllers require setting this value as a percentage, for example on a Fanuc controller, if you want to provide the command CNT5 you should enter the value 5.
You can also specify the rounding parameter in the Program Events window if you are generating your programs for robot machining, 3D printing or curve/point following.

You can create specific events meant for simulation by using a simulation event instruction. Simulation events have no impact on the real robot or the generated robot program.
Select Program➔Simulation Event Instruction to add a custom simulation event. This type of instruction will provoke a specific event only for simulation purposes, such as attaching one object to a gripper, dropping it to a table or creating objects to simulate a feeder.
You can use the user interface to trigger the actions as simulation events:
1.Attach an object to a tool.
2.Detach an object from a tool and drop it to a coordinate system.
3.Show one or more objects or tools.
4.Hide one or more objects or tools.
5.Set the absolute position of one or more objects or reference frames.
6.Set the relative position of one or more objects or reference frames.
7.Set the robot joints to home.
8.Move conveyor.
9.Create object.
10.Delete objects.
11.Wait for object.

By combining the right simulation events you can create simulations with the user interface for material handling or move objects through conveyors in the simulation as desired.

The attach object simulation event allows you to attach one object to a tool to simulate a pick action.
When the action to attach an object to a tool is triggered, the closest object to the selected tool will be attached. A default tolerance of 200 mm is used to ignore any objects farther than this distance.

If you don’t specify a distance tolerance, the global default value will be used (you can change the global default in Tools➔Options➔Maximum distance to attach an object to a robot tool). Also, by default, the distance is checked from the TCP location to the object reference. Alternatively, it is possible to use the distance between the TCP and the object geometry by selecting Check shortest distance between TCP and the object shape.
The detach object simulation event allows you to detach an object from a tool to another object or coordinate system.
You should choose the tool where the objects should be detached from and the coordinate system or object where the objects should be attached to afterwards.
The detach object simulation event allows you to simulate a place/drop operation in a plick and place application (performing the opposite action of the attach event).
For example, if the robot moves to a specific location to grab an object, we can set up an Attach object event to move that object together with the robot. Then, after the robot has moved and it is ready to drop the grabbed objects, you can trigger a Detach object event to leave any objects the robot tool has grabbed.

The show objects or tools event allows you to make one or more objects, tools or robots visible within the simulation environment.
You can select one or more items by holding the Ctrl key.

The Hide objects or tools event allows you to make one or more objects or tools invisible within the simulation.
You can select one or more items by holding the Ctrl key.

The Set object position (absolute) allows you to update the position of every object you selected when this action is triggered. The parent reference that each item is attached to is not modified. Only the position of each object is updated.
You can select one or more items by holding the Ctrl key. The current position of the item is recorded when you press OK.

The Set object position (relative) allows you to update the position and parent of every object you selected when this action is triggered. The parent reference that each item is attached to is also modified and the position of each object is also updated.
You can select one or more items by holding the Ctrl key. The current position of the item and the parent item it is attached to is recorded when you press OK.
The difference between this instruction and the absolute position instruction is that this instruction also updates the parent item that each object is attached to.

The set joints to home event triggers the selected robot or mechanisms to move to its defined "home" joint positions immediately (the movement is not simulated over time).
This is useful when you need to reset a simulation and place the conveyors at the start position.
You can select one or more items by holding the Ctrl key.

The move conveyor event simulates moving the conveyor by a specific distance, simulating the effect of the movement over time.
This is useful when you need to simulate a specific increment for processing an object on the conveyor once it moves a specific distance.

The Create object instruction allows you to simulate a feeder by creating a new object in the simulation environment.
You should select the model object to create and the parent reference where the items should be attached to.
This action is useful to create new objects in a conveyor.

The Delete objects instruction removes objects from the simulation environment.
You should select a model object that you would like to delete. Any object that matches the name and geometry of the same object is deleted when this action is triggered. The model object selected and any locked objects are not removed.
This instruction helps clean up a simulation that has finished and you have many objects that were created by the Create object instruction.

The Wait for object instruction waits for an object to be in contact with another object to trigger a specific action.
This event is useful when you want to trigger. It is common to place this instruction by itself in a program running in a loop that performs a specific action when an object is in contact with a sensor.

The actions you can perform when an object is in contact with the sensor are the following:
1.Stop a robot: you should select the robot or mechanism that should stop.
2.Delete an object: the object should be removed from the station.
3.Wait for the object only (for example, you can trigger a robot to pick an object).
4.Move an object to another coordinate system. For example, to attach an object from one conveyor to another.
