
Code Sample 1
A simple Hello Robot program.

Figure 1
The four main motion actions of the Hello Robot program (Code Sample 1) executed on an ABB IRB 1200 robot – MoveTo(400, 300, 500), Rotate(0, 1, 0, –90), Move(0, 0, 250) and AxesTo(0, 0, 0, 0, 90, 0).
Table 1
Main motion control actions in Machina.
| Instruction | Description | Related Action |
|---|---|---|
| Move/To | Change the position of the TCP maintaining its orientation. | ActionTranslation |
| Rotate/To | Change the orientation of the TCP maintaining it position. | ActionRotation |
| Transform/To | Change the position and orientation of the TCP. | ActionTransformation |
| Axes/To | Change the rotational values of the robot’s axes. | ActionAxes |
| ExternalAxis/To | Change the values of one the external axis attached to the robot. | ActionExternalAxis |
| Wait | Halt program execution for an amount of time. | ActionWait |
| DefineTool | Define Tool properties on the robot. | ActionDefineTool |
| Attach | Attach a Tool to the robot’s flange. | ActionAttach |
| Detach | Detach all tools from the robot. | ActionDetach |
| WriteDigital | Writes a value to a digital out. | ActionIODigital |
| WriteAnalog | Writes a value to an analog out. | ActionIOAnalog |
| Extrude | Turns extrusion on/off in 3D printers. | ActionExtrude |
| Message | Display a message on the device’s screen. | ActionMessage |
| Comment | Insert a custom comment on a compiled program. | ActionComment |
| CustomCode | Insert a custom line of code on a compiled program. | ActionCustomCode |
| Do | Applies an Action object to the Robot. | N/A |
Table 2
Main settings actions in Machina. Note that all state changes caused by these actions can be buffered and reverted with the use of PushSettings and PopSettings.
| Instruction | Description | Related Action |
|---|---|---|
| MotionMode | Set the motion type for future motion Actions, like linear or joint. | ActionMotion |
| Speed/To | Change the TCP speed value new Actions will be executed at. | ActionSpeed |
| Acceleration/To | Change the TCP acceleration value new Actions will be executed at. | ActionAcceleration |
| Precision/To | Change the TCP smoothing radius value new Actions will be executed at. | ActionPrecision |
| Temperature/To | Change the working temperature of one of the device’s parts. | ActionTemperature |
| ExtrusionRate/To | Change the extrusion rate of filament for 3D printers. | ActionExtrusionRate |
| PushSettings | Buffers current state settings. | ActionPushPop |
| PopSettings | Reverts the settings to the previous state buffered by PushSettings. | ActionPushPop |
Table 3
Main management methods in Machina. These instructions have no actions associated to them, as they are related to setup rather than execution.
| Instruction | Description | Related Action |
|---|---|---|
| Robot.Create | Create a new instance of a Robot object. | N/A |
| ControlMode | Sets the control type the robot will operate under, like offline or online. | N/A |
| ConnectionManager | Defines who is responsible for setting up the controller for connection, Machina or the user. | N/A |
| Connect | Connects to a remote controller. | N/A |
| Compile | Create a program in the device’s native language with all the buffered Actions. | N/A |

Figure 2
Overall architecture of the Machina.NET library and an extension sample for ABB robots.

Code Sample 2
Actions in the Hello Robot example stringified to a human-readable program.

Code Sample 3
Actions in the Hello Robot example serialized into instruction calls.

Code Sample 4
The Hello Robot example rewritten for offline mode.

Code Sample 5
The Hello Robot program compiled to RAPID language by the code in Code Sample 4.

Code Sample 6
The same Hello Robot program in Code Sample 4 compiled to URScript.

Figure 3
Sample scheme of a Machina application-driver communication exchange.

Figure 4
Life cycle of a Machina Action. MoveL represents a move instruction in the device native’s language executed by the driver.

Figure 5
Layered machine states. This diagram shows the different stages of asynchronous execution and Cursor representations for the Hello Robot program.

Code Sample 7
Whenever the robot has no pending actions left to execute, a new block of actions is issued, generating an infinite motion program.
| Device | Offline | Online |
|---|---|---|
| ABB Robots | Yes | Yes |
| Universal Robots | Yes | Yes |
| KUKA Robots | Yes | No |
| Zmorph 3D Printer | Yes | No |
