UnderAutomation
Any question?

[email protected]

Contact us
UnderAutomation
⌘Q

Debugging & breakpoints

Add, remove, and manage breakpoints on TP and Karel programs. Step through code line by line using Telnet KCL.

  • Breakpoints
  • Step-by-step execution and task info
  • Complete example
  • See also
  • API reference

The Fanuc SDK lets you add, remove, and manage breakpoints on TP and Karel programs. You can also step through code line by line, making it a powerful tool for remote debugging and prototyping a custom TP editor.

Breakpoints

parameters.Telnet.TelnetKclPassword = "TELNET_PASS";
robot.Connect(parameters);
// Add a breakpoint at line 10
robot.Telnet.AddBreakpoint("MyProgram", 10);
// List breakpoints
BreakpointsResult result = robot.Telnet.GetBreakpoints("MyProgram");
foreach (Breakpoint bp in result.Breakpoints)
{
Console.WriteLine($"Breakpoint at line {bp.Line}");
}
// Remove a single breakpoint
robot.Telnet.RemoveBreakpoint("MyProgram", 10);
// Remove all breakpoints of a program
robot.Telnet.RemoveAllBreakpoints("MyProgram");
}
}
Click to see the full code

Step-by-step execution and task info

When step mode is enabled, the program pauses after each line execution, allowing you to inspect state between instructions.

parameters.Telnet.TelnetKclPassword = "TELNET_PASS";
robot.Connect(parameters);
// Enable step mode for a task
robot.Telnet.StepOn("MyProgram");
// Disable step mode
robot.Telnet.StepOff();
// Get task information (current line, status, etc.)
TaskInformationResult info = robot.Telnet.GetTaskInformation("MyProgram");
}
}
Click to see the full code

Complete example

using UnderAutomation.Fanuc;
using UnderAutomation.Fanuc.Telnet;
public class TelnetDebugging
{
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);
// Add a breakpoint at line 10 of MyProgram
robot.Telnet.AddBreakpoint("MyProgram", 10);
// List all breakpoints
BreakpointsResult result = robot.Telnet.GetBreakpoints("MyProgram");
foreach (Breakpoint bp in result.Breakpoints)
{
Console.WriteLine($"Breakpoint at line {bp.Line}");
}
// Remove a single breakpoint
robot.Telnet.RemoveBreakpoint("MyProgram", 10);
// Remove all breakpoints
robot.Telnet.RemoveAllBreakpoints("MyProgram");
// Enable step-by-step execution
robot.Telnet.StepOn("MyProgram");
// Disable step mode
robot.Telnet.StepOff();
}
}

See also

  • TP editor with breakpoints : Build a custom TP editor with syntax highlighting and breakpoints

API reference

Class
BreakpointsResultinherits Result
C#Python

Result containing the breakpoints of a task.

MemberTypeDescription
BreakpointsResult()
Constructor
Breakpoints
Property
read only
Breakpoint[]
Gets the breakpoints set on the task.
EndReceive()
Method
void
Indicates that responses have been completed and received
FromResult(string)
Method
bool
During implementation, return true if it is assumed that the frame has finished being received.
ShouldCompleteOnEmptyAnswer()
Method
bool
Controls whether the result should be finalized when an empty answer is received (i.e. a frame consisting only of VT100 escape sequences and whitespace). Override and return false until meaningful data has been accumulated, to prevent premature finalization caused by intermediate display-update frames. Default is true (backward compatible: finalize immediately on empty answer).
Class
Breakpoint
C#Python

Represents a breakpoint set on a task line.

MemberTypeDescription
Breakpoint()
Constructor
Line
Property
read only
int
Gets the line number where the breakpoint is set.
Equals(object)
Method
bool
GetHashCode()
Method
int
ToString()
Method
string
Class
AddBreakpointResultinherits Result
C#Python

Result of adding a breakpoint.

MemberTypeDescription
AddBreakpointResult()
Constructor
FromResult(string)
Method
bool
During implementation, return true if it is assumed that the frame has finished being received.
Class
RemoveBreakpointResultinherits Result
C#Python

Result of removing a breakpoint.

MemberTypeDescription
RemoveBreakpointResult()
Constructor
FromResult(string)
Method
bool
During implementation, return true if it is assumed that the frame has finished being received.
Class
StepOnResultinherits Result
C#Python

Result of the step on command.

MemberTypeDescription
StepOnResult()
Constructor
FromResult(string)
Method
bool
During implementation, return true if it is assumed that the frame has finished being received.
Class
TaskInformationResultinherits Result
C#Python

Result of the show task command containing task properties.

MemberTypeDescription
TaskInformationResult()
Constructor
CurrentLine
Property
read only
int
Gets the current line number.
HoldConditions
Property
read only
string
Gets the hold conditions.
InvisibleTask
Property
read only
bool
Gets a value indicating whether the task is invisible.
ProgramType
Property
read only
ProgramType
Gets the type of the program.
RoutineName
Property
read only
string
Gets the name of the routine.
SystemTask
Property
read only
bool
Gets a value indicating whether the task is a system task.
TaskName
Property
read only
string
Gets the name of the task.
TaskNumber
Property
read only
int
Gets the task number.
TaskStatus
Property
read only
TaskStatus
Gets the task status.
TaskStatusStr
Property
read only
string
Gets the task status as a string.
FromResult(string)
Method
bool
Parses the result data and populates the properties of the class.
  • data : The result data as a string.
ToString()
Method
string

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

UnderAutomation
Contact usLegal

© All rights reserved.