RoboDK API for .Net
Simulate any application involving industrial robots with RoboDK. This example shows how to use the RoboDK API to integrate 3D simulations with any application. Simulation and offline programming can be accomplished directly from C# code. The RoboDK API allows creating simulations for industrial robots and generating vendor-specific programs. Whereas RoboDK's graphical user interface can be used to create programs, it is possible to extend the programming limitations of robot controllers by using a universal programming language such as C#.
With the RoboDK API for C# it is possible to simulate and program any industrial robot using C# programming language. This avoids using vendor-specific programming languages.
Note
This template is outdated. Use the NuGet package instead:
Documentation:
This template contains the RoboDK.cs file which is the implementation of the RoboDK API. This file defines the following classes:
The RoboDK API for C# is also available as a NuGet Package:
https://robodk.com/doc/en/CsAPI/index.html
The following link provides an overview of the RoboDK API for Python:
https://robodk.com/offline-programming
RoboDK can be used for a wide range of applications, such as 3D printing, robot machining, synchronizing multiple robots, pick and place...
Video Overview
The following video provides an overview of the RoboDK API for C#
https://www.youtube.com/watch?v=3I6OK1Kd2Eo
Requirements
RoboDK must be installed:
Install this template or download the sample project:
The RoboDK API does not require any specific library dependencies. The API is implemented using internal Socket communication.
The RoboDK API can be used with a free RoboDK license.
Example
The following script shows an example that uses the RoboDK package for robot simulation and offline programming::
// retrieve the reference frame and the tool frame (TCP)
Mat frame = ROBOT.PoseFrame();
Mat tool = ROBOT.PoseTool();
int runmode = RDK.RunMode(); // retrieve the run mode
// Program start
ROBOT.MoveJ(pose_ref);
ROBOT.setPoseFrame(frame); // set the reference frame
ROBOT.setPoseTool(tool); // set the tool frame: important for Online Programming
ROBOT.setSpeed(100); // Set Speed to 100 mm/s
ROBOT.setZoneData(5); // set the rounding instruction (C_DIS & APO_DIS / CNT / ZoneData / Blend Radius / ...)
ROBOT.RunInstruction("CallOnStart");
for (int i = 0; i <= n_sides; i++)
{
double angle = ((double) i / n_sides) * 2.0 * Math.PI;
Mat pose_i = pose_ref * Mat.rotz(angle) * Mat.transl(100, 0, 0) * Mat.rotz(-angle);
ROBOT.RunCodeCustom("Moving to point " + i.ToString(), RoboDK.INSTRUCTION_COMMENT);
double[] xyzwpr = pose_i.ToXYZRPW();
ROBOT.MoveL(pose_i);
}
ROBOT.RunInstruction("CallOnFinish");
ROBOT.MoveL(pose_ref);
The same script used for simulation can be used for offline programming, which means that the appropriate program can be generated for the robot being used. RoboDK supports a large number of robot controllers and it is easy to include compatibility for new robot controllers using Post Processors.
For more information about robot post processors:
For more Examples:
Other
A partial implementation of the RoboDK API for Visual Basic is also available:
Supported robots
The following list includes the robot controllers supported by RoboDK:
- ABB RAPID IRC5: for ABB IRC5 robot controllers
- ABB RAPID S4C: for ABB S4C robot controllers
- Adept Vplus: for Adept V+ programming language
- Allen Bradley Logix5000: for Allen Bradley Logix5000 PCL
- Comau C5G: for Comau C5G robot controllers
- CLOOS: for CLOOS robot controllers
- Denso PAC: for Denso RC7 (and older) robot controllers (PAC programming language)
- Denso RC8: for Denso RC8 (and newer) robot controllers (PacScript programming language)
- Dobot: for educational Dobot robots
- Fanuc R30iA: for Fanuc R30iA and R30iB robot controllers
- Fanuc R30iA Arc: for Fanuc Arc welding
- Fanuc RJ3: for Fanuc RJ3 robot controllers
- G-Code BnR: for B&R robot controllers
- GSK: for GSK robots
- HIWIN HRSS: for HIWIN robots
- KAIRO: for Keba Kairo robot controllers
- KUKA IIWA: for KUKA IIWA sunrise programming in Java
- KUKA KRC2: for KUKA KRC2 robot controllers
- KUKA KRC2 CamRob: for KUKA CamRob milling option
- KUKA KRC2 DAT: for KUKA KRC2 robot controllers including DAT data files
- KUKA KRC4: for KUKA KRC4 robot controllers
- KUKA KRC4 Config: for KUKA KRC4 robot controllers with configuration data in each line
- KUKA KRC4 DAT: for KUKA KRC4 robot controllers including DAT data files
- Kawasaki: for Kawasaki AS robot controllers
- Mecademic: for Mecademic Meca500 robot
- Mitsubishi: for Mitsubishi robot controllers
- Motoman: for Yaskawa/Motoman robot controllers (JBI Inform programs)
- Nachi AX FD: for Nachi AX and FD robot controllers
- Daihen OTC: for Daihen OTC robot controllers
- Precise: for Precise Scara robots
- Siemens Sinumerik: for Siemens Sinumerik ROBX robot controller
- Staubli VAL3: for Staubli VAL3 robot programs (CS8 controllers and later)
- Staubli VAL3 InlineMove: to generate Staubli VAL3 programs with inline movement data
- Staubli S6: for Staubli S6 robot controllers
- Toshiba: for Toshiba robots
- Universal Robots: for UR robots, generates linear movements as pose targets
- Universal Robots RobotiQ: for UR robots including support for RobotiQ gripper
- Universal Robots joints: for UR robots, generates linear movements as joint targets
- Yamaha: for Yamaha robots