UnderAutomation
Any question?

[email protected]

Contact us
UnderAutomation
⌘Q
Fanuc SDK documentation
Diagnostics & variables
Documentation home

RMI overview

RMI (Remote Motion Interface) is a TCP-based protocol for sending motion commands, managing frames, and controlling the robot remotely.

  • Key features
  • Quick example
  • Robot options
  • How it works
  • Connection
  • Initialize
  • Next steps
  • API reference

RMI (Remote Motion Interface) is a TCP-based protocol that allows you to send TP-like motion commands and admin operations to a Fanuc robot in real-time.

Key features

  • Motion commands: Linear, joint, and circular motions with full TP parameters (speed, termination, acceleration)
  • Admin operations: Initialize, abort, pause, continue, reset, set override
  • Position reading: Current Cartesian position, joint angles, TCP speed
  • Frame management: Read/write user frames (UFrame) and tools (UTool)
  • I/O: Read digital inputs, write digital outputs
  • Position registers: Read and write position registers
  • Status monitoring: Controller status, servo readiness, TP mode

Quick example

using UnderAutomation.Fanuc;
using UnderAutomation.Fanuc.Common;
using UnderAutomation.Fanuc.Rmi.Data;
public class Rmi
{
static void Main()
{
// Create a new Fanuc robot instance
FanucRobot robot = new FanucRobot();
// Set connection parameters
ConnectionParameters parameters = new ConnectionParameters("192.168.0.1");
parameters.Rmi.Enable = true;
// Connect to the robot
robot.Connect(parameters);
/**/
// Initialize RMI_MOVE program
int result = robot.Rmi.Initialize();
// Get the robot status
ControllerStatus s = robot.Rmi.GetStatus();
// Read digital input
DigitalInputValue din2 = robot.Rmi.ReadDIN(2);
// Read the current Cartesian position
UnderAutomation.Fanuc.Rmi.Data.CartesianPosition pose = robot.Rmi.ReadCartesianPosition();
// Set override speed (1-100%)
robot.Rmi.SetOverride(50);
// Send a linear motion command
Frame target = new Frame { X = 500, Y = 200, Z = 300, W = 0, P = 90, R = 0 };
MotionConfiguration config = new MotionConfiguration { UToolNumber = 1, UFrameNumber = 0 };
robot.Rmi.LinearMotion(
sequenceId: 1,
config: config,
position: target,
speedType: SpeedType.MmSec,
speed: 100,
termType: TerminationType.Fine,
termValue: 0,
acc: null, offsetPr: null, visionPr: null, wristJoint: false, mrot: false,
lcbType: null, lcbValue: null, portType: null, portNumber: null, portValue: null
);
/**/
}
}

Robot options

RMI requires the Remote Motion Interface (J992) option on your Fanuc robot. The bootstrap port is 16001 (TCP).

How it works

  1. Connect to the robot on port 16001 (bootstrap port)
  2. The controller assigns a working port for the session
  3. Call Initialize() to create and start the RMI_MOVE TP program
  4. Send motion instructions (linear, joint, circular) with sequence IDs
  5. The robot executes instructions in order and returns acknowledgements
  6. Call Abort() or Disconnect() when done

Connection

// Via FanucRobot
var parameters = new ConnectionParameters("192.168.0.1");
parameters.Rmi.Enable = true;
robot.Connect(parameters);
// Or standalone
var rmi = new RmiClient();
rmi.Connect("192.168.0.1");
// Initialize RMI_MOVE program
int result = robot.Rmi.Initialize();
// 0 = OK, -2 = Servo not ready, -3 = TP enabled

Initialize

Before sending motion commands, you must initialize the RMI_MOVE program.

Next steps

  • Motion commands : Linear, joint, circular motions
  • Frames, I/O & status : Frame management, I/O, position reading

API reference

Members of Rmi.RmiClient :
public class RmiClient : RmiClientBase, IDisposable {
// Creates a new instance of the RMI client.
public RmiClient()
// Connect to the FANUC controller using the RMI protocol.
public void Connect(string ip, int port = 16001, int readTimeoutMs = 3000, int writeTimeoutMs = 3000)
}
Members of Rmi.Internal.RmiClientBase :
public abstract class RmiClientBase : IDisposable {
// Creates a new instance of the RMI client.
public RmiClientBase()
// Abort RMI_MOVE.
public void Abort()
// Add a circular motion (via and destination).
public RmiSequenceResponse CircularMotion(int sequenceId, MotionConfiguration config, Frame position, MotionConfiguration viaConfig, Frame viaPosition, SpeedType speedType, short speed, TerminationType termType, byte termValue, byte? acc, short? offsetPr, short? visionPr, bool wristJoint, bool mrot, string lcbType, short? lcbValue, PortType? portType, short? portNumber, OnOff? portValue)
// Add an incremental circular motion.
public RmiSequenceResponse CircularRelative(int sequenceId, MotionConfiguration config, Frame delta, MotionConfiguration viaConfig, Frame viaDelta, SpeedType speedType, short speed, TerminationType termType, byte termValue, byte? acc, short? offsetPr, short? visionPr, bool wristJoint, bool mrot, string lcbType, short? lcbValue, PortType? portType, short? portNumber, OnOff? portValue)
// Connect to the controller on the bootstrap port (16001), request the working port, then switch to it.
protected void ConnectInternal(string host, int port, int readTimeoutMs, int writeTimeoutMs)
// Indicates that the client is currently connected to the controller working port.
public bool Connected { get; }
// Resume RMI_MOVE.
public void Continue()
// Disconnect from the controller by sending FRC_Disconnect on the working port.
public void Disconnect()
// Dispose and disconnect
public void Dispose()
// Get controller status and RMI state.
public ControllerStatus GetStatus()
// Get current UFRAME/UTOOL numbers.
public UFrameUToolNumbers GetUFrameUTool()
// Send the initialize command to create and start RMI_MOVE. Must be called before sending instruction packets.
public int Initialize()
// Add a joint motion.
public RmiSequenceResponse JointMotion(int sequenceId, MotionConfiguration config, Frame position, SpeedType speedType, short speed, TerminationType termType, byte termValue, byte? acc, short? offsetPr, short? visionPr, bool mrot, string lcbType, short? lcbValue, PortType? portType, short? portNumber, OnOff? portValue)
// Add a joint-motion with joint representation.
public RmiSequenceResponse JointMotionJRep(int sequenceId, JointAngles joints, SpeedType speedType, short speed, TerminationType termType, byte termValue, byte? acc, short? offsetPr, short? visionPr, bool mrot, string lcbType, short? lcbValue, PortType? portType, short? portNumber, OnOff? portValue)
// Add an incremental joint motion.
public RmiSequenceResponse JointRelative(int sequenceId, MotionConfiguration config, Frame delta, SpeedType speedType, short speed, TerminationType termType, byte termValue, byte? acc, short? offsetPr, short? visionPr, bool mrot, string lcbType, short? lcbValue, PortType? portType, short? portNumber, OnOff? portValue)
// Add an incremental joint-motion with joint representation.
public RmiSequenceResponse JointRelativeJRep(int sequenceId, JointAngles deltaJoints, SpeedType speedType, short speed, TerminationType termType, byte termValue, byte? acc, short? offsetPr, short? visionPr, bool mrot, string lcbType, short? lcbValue, PortType? portType, short? portNumber, OnOff? portValue)
// Add a linear motion.
public RmiSequenceResponse LinearMotion(int sequenceId, MotionConfiguration config, Frame position, SpeedType speedType, short speed, TerminationType termType, byte termValue, byte? acc, short? offsetPr, short? visionPr, bool wristJoint, bool mrot, string lcbType, short? lcbValue, PortType? portType, short? portNumber, OnOff? portValue)
// Add an incremental linear motion.
public RmiSequenceResponse LinearRelative(int sequenceId, MotionConfiguration config, Frame delta, SpeedType speedType, short speed, TerminationType termType, byte termValue, byte? acc, short? offsetPr, short? visionPr, bool wristJoint, bool mrot, string lcbType, short? lcbValue, PortType? portType, short? portNumber, OnOff? portValue)
// Controller protocol major version reported during FRC_Connect.
public short MajorVersion { get; }
// Controller protocol minor version reported during FRC_Connect.
public short MinorVersion { get; }
// Pause RMI_MOVE.
public void Pause()
// Read current Cartesian position.
public CartesianPosition ReadCartesianPosition()
// Read a digital input port value.
public DigitalInputValue ReadDIN(short portNumber)
// Read the most recent error text.
public ControllerErrorText ReadError()
// Read current joint angles.
public JointAnglesSample ReadJointAngles()
// Read a position register.
public PositionRegisterData ReadPositionRegister(short number)
// Read current TCP speed.
public TcpSpeed ReadTcpSpeed()
// Gets or sets the read timeout for TCP operations (milliseconds).
public int ReadTimeoutMs { get; }
// Read a UFRAME.
public IndexedFrame ReadUFrame(byte number)
// Read a UTOOL.
public IndexedFrame ReadUTool(byte number)
// Reset controller errors and exit HOLD state.
public void Reset()
// Set program override (1-100).
public void SetOverride(byte value)
// Add PAYLOAD[n].
public RmiSequenceResponse SetPayload(int sequenceId, byte scheduleNumber)
// Add UFRAME_NUM = n.
public RmiSequenceResponse SetUFrameInstruction(int sequenceId, byte frameNumber)
// Set current UFRAME and UTOOL numbers.
public void SetUFrameUTool(byte uframe, byte utool)
// Add UTOOL_NUM = n.
public RmiSequenceResponse SetUToolInstruction(int sequenceId, byte toolNumber)
// Add WAIT DI[x] = ON/OFF.
public RmiSequenceResponse WaitDin(int sequenceId, short portNumber, OnOff value)
// Add WAIT t (sec).
public RmiSequenceResponse WaitTime(int sequenceId, double seconds)
// Working port returned by the controller; all commands use this port after connection.
public int WorkingPort { get; }
// Write a digital output port value.
public void WriteDOUT(short portNumber, OnOff value)
// Write a position register.
public void WritePositionRegister(short number, MotionConfiguration cfg, Frame frame)
// Gets or sets the write timeout for TCP operations (milliseconds).
public int WriteTimeoutMs { get; }
// Write a UFRAME.
public void WriteUFrame(byte number, Frame frame)
// Write a UTOOL.
public void WriteUTool(byte number, Frame frame)
}

Easily integrate Universal Robots, Fanuc, Yaskawa, ABB or Staubli robots into your .NET, Python, LabVIEW or Matlab applications

UnderAutomation
Contact usLegal

© All rights reserved.