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.

**C# : RmiMotion**
```csharp
using UnderAutomation.Fanuc;
using UnderAutomation.Fanuc.Rmi.Data;

public class RmiMotion
{
    public static void Main()
    {
        FanucRobot robot = new FanucRobot();

        ConnectionParameters parameters = new ConnectionParameters("192.168.0.1");
        parameters.Rmi.Enable = true;

        robot.Connect(parameters);
        robot.Rmi.Initialize();

        /**/
        Frame target = new Frame { X = 500, Y = 200, Z = 300, W = 0, P = 90, R = 0 };
        MotionConfiguration config = new MotionConfiguration { UToolNumber = 1, UFrameNumber = 0 };

        // Linear motion
        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
        );

        // Joint motion
        robot.Rmi.JointMotion(
            sequenceId: 2,
            config: config,
            position: target,
            speedType: SpeedType.Percent,
            speed: 50,
            termType: TerminationType.Cnt,
            termValue: 100,
            acc: null, offsetPr: null, visionPr: null, mrot: false,
            lcbType: null, lcbValue: null, portType: null, portNumber: null, portValue: null
        );

        // Joint motion with joint angles
        JointAngles joints = new JointAngles { J1 = 0, J2 = 0, J3 = 0, J4 = 0, J5 = -90, J6 = 0 };
        robot.Rmi.JointMotionJRep(
            sequenceId: 3,
            joints: joints,
            speedType: SpeedType.Percent,
            speed: 50,
            termType: TerminationType.Cnt,
            termValue: 100,
            acc: null, offsetPr: null, visionPr: null, mrot: false,
            lcbType: null, lcbValue: null, portType: null, portNumber: null, portValue: null
        );

        // Circular motion (via point + destination)
        Frame via = new Frame { X = 450, Y = 250, Z = 350, W = 0, P = 90, R = 0 };
        MotionConfiguration viaConfig = new MotionConfiguration { UToolNumber = 1, UFrameNumber = 0 };
        robot.Rmi.CircularMotion(
            sequenceId: 4,
            config: config,
            position: target,
            viaConfig: viaConfig,
            viaPosition: via,
            speedType: SpeedType.MmSec,
            speed: 50,
            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
        );

        // Wait for digital input
        robot.Rmi.WaitDin(sequenceId: 10, portNumber: 5, value: OnOff.ON);

        // Wait for a duration
        robot.Rmi.WaitTime(sequenceId: 11, seconds: 2.0);

        // Set payload schedule
        robot.Rmi.SetPayload(sequenceId: 12, scheduleNumber: 1);
        /**/
    }
}
```

**Python : RmiMotion**
```python
from underautomation.fanuc.fanuc_robot import FanucRobot
from underautomation.fanuc.connection_parameters import ConnectionParameters
from underautomation.fanuc.rmi.data.speed_type import SpeedType
from underautomation.fanuc.rmi.data.termination_type import TerminationType
from underautomation.fanuc.rmi.data.on_off import OnOff
from underautomation.fanuc.rmi.data.frame import Frame
from underautomation.fanuc.rmi.data.motion_configuration import MotionConfiguration
from underautomation.fanuc.rmi.data.joint_angles import JointAngles

# Create a robot instance
robot = FanucRobot()

# Configure connection parameters
parameters = ConnectionParameters("192.168.0.1")
parameters.rmi.enable = True

# Connect to the robot
robot.connect(parameters)
robot.rmi.initialize()

##
target = Frame()
target.x = 500
target.y = 200
target.z = 300
target.w = 0
target.p = 90
target.r = 0

config = MotionConfiguration()
config.u_tool_number = 1
config.u_frame_number = 0

# Linear motion
robot.rmi.linear_motion(
    sequence_id=1,
    config=config,
    position=target,
    speed_type=SpeedType.MM_SEC,
    speed=100,
    term_type=TerminationType.FINE,
    term_value=0
)

# Joint motion
robot.rmi.joint_motion(
    sequence_id=2,
    config=config,
    position=target,
    speed_type=SpeedType.PERCENT,
    speed=50,
    term_type=TerminationType.CNT,
    term_value=100
)

# Joint motion with joint angles
joints = JointAngles()
joints.j1 = 0
joints.j2 = 0
joints.j3 = 0
joints.j4 = 0
joints.j5 = -90
joints.j6 = 0

robot.rmi.joint_motion_j_rep(
    sequence_id=3,
    joint_angles=joints,
    speed_type=SpeedType.PERCENT,
    speed=50,
    term_type=TerminationType.CNT,
    term_value=100
)

# Wait for digital input
robot.rmi.wait_din(sequence_id=10, port_number=5, value=OnOff.ON)

# Wait for a duration
robot.rmi.wait_time(sequence_id=11, seconds=2.0)

# Set payload schedule
robot.rmi.set_payload(sequence_id=12, schedule_number=1)
##
```

**Requirements**: J992 (Remote Motion Interface) robot option.

See also: [RMI Motion commands](/fanuc/documentation/rmi-motion)

## 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.

**C# : MoveRobotRemotelyStreamMotion**
```csharp
using System;
using UnderAutomation.Fanuc;
using UnderAutomation.Fanuc.StreamMotion;
using UnderAutomation.Fanuc.StreamMotion.Data;

public class MoveRobotRemotelyStreamMotion
{
    static void Main()
    {
        FanucRobot robot = new FanucRobot();

        /**/
        // Connect and start streaming
        var parameters = new ConnectionParameters("192.168.0.1");
        parameters.StreamMotion.Enable = true;
        robot.Connect(parameters);
        robot.StreamMotion.Start();

        // Send a joint command
        robot.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...
        };
        /**/
    }
}
```

**Python : MoveRobotRemotelyStreamMotion**
```python
from underautomation.fanuc.fanuc_robot import FanucRobot

robot = FanucRobot()

##
# Connect and start streaming
robot.stream_motion.connect("192.168.0.1")
robot.stream_motion.start()

# Send a joint command
robot.stream_motion.send_joint_command(j1=0, j2=-30, j3=45, j4=0, j5=60, j6=0)

# React to state updates (~125-250 Hz)
def on_state_received(sender, e):
    state = e.State
    # state.joint_position, state.cartesian_position, state.status...

robot.stream_motion.state_received += on_state_received
##
```

**Requirements**: J519 (Stream Motion) robot option.

See also: [Stream Motion](/fanuc/documentation/stream-motion)

## SNPX + DPM : Position register handshake

See : [Move Robot with Mouse](/fanuc/documentation/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](/fanuc/documentation/tp-editor-with-breakpoints)

## CGTP

CGTP allows you to create a new program, insert instructions, and execute it.