Move robot remotely
Move a Fanuc robot from an external application using RMI motion commands, Stream Motion real-time streaming, or DPM with SNPX.
Move a Fanuc robot remotely using the SDK. There are several approaches depending on your application requirements.
RMI : TP-like motion commands
RMI (Remote Motion Interface) sends motion instructions similar to a TP program. Best for pick-and-place, welding paths, and multi-waypoint trajectories.
using System;using UnderAutomation.Fanuc;using UnderAutomation.Fanuc.Common;using UnderAutomation.Fanuc.Rmi.Data;using UnderAutomation.Fanuc.Rmi.TpInstructions;public class RmiMotion{static void Main(){FanucRobot robot = new FanucRobot();ConnectionParameters parameters = new ConnectionParameters("192.168.0.1");parameters.Rmi.Enable = true;robot.Connect(parameters);// Check statusRmiControllerStatusResponse status = robot.Rmi.GetStatus();if (status.TPEnabled){Console.WriteLine("Turn off the teach pendant before proceeding.");return;}if (!status.ServoReady){Console.WriteLine("Servos are not ready.");return;}// Initialize RMI_MOVErobot.Rmi.Initialize();// Set speed overriderobot.Rmi.SetOverride(80);// Move to a start positionrobot.Rmi.SendTpInstruction(new JointMotionJRepTpInstruction{SpeedType = RmiJointSpeedType.Percent,Speed = 10,TermType = RmiTerminationType.Fine,Joints = new JointsPosition(0, 0, 0, 0, 0, 0)}).WaitForCompletion();// Approachrobot.Rmi.SendTpInstruction(new LinearMotionTpInstruction{SpeedType = RmiLinearSpeedType.MmSec,Speed = 200,TermType = RmiTerminationType.Cnt,TermValue = 50,Target = new CartesianPositionWithUserFrame(500, 200, 350, 0, 90, 0, 1, 0)});// Descend to pick positionrobot.Rmi.SendTpInstruction(new LinearMotionTpInstruction{SpeedType = RmiLinearSpeedType.MmSec,Speed = 50,TermType = RmiTerminationType.Fine,Target = new CartesianPositionWithUserFrame(500, 200, 300, 0, 90, 0, 1, 0)}).WaitForCompletion();// Activate gripperrobot.Rmi.SendTpInstruction(new CallProgramTpInstruction { ProgramName = "GRIP_ON" }).WaitForCompletion();// Retractrobot.Rmi.SendTpInstruction(new LinearMotionTpInstruction{SpeedType = RmiLinearSpeedType.MmSec,Speed = 100,TermType = RmiTerminationType.Fine,Target = new CartesianPositionWithUserFrame(500, 200, 400, 0, 90, 0, 1, 0)}).WaitForCompletion();// Check HOLD stateif (robot.Rmi.IsInHoldState){Console.WriteLine("Controller in HOLD. Calling Reset...");robot.Rmi.Reset();}robot.Rmi.Abort();robot.Disconnect();}}
Requirements: J992 (Remote Motion Interface) robot option.
See also: RMI Motion commands
Stream Motion : Real-time streaming (J519)
Stream Motion sends joint or Cartesian positions at up to 250 Hz via UDP. Best for real-time control, force feedback, and adaptive paths.
// Connect and start streamingvar parameters = new ConnectionParameters("192.168.0.1");parameters.StreamMotion.Enable = true;robot.Connect(parameters);robot.StreamMotion.Start();// Send a joint commandrobot.StreamMotion.SendJointCommand(new MotionData{J1 = 0,J2 = -30,J3 = 45,J4 = 0,J5 = 60,J6 = 0});// React to state updates (~125–250 Hz)robot.StreamMotion.StateReceived += (s, e) =>{StatePacket state = e.State;// state.JointPosition, state.CartesianPosition, state.Status...};
Requirements: J519 (Stream Motion) robot option.
See also: Stream Motion
SNPX + DPM : Position register handshake
See : Move Robot with Mouse
FTP
If you have option ASCII Upload, you can build th TP program .ls file, download it via FTP and execute the task with Telnet, SNPX. or CGTP
See : TP editor with breakpoints
CGTP
CGTP allows you to create a new program, insert instructions, and execute it.