UnderAutomation
質問ですか?

[email protected]

お問い合わせ
UnderAutomation
⌘Q
Fanuc SDK documentation
Control inputs & outputs
Documentation home

Run a program remotely

Start, pause, abort, and monitor Fanuc programs remotely using Telnet, CGTP, SNPX system variables, or RMI.

Start, stop, pause, and abort TP programs remotely using different protocols.

Telnet KCL

Telnet provides the most complete program control through KCL commands:

using UnderAutomation.Fanuc;
using UnderAutomation.Fanuc.Telnet;
public class TelnetProgramControl
{
static void Main()
{
FanucRobot robot = new FanucRobot();
ConnectionParameters parameters = new ConnectionParameters("192.168.0.1");
parameters.Telnet.Enable = true;
parameters.Telnet.TelnetKclPassword = "TELNET_PASS";
robot.Connect(parameters);
/**/
// Run a program
robot.Telnet.Run("MyProgram");
// Pause (stops at next fine point)
robot.Telnet.Pause("MyProgram");
// Hold (decelerates and stops at current position)
robot.Telnet.Hold("MyProgram");
// Resume a paused or held program
robot.Telnet.Continue("MyProgram");
// Abort a program
robot.Telnet.Abort("MyProgram", force: true);
// Abort all running programs
robot.Telnet.AbortAll(force: true);
// Reset alarms (same as FAULT RESET button)
robot.Telnet.Reset();
// Clear program variables
robot.Telnet.ClearVars("MyProgram");
/**/
}
}

See also: Telnet Program control

CGTP Web Server

CGTP can run, select, pause, and abort programs, plus manage program properties:

using UnderAutomation.Fanuc;
using UnderAutomation.Fanuc.Cgtp;
public class CgtpPrograms
{
public static void Main()
{
FanucRobot robot = new FanucRobot();
ConnectionParameters parameters = new ConnectionParameters("192.168.0.1");
parameters.Cgtp.Enable = true;
robot.Connect(parameters);
/**/
// Run a program
robot.Cgtp.RunProgram("MY_PROGRAM");
// Run from a specific line
robot.Cgtp.RunProgram("MY_PROGRAM", lineNum: 10);
// Select a program
robot.Cgtp.SelectProgram("MY_PROGRAM");
// Abort a task
robot.Cgtp.AbortTask("MY_PROGRAM");
// Pause all programs
robot.Cgtp.PauseAllPrograms();
// Create a program
robot.Cgtp.CreateProgram(
progName: "NEW_PROG",
owner: "UnderAutomation",
comment: "Created via CGTP",
subType: CgtpProgramSubType.Job
);
// Delete a program
robot.Cgtp.DeleteProgram("OLD_PROG");
// Rename a program
robot.Cgtp.RenameProgram("OLD_NAME", "NEW_NAME");
// Read program properties
string comment = robot.Cgtp.GetProgramComment("MY_PROGRAM");
string owner = robot.Cgtp.GetProgramOwner("MY_PROGRAM");
bool ignorePause = robot.Cgtp.GetProgramIgnorePause("MY_PROGRAM");
// Write program properties
robot.Cgtp.SetProgramComment("MY_PROGRAM", "Updated comment");
robot.Cgtp.SetProgramSubType("MY_PROGRAM", CgtpProgramSubType.Macro);
/**/
}
}

See also: CGTP Program management

RMI

RMI sends TP-equivalent motion instructions directly, without selecting a program:

// Initialize the RMI_MOVE program
robot.Rmi.Initialize();
// Send motion commands with sequence IDs
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);
// Pause / Continue / Abort
robot.Rmi.Pause();
robot.Rmi.Continue();
robot.Rmi.Abort();

See also: RMI overview

SNPX (indirect)

Selecting the Target Program

Set the program name using the $SHELL_WRK.$CUST_NAME system variable. Do not include the .TP extension:

Starting the Program

Enable Remote Control

To allow external control, the system variable $RMT_MASTER must be set to 0.

Option 1: System Variable Start (Production Start Method = OTHER)

When Production Start Method is set to OTHER, trigger the start by setting $SHELL_WRK.$CUST_START to 1:

The controller automatically clears this bit once it acknowledges the command.

Option 2: UOP Cycle Start (Production Start Method = UOP)

This method uses UI (User Input) signals, providing additional control capabilities.

Step 1: Configure UI-to-Flag Mapping

Navigate to: MENU → I/O → UOP → select UI → CONFIG

Link UI signals to Flags (Rack 34, Slot 1):

ConfigurationResult
UI[1-8] → Rack 34, Slot 1, Start 1UI[1]=F[1], UI[2]=F[2], ... UI[8]=F[8]
UI[1-8] → Rack 34, Slot 1, Start 4UI[1]=F[4], UI[2]=F[5], ... UI[8]=F[11]
UI[6-6] → Rack 34, Slot 1, Start 9UI[6]=F[9]

Cold start the controller after configuration.

Step 2: Pulse the Cycle Start Flag

To start the program, pulse the corresponding flag to UI[6:Cycle Start]

Controlling Program Execution via UOP

The UOP interface provides comprehensive control through UI signals:

UI SignalNameFunctionCode Example
UI[2]HoldPause program executionrobot.Snpx.Flags.Write(2, false);
UI[4]Cycle StopStop the current cyclerobot.Snpx.Flags.Write(4, false);
UI[5]Fault ResetClear active alarmsrobot.Snpx.Flags.Write(5, true);
UI[6]Cycle StartStart/resume programrobot.Snpx.Flags.Write(6, true);
UI[18]Prod StartAlternative production startrobot.Snpx.Flags.Write(18, true);
// Clear any existing alarms
robot.Snpx.ClearAlarms();
// Enable remote control
robot.Snpx.IntegerSystemVariables.Write("$RMT_MASTER", 1);
// Select the program to run
string programName = "MY_PROGRAM";
robot.Snpx.StringSystemVariables.Write("$SHELL_WRK.$CUST_NAME", programName);
Console.WriteLine($"Selected program: {programName}");
// Start the program (using system variable method)
Console.WriteLine("Starting program...");
robot.Snpx.IntegerSystemVariables.Write("$SHELL_WRK.$CUST_START", 1); // or you can set the flag for UOP cycle start if that's your configured method

Protocol comparison

FeatureTelnetCGTPRMISNPX
Run programYesYes (V9.30+)Via motion commandsIndirect (variables)
PauseYes (Hold)YesYesNo
ContinueYesNoYesNo
AbortYesYesYesNo
Select/DeselectYesYesN/ANo
Create/DeleteNoYesNoNo

Universal Robots、Fanuc、Yaskawa、ABB、Staubli ロボットを .NET、Python、LabVIEW、または Matlab アプリケーションに簡単に統合

UnderAutomation
お問い合わせLegal

© All rights reserved.