Click or drag to resize

Debug output

Overview

It is possible to get debug output from the FlexPendant by using the network. This is useful for several reasons. It will reveal any exceptions thrown during execution, for example, providing you with error messages and call stacks. Moreover, it can help you check memory consumption and memory leaks in your application.

The FlexPendant message is packed into a network message and sent out on the network as a broadcast message on port 9998. Such a message can be picked up in different ways:

  • Connect a hub on the local FlexPendant network and connect a PC to it. Use nc.exe to pick up the messages (nc - lup 9998).

  • The messages sent are also stored in a ring-buffer of size 100kB. To read the buffer to file and store it on the controller, you can use the FlexPendant Command Server. Use fpcmd-"d" .

  • It is also possible to start a task on the controller that listens to port 9998 and displays all messages in the console buffer. Use command fp_enable_console_output

Tip Tip
For a list of exceptions that the IRC5 Controller may throw, see Debugging.
Enable debug output

To enable debug output write fpcmd_enable_console_output in the controller console window. For more information on console window, see Exception error codes.

These are the console commands used to enable and disable printouts:

Console command

Result

  • fpcmd_enable_console_output 1

  • fpcmd_enable_console_output 2

  • fpcmd_enable_console_output 3

Starts producing printouts from RobotWare to the robot controller console.Starts producing printouts from SDK application.Combines the two preceding: RobotWare + SDK printouts.

fpcmd_disable_console_output

Stops printout to the robot controller console.

The following command can be used to retrieve detailed status of the robot controller, which may be useful, although it may not be specifically related to your application.

Console command

Result

fpcmd “-d”

Produces a log file with extensive information on system status to the robot controller file system(hd0a/temp). Use an ftp client or the in RobotStudio to transfer the file to your PC.

FlexPendant Command Server

By using the command line on the controller you can send commands to the FlexPendant. The FlexPendant has a command server that interprets the commands and performs the requested operation. The syntax for command line commands is fpcmd “<command>” . The only command you need to remember is fpcmd "-h", which is the Help command. It produces a printout of available FlexPendant commands in the controller console:

fpcmd "-h" -> value = 8 = 0x8-> [fp]: FlexPendantCmd: Help

The following table lists the command with the specific actions:

Command

Action

fpcmd "-h"

Help

fpcmd "-a"

Adapter show routine

fpcmd "-m"

Measure time in adapters

fpcmd "-i"

Display FlexPendant Information

fpcmd "-f"

Bring GTPU Services to front

fpcmd "-x"

Hide startup progress bar

fpcmd "-s"

Start application

fpcmd "-d"

Copy Debug file to controller

fpcmd "-as"

Print screen

fpcmd "-rd"

Robot Communication Runtime debug

fpcmd "-restart"

Restart Device

fpcmd "-memshow"

Available memory

fpcmd "-module"

Module information of a process

fpcmd "-filePut"

Upload a file to the FlexPendant

fpcmd "-filleted"

Download a file to the FlexPendant

fpcmd "-diarist"

List a directory

Note Note

All commands support -? (for example fpcmd “-memShow -?”), which gives further information about the specific command.

Tip Tip

It is possible to monitor memory consumption in the robot controller console window:

  • Write fpcmd_enable_console_output

  • Write fpcmd "-memShow"

For more information, see Memory management.

Trace and Debug

The ABB.Robotics.Diagnostics namespace provides trace and debug services. Its Trace and Debug classes are specifically designed for the FlexPendant environment.

The properties and methods in the Trace class are used to instrument release builds, which allows you to monitor the health of your application running in a real-life setting. Tracing can help you to isolate problems and fix them without disturbing a running system.

If you use methods in the Debug class to print debugging information and check your logic with assertions, you can make your code more robust without impacting the performance and code size of your shipping product. In Visual Studio, creating a debug build enables Debug.

Trace and Debug give printout information during execution. Messages are displayed on the FlexPendant screen or in the robot controller console. The functionality is similar to that provided by the .Net Trace and Debug classes.

The Assert method checks for a condition and displays an assert message on the FlexPendant, including detailed information and a stack trace, if the condition is false. The message is also displayed in the controller console window if you enter the command fpcmd_enable_console_output first.

Note Note

Add the ABB.Robotics.Diagnostics namespace to the using section at the top of your source code file.