Skip to main content

Fanuc FOCAS — CNC

FOCAS = 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 such as 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 distributes the FwLib (Focas Library) C library only to licensed subscribers. There is no plan to embed native FwLib JNI in 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; parse XML with a formula or in the ingest pipeline)HTTP push

Option 2. Fanuc OPC UA option or KEPServerEX Fanuc Suite

Newer Fanuc controllers expose an OPC UA Server as an add-on option. Older controllers can be converted using 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)

Sites holding an FwLib license can run their own JNI module as a separate sidecar process (for example focas-grpc-server) and have PlantPulse poll its output.


Which option to choose

SituationRecommendation
OEM (Mazak SmartBox / DMG MORI Celos / Okuma) already runs an MTConnect AgentMTConnect → HTTP
Newer Fanuc 30i, OPC UA option can be addedFanuc OPC UA → OPCUA
Older Fanuc 0i, licensed SI availableKEPServerEX Fanuc Suite → OPCUA
Own FwLib license / custom data requiredfocas-grpc sidecar → HTTP
Only a simple availability (0/1) metric is neededController digital output → Modbus/Ethernet IO module

Commonly used data items with MTConnect

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

DataItem nameMeaningPlantPulse type
Xact, Yact, ZactActual position of each axis (mm)Float
SspeedSpindle speed (rpm)Float
SloadSpindle load (%)Float
Sovr, FovrSpindle / feed override (%)Integer
executionExecution 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

Registering the stub (for reference)

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

Common problems

SymptomPossible causeResolution
No values after registering FOCASstub driverRe-register via the MTConnect (HTTP) or KEPServerEX (OPCUA) path
MTConnect XML is hard to parseXML namespace + multiple DataItemsPost-process with XPath / formula as described in HTTP push
Spindle load stuck at 0Missing Sload mapping in the AdapterCheck the Fanuc PMC settings — add axis_event to the Adapter config
Program name is garbledFanuc controller encoding (Shift_JIS, etc.)Check the charset option on the Adapter side
Alarm code shows only two digitsMTConnect splits condition categoriesParse the <Condition> section of the XML separately
KEPServer license expiredKEPServerEX 7-day demoRenew the license or purchase a permanent license

Next steps