Skip to main content

Fanuc FOCAS (CNC)

FOCAS stands for Fanuc Open CNC API Specification. It is the de facto standard API for reading spindle load, axis positions, machining programs, alarms, and OEE metrics from Fanuc CNC (Computer Numerical Control) controllers. Machine tool OEMs like Mazak, DMG MORI, and Doosan expose the same interface when they adopt Fanuc as their controller.

Current status: stub driver (no direct communication)

The FOCAS driver in this gateway is a stub. The FOCAS wire protocol is proprietary, and Fanuc only distributes the FwLib (Focas Library) C library to licensed subscribers. We have no plans to embed native FwLib JNI into PlantPulse Edge, which aims for a single jar distribution.

Recommended integration path: Use an MTConnect Adapter (HTTP/XML) or the OPC UA option on newer Fanuc controllers.


Most modern machine tools and Fanuc CNCs adopt MTConnect (ANSI/MTC1.4) as their primary integration path. Fanuc provides its own FOCAS-MTConnect Adapter free of charge, and OEMs (Okuma, DMG MORI, Mazak SmartBox) follow the same standard.

PlantPulse driver to usePage
HTTP (REST polling; XML parsing via formula or in the reception pipeline)HTTP push

Option 2. Fanuc OPC UA option or KEPServerEX Fanuc Suite​

Newer Fanuc controllers expose an OPC UA Server as an additional option. For older controllers, use a commercial gateway such as Kepware KEPServerEX Fanuc Suite or Matrikon FOCAS OPC Server.

PlantPulse driver to usePage
OPCUAOPC UA

Option 3. Sidecar + gRPC (if you hold your own license)​

If you have an FwLib license, you can run your own JNI module as a separate sidecar process (e.g., focas-grpc-server) and have PlantPulse poll its output.


Which Option to Choose​

SituationRecommended
OEM (Mazak SmartBox / DMG MORI Celos / Okuma) already runs an MTConnect AgentMTConnect → HTTP
Newer Fanuc 30i with OPC UA option availableFanuc OPC UA → OPC UA
Older Fanuc 0i, licensed integrator availableKEPServerEX Fanuc Suite → OPC UA
Own FwLib license / custom data neededfocas-grpc sidecar → HTTP
Simple uptime (0/1) metric onlyController digital output → Modbus/Ethernet IO module

Common Data Items When Using MTConnect​

DataItems frequently registered from the /current / /sample response XML of the MTConnect agent.

DataItem nameMeaningPlantPulse format
Xact, Yact, ZactEach axis actual position (mm)Float
SspeedSpindle speed (rpm)Float
SloadSpindle load (%)Float
Sovr, FovrSpindle / feed override (%)Integer
executionExecuting state (ACTIVE / INTERRUPTED / READY)String
programCurrent program name (e.g., O1234)String
modeMANUAL / AUTOMATIC / MDIString
Tool_numberCurrent tool numberInteger
blockCurrent block (NC line)String
alarmAlarm code (e.g., PS 0506)String

Stub Registration (for reference)​

Input fieldWhat to enter
IP address(Not used, dummy)
Port8193 (FOCAS standard — dummy)
Automatic collectionDisabled recommended

Frequently Encountered Issues​

SymptomPossible causeSolution
No values after FOCAS registrationStub driverRe-register via MTConnect (HTTP) or KEPServerEX (OPC UA) path
MTConnect XML parsing is difficultXML namespace + multiple DataItemsXPath / formula post-processing in HTTP push
Spindle load stuck at 0Missing Sload mapping in the AdapterCheck Fanuc PMC settings — add axis_event in the Adapter config
Program name garbledFanuc controller encoding (e.g., Shift_JIS)Check charset option on the Adapter side
Alarm code shows only two digitsCondition category separation in MTConnectParse the <Condition> area of the XML separately
KEPServer license expiredKEPServerEX 7-day demoRenew license or purchase a permanent license

Next Steps​