UnderAutomation
질문이요?

[email protected]

문의하기
UnderAutomation
⌘Q
Fanuc SDK documentation
Alarms, comments & files
Documentation home

SNPX overview

SNPX (also known as RobotIF or SRTP) is a high-speed protocol for reading and writing registers, variables, I/O signals, alarms, and positions in less than 2 ms.

SNPX (also known as RobotIF, Robot Interface, or SRTP) is a high-performance binary protocol for reading and writing data on a Fanuc robot controller in less than 2 ms.

Key features

  • Registers: Read/write numeric (R[]), position (PR[]), string (SR[]), and flag (F[]) registers
  • I/O signals: Read/write 13 digital signal types and 5 numeric I/O types
  • System variables: Read/write integer, real, position, and string variables
  • Current position: Read world and user frame positions for any group
  • Alarms: Read active alarm, alarm history, clear alarms
  • Task monitoring: Read running program status, line number, and caller
  • Batch reading: Read groups of data in a single command for maximum throughput
  • Comments: Read/write descriptions for registers and I/O

Quick example

using UnderAutomation.Fanuc;
using UnderAutomation.Fanuc.Common;
public class Snpx
{
static void Main()
{
// Create a new Fanuc robot instance
FanucRobot robot = new FanucRobot();
// Set connection parameters
ConnectionParameters parameters = new ConnectionParameters("192.168.0.1");
parameters.Snpx.Enable = true;
// Connect to the robot
robot.Connect(parameters);
/**/
// Read a register
Position posReg1 = robot.Snpx.PositionRegisters.Read(1);
float numReg5 = robot.Snpx.NumericRegisters.Read(5);
string strReg10 = robot.Snpx.StringRegisters.Read(10);
// Write a register
posReg1.CartesianPosition.X = 100;
robot.Snpx.PositionRegisters.Write(1, posReg1);
robot.Snpx.NumericRegisters.Write(2, 123.45f);
robot.Snpx.StringRegisters.Write(3, "Hello, world!");
// Read a variable
int rmtMaster = robot.Snpx.IntegerSystemVariables.Read("$RMT_MASTER");
string lastAlm = robot.Snpx.StringSystemVariables.Read("$ALM_IF.$LAST_ALM");
Position cellFloor = robot.Snpx.PositionSystemVariables.Read("$CELL_FLOOR");
// Write a system variable
robot.Snpx.IntegerSystemVariables.Write("$RMT_MASTER", 1);
robot.Snpx.StringSystemVariables.Write("$ALM_IF.$LAST_ALM", "No alarms");
robot.Snpx.PositionSystemVariables.Write("$CELL_FLOOR", cellFloor);
// Write a Karel program variable
robot.Snpx.IntegerSystemVariables.Write("$[KarelProgram]KarelVariable", 1);
// Read and Write I/O (SDI,SDO,RDI,RDO,UI,UO,SI,SO,WI,WO,WSI,PMC_K,PMC_R)
robot.Snpx.RDO.Write(1, true);
ushort ai5 = robot.Snpx.AI.Read(5);
// Read and Write analogs (AI,AO,GI,GO,PMC_D)
robot.Snpx.AO.Write(2, 5);
ushort ao3 = robot.Snpx.AO.Read(3);
// Clear alarms
robot.Snpx.ClearAlarms();
/**/
}
}

Differences with official Fanuc Robot Interface

Fanuc provides its own Robot Interface client (FRRJIF.DLL). Here are the main differences:

UnderAutomation SDKFanuc FRRJIF.DLL
PublisherUnderAutomationFanuc Ltd.
Technology100% managed .NET assemblyNative ActiveX / COM
DependenciesNo dependencies, single DLLRequires PCDK installation
Typical read time2 ms30 ms
Cross platformWindows, Linux, macOSWindows only
LanguagesC#, Python, LabVIEWCOM-compatible languages

Robot options

To enable SNPX on your robot, you need one of the following:

  • FANUC America (R650 FRA): Option R553 "HMI Device SNPX" is required
  • FANUC Ltd. (R651 FRL): No additional option needed

TCP port 60008 (Robot IF Server) must be accessible on your controller.

Performance

SNPX is the fastest protocol in the SDK. Regardless of the amount of data transported in a single command, execution time remains constant at approximately 2 ms.

For example, you can read 80 position registers in a single batch in the same time as reading a single variable.

When used with ROBOGUIDE, execution times under 1 ms can be achieved.

Connection

// Via FanucRobot
var robot = new FanucRobot();
var parameters = new ConnectionParameters("192.168.0.1");
parameters.Snpx.Enable = true;
robot.Connect(parameters);
// Or standalone
var snpx = new SnpxClient();
snpx.Connect("192.168.0.1");

Check if SNPX is available

Features features = robot.Ftp.GetSummaryDiagnostic().Features;
bool isSnpxAvailable = features.HasSnpx;

Next steps

  • Registers : R[], PR[], SR[], F[]
  • Inputs & Outputs : Digital and numeric signals
  • System variables : Integer, real, position, string variables
  • Current position : World and user frame positions
  • Alarms & task status : Alarm management and task monitoring
  • Batch reading : High-performance batch operations

Demonstration

You can download the Windows Forms Desktop project which implements all SNPX features from the download page.

SNPX

API reference

Members of Snpx.SnpxClient :
public class SnpxClient : SnpxClientBase {
// Initializes a new instance of the <xref href="UnderAutomation.Fanuc.Snpx.SnpxClient" data-throw-if-not-resolved="false"></xref> class.
public SnpxClient()
// Connects to a Fanuc robot using the SNPX protocol.
public void Connect(string ip, int port = 60008)
}
Members of Snpx.Internal.SnpxClientBase :
public class SnpxClientBase {
// Analog Inputs
public NumericIO AI { get; }
// Analog Outputs
public NumericIO AO { get; }
// Current active alarms
public AlarmAccess ActiveAlarm { get; }
// Alarm history
public AlarmAccess AlarmHistory { get; }
// Clear all active alarms
public void ClearAlarms()
// Clear all assignments
public void ClearAssignments()
// Comments of registers, I/O signals and other data
public Comments Comments { get; }
protected void ConnectInternal(string ip, int port = 60008)
// Indicates if the SNPX underlying TCP client is connected to the robot
public bool Connected { get; }
// Current position in world or user frame
public CurrentPosition CurrentPosition { get; }
// Current program tasks status. Index starts from 1.
public CurrentTaskStatus CurrentTaskStatus { get; }
// List of all digital signal accessors (SDI, SDO, RDI, RDO, ...)
public DigitalSignals[] DigitalSignals { get; }
// Disconnect from the robot
public void Disconnect()
// Flags
public Flags Flags { get; }
// Group Inputs
public NumericIO GI { get; }
// Group Outputs
public NumericIO GO { get; }
// Gets all current assignments.
public Assignment[] GetAssignments()
// Integer variables
public IntegerSystemVariables IntegerSystemVariables { get; }
// IP address of the connected robot.
public string Ip { get; }
// Controller language (default is English)
public Languages Language { get; set; }
// List of all Numeric IOs accessors (GI, GO, AI, AO, ...)
public NumericIO[] NumericIOs { get; }
// Number registers R[] as floating point values
public NumericRegisters NumericRegisters { get; }
// Number registers R[] as 16-bit integer values
public NumericRegistersInt16 NumericRegistersInt16 { get; }
// Number registers R[] as 32-bit integer values
public NumericRegistersInt32 NumericRegistersInt32 { get; }
// Programmable Machine Controller Data
public NumericIO PMC_D { get; }
// Programmable Machine Controller Constants
public DigitalSignals PMC_K { get; }
// Programmable Machine Controller Relays
public DigitalSignals PMC_R { get; }
// Checks the actual connection status via an active socket polling
public bool PollAndGetUpdatedConnectedState()
// Position registers
public PositionRegisters PositionRegisters { get; }
// Position variables
public PositionSystemVariables PositionSystemVariables { get; }
// Remote Digital Inputs
public DigitalSignals RDI { get; }
// Remote Digital Outputs
public DigitalSignals RDO { get; }
// Real variables
public RealSystemVariables RealSystemVariables { get; }
// Safety Digital Inputs
public DigitalSignals SDI { get; }
// Safety Digital Outputs
public DigitalSignals SDO { get; }
// System Inputs
public DigitalSignals SI { get; }
// System Outputs
public DigitalSignals SO { get; }
// Set boolean variable without assignments.
public void SetVariable(string name, bool value)
// Set double variable without assignments.
public void SetVariable(string name, double value)
// Set integer variable without assignments.
public void SetVariable(string name, int value)
// Set string variable without assignments.
public void SetVariable(string name, string value)
// I/O simulation status
public SimulationStatus SimulationStatus { get; }
// String registers
public StringRegisters StringRegisters { get; }
// String variables
public StringSystemVariables StringSystemVariables { get; }
// User Inputs
public DigitalSignals UI { get; }
// User Outputs
public DigitalSignals UO { get; }
// Weld Inputs
public DigitalSignals WI { get; }
// Weld Outputs
public DigitalSignals WO { get; }
// Weld System Inputs
public DigitalSignals WSI { get; }
}

Universal Robots, Fanuc, Yaskawa, ABB 또는 Staubli 로봇을 .NET, Python, LabVIEW 또는 Matlab 애플리케이션에 쉽게 통합

UnderAutomation
문의하기Legal

© All rights reserved.