Fanuc SDK documentation
Members of Common.Kcl.ProgramCommandResult :
Program control via Telnet
Run, pause, hold, continue, and abort TP and Karel programs remotely using Telnet KCL commands.
Run, pause, hold, continue, and abort TP and Karel programs remotely using Telnet KCL commands.
Run, pause, hold, continue
// Run the default programrobot.Telnet.Run();// Run a specific programrobot.Telnet.Run("MyProgram");// Pause a running program (stops at the next fine point)robot.Telnet.Pause("MyProgram");// Force pause immediatelyrobot.Telnet.Pause("MyProgram", force: true);// Hold a program (stops at the current position)robot.Telnet.Hold("MyProgram");// Resume a paused or held programrobot.Telnet.Continue("MyProgram");
Pause stops at the next motion fine point. Hold decelerates the robot to stop at the current position.
Abort, clear, and reset
// Abort a specific programrobot.Telnet.Abort("MyProgram", force: true);// Abort all running programsrobot.Telnet.AbortAll(force: true);// Clear all programs from memoryrobot.Telnet.ClearAll();// Clear a specific programrobot.Telnet.ClearProgram("MyProgram");// Clear variables of a specific programrobot.Telnet.ClearVars("MyProgram");// Reset alarms and re-enable servo powerrobot.Telnet.Reset();
The Reset() command has the same effect as the FAULT RESET button on the operator panel. The error message remains displayed if the error condition still exists.
Complete example
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 programrobot.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 programrobot.Telnet.Continue("MyProgram");// Abort a programrobot.Telnet.Abort("MyProgram", force: true);// Abort all running programsrobot.Telnet.AbortAll(force: true);// Reset alarms (same as FAULT RESET button)robot.Telnet.Reset();// Clear program variablesrobot.Telnet.ClearVars("MyProgram");/**/}}
API reference
Members of Common.Kcl.RunResult :public class RunResult : ProgramCommandResult {public RunResult()// During implementation, return true if it is assumed that the frame has finished being received.protected override bool FromResult(string data)}
public class ProgramCommandResult : Result {public ProgramCommandResult()// Indicates that responses have been completed and receivedprotected override void EndReceive()// During implementation, return true if it is assumed that the frame has finished being received.protected override bool FromResult(string data)}