FANUC FOCAS Ethernet Integration Guide
Read FANUC CNC controllers directly over FOCAS Ethernet: no adapter, no FOCAS library, no Windows host.
- Protocol
- FOCAS2/Ethernet, binary over TCP
- Default port
- 8193
- Operations
- Read · Status
- Writes
- None: read-only by construction
Read FANUC CNC controllers straight from MaestroHub over the controller's own Ethernet port. The connector speaks the FOCAS2/Ethernet protocol on TCP 8193 itself, so it needs no FOCAS adapter, no FANUC fwlib32 library and no Windows machine in between. One MaestroHub connection targets one CNC and holds one FOCAS session on it.
Overview
The FANUC FOCAS Ethernet connector provides:
- Direct connection: MaestroHub talks to the CNC; nothing to install next to it
- Machine status: run state, mode, motion, emergency stop and alarm, in one call or as single addresses
- Program and motion: running and main program numbers, actual feed rate, active spindle speed, absolute, relative and distance-to-go axis positions
- Macro variables and PMC memory: custom macro variables (an empty variable reads as
null, never0) and PMC areas as bits, bytes, words and double words - Batch reads with per-address errors: one bad address never fails the others
- The same addresses and results as the FANUC FOCAS (adapter) connector, so a pipeline moves between the two unchanged
The connector cannot change anything on the controller. It contains only read calls: there is no write, no program download and no parameter change, by construction.
Which FANUC connector should I use?
| FANUC FOCAS Ethernet (this connector) | FANUC FOCAS (adapter) | |
|---|---|---|
| What it needs | Network access to the CNC on TCP 8193 | The MaestroHub FOCAS Adapter on a Windows host, with your FANUC fwlib32 library |
| Reads | Yes | Yes |
| Writes (macros, PMC) | No | Yes |
| Change-pushed subscriptions | No: poll with a Schedule trigger | Yes |
| Machine position, alarm messages | Not yet | Through the adapter |
Choose this connector when reading is all you need and you would rather not run an adapter.
Supported controllers
FANUC CNCs with an Ethernet port and the FOCAS Ethernet function, such as the 0i, 16i/18i/21i and 30i/31i/32i series. The connector reads the controller's identity when it connects and reports it in the Status result.
FANUC has not published the FOCAS2/Ethernet protocol. The connector is built from public, independent descriptions of it, and every value is decoded strictly: a reply with a length or layout the connector does not recognise is reported as an UNSUPPORTED_ON_MODEL error for that address, never guessed. If a controller returns such errors for addresses it should support, contact MaestroHub support: they will send a small read-only capture tool whose output lets us add that controller.
Security
FOCAS Ethernet has no encryption and no authentication: anyone who can reach port 8193 can read the controller, and other software can write to it. Keep CNCs on an isolated machine network, and let only the MaestroHub host reach port 8193 through your firewall.
Connection Configuration
Creating a FANUC FOCAS Ethernet Connection
Navigate to Connections → New Connection → FANUC FOCAS Ethernet and fill in the form. It has four tabs: Connection, Functions, Scaling and Health. Functions, Scaling and Health unlock after the connection is saved.
1. Profile Information
| Field | Default | Description |
|---|---|---|
| Profile Name | - | A descriptive name for this connection profile (required, max 100 characters). Must be unique across all connections. |
| Description | - | Optional description for this connection |
| Labels | - | Key-value pairs to categorize and organize the connection (max 10 labels) |
2. CNC Settings
| Field | Default | Description |
|---|---|---|
| CNC Address | - | Host name or IP address of the CNC's Ethernet port (required) |
| Port | 8193 | The FOCAS Ethernet TCP port, set on the CNC's Ethernet setting screen |
| Connection Timeout | 5s | Maximum time to open the TCP connection, open the FOCAS session and read the controller identity |
Testing the Connection
Test Connection dials the CNC, opens a FOCAS session, reads the controller identity and closes the session again. It passes only when the CNC answered all three.
Function Builder
Creating FANUC FOCAS Ethernet Functions
Open the connection's Functions tab and choose New Function. There are two function types:
| Function | Operation | What it does |
|---|---|---|
| Read | fanuc_ethernet.read | Reads a list of addresses, each with its value or its own error |
| Status | fanuc_ethernet.status | Reads the controller identity and a machine snapshot in one call |
Read (fanuc_ethernet.read)
| Field | Required | Description |
|---|---|---|
| Addresses | Yes | One to 500 addresses (see Address Catalog). The Browse panel lists every address the connected controller offers; pick one to add it. |
| Timeout | No | Bound on this single read (30s, 5m) |
Each address comes back as one item in values, in the order requested:
{
"values": [
{ "address": "status.run", "value": "EXECUTING", "ts": "2026-11-03T10:00:00.120Z" },
{ "address": "macro.501", "value": null, "ts": "2026-11-03T10:00:00.125Z" },
{ "address": "axis.9.pos.abs", "error": { "code": "INVALID_ADDRESS", "message": "\"axis.9.pos.abs\": the controller has 3 axes" } }
]
}
A read where some addresses fail still succeeds, marked partial, with the failures named in its summary. Addresses answered by the same controller call (for example status.run and status.mode) share one round trip.
Status (fanuc_ethernet.status)
No fields besides the timeout. Returns:
{
"cncHost": "192.168.1.50",
"cnc": { "series": "G431", "version": "0010", "cncType": "31", "mtType": "M", "axisCount": 3, "maxAxis": 32 },
"snapshot": {
"run": "EXECUTING", "mode": "MEM", "motion": true, "estop": false, "alarm": false,
"runningProgram": 1234, "mainProgram": 100, "feedRate": 1500.0, "spindleSpeed": 3000.0
}
}
Run state and mode are required: without them there is no snapshot and the call fails. A snapshot field the controller refuses is left out and listed under unavailable with its error, so a missing value never reads as 0.
Testing Functions
Use Test Function on a function to run it once against the CNC and see the whole result.
Address Catalog
Addresses are dotted and case-insensitive, and contain no spaces. They are the FANUC FOCAS (adapter) connector's addresses, limited to what the direct connector reads.
| Address | Value | Notes |
|---|---|---|
cnc.series, cnc.version, cnc.cncType, cnc.mtType | text | Controller identity, as the CNC reports it |
cnc.axisCount, cnc.maxAxis | number | Controlled axes; most axes the controller supports |
status.run | text | STOPPED, HOLD, EXECUTING, MSTR or UNAVAILABLE |
status.mode | text | MDI, MEM, EDIT, HANDLE, JOG, TEACH, REMOTE or UNAVAILABLE |
status.motion, status.estop, status.alarm | true/false | An axis moving; emergency stop; any alarm present |
status.runCode, status.modeCode | number | The raw numbers behind status.run and status.mode |
program.running, program.main | number | Running and main program numbers |
feed.actual | number | Actual feed rate |
spindle.1.speed | number | Actual speed of the active spindle |
axis.<n>.pos.abs, .rel, .dtg | number | Absolute, relative position and distance to go of axis n (1 to the axis count) |
macro.<n> | number or null | Custom macro variable #n; null when the variable is empty |
pmc.<area>.<address>[.<type>] | number or true/false | PMC memory; see below |
alarm.bits | number | Alarm-type bitfield; 0 when no alarm is present |
Numbers carry their own scale on the wire (the controller reports the decimal places with each value), so positions, feed and macros need no decimal-places setting.
PMC addresses
pmc.<area>.<address>[.<type>], for example pmc.G.0.bit3, pmc.R.100 or pmc.D.200.word:
<area>:G,F,Y,X,A,R,T,K,C,D,M,N,EorZ<address>: the byte address within the area,0to65535<type>:bit0tobit7(true/false),byte(0 to 255, the default),word(signed 16-bit) ordword(signed 32-bit)
PMC float and the machine position (pos.mach) are not readable over the direct connection yet; reading them returns INVALID_ADDRESS with that explanation.
Error Codes
| Code | Meaning |
|---|---|
INVALID_ADDRESS | The address is not in the catalog, or the controller refused its number (an axis it does not have, a macro number out of range, a PMC address outside the area). Nothing is sent for an address the connector can refuse itself. |
UNSUPPORTED_ON_MODEL | The controller does not offer this data (the function or option is missing), or answered in a layout the connector does not recognise |
BUSY | The controller was busy; the next read usually succeeds |
INTERNAL | Any other refusal; the message carries the controller's return code |
A broken or silent connection fails the whole read and the connection reconnects; values are never returned from a read that did not complete.
Pipeline Integration
Each function type has its node in the Pipeline Designer, under FANUC FOCAS Ethernet: FANUC FOCAS Ethernet Read and FANUC FOCAS Ethernet Status. See the FANUC FOCAS Ethernet nodes for their outputs. To read on a timer, start the pipeline with a Schedule trigger.
Common Use Cases
Machine status to a dashboard or the UNS
Poll Status every few seconds with a Schedule trigger and publish the snapshot to the UNS, so every dashboard reads one current machine state.
Production counting from macro variables
Many part programs count parts in a macro variable. Read macro.<n> on a schedule and write it to a historian; an empty variable arrives as null, so a reset program never looks like a count of zero.
OEE inputs
status.run, status.alarm and program.running together give availability and the running job; feed.actual and spindle.1.speed show whether the machine is cutting.
Troubleshooting
Connection Issues
| Symptom | Cause and fix |
|---|---|
| Test Connection times out | The CNC is unreachable: check the address, the port (CNC Ethernet setting screen) and any firewall between MaestroHub and the CNC |
| "the CNC did not open a FOCAS session" | Either the FOCAS Ethernet function is not enabled on the CNC, or every FOCAS session is in use (MES, DNC or monitoring software hold them). The two look the same on the wire: check the CNC's Ethernet settings, and close sessions held by other software. |
| Works, then fails after a few minutes | Another program may be taking the last FOCAS session when MaestroHub reconnects; one MaestroHub connection holds exactly one session |
Read Issues
| Symptom | Cause and fix |
|---|---|
INVALID_ADDRESS on an axis | The address names an axis above the controller's axis count (see cnc.axisCount) |
UNSUPPORTED_ON_MODEL on an address the controller should support | The controller answered in a layout the connector does not recognise yet. Contact MaestroHub support for the capture tool. |
A macro reads null | The variable is empty on the controller (it shows blank on the macro screen) |
FANUC and FOCAS are trademarks of FANUC Corporation. MaestroHub is not affiliated with or endorsed by FANUC; this connector is compatible with FANUC CNCs that provide FOCAS Ethernet.