How to Connect FANUC CNC Data to MQTT and a Dashboard via FOCAS or MTConnect: Step-by-Step

You know your FANUC controls support FOCAS. Now you need live data on a screen, from every machine, every shift, without anyone babysitting it.

This guide follows the sequence we use on FANUC installations, from the CNC settings screen to an OEE dashboard. If you have not yet checked which controls and options you have, start with FANUC FOCAS: controllers, protocols and available data.

What you will end up with

Each FANUC machine will publish to an MQTT broker:

  • Status: running, idle, stopped, alarm, emergency stop
  • Spindle: speed and load %, with trend history
  • Servo loads per axis, for crash and wear detection
  • Alarms: number, text, raised and cleared time
  • Part count and cycle time
  • Program number or name

Architecture in words

  1. FANUC CNCs on an isolated machine network, each with a static IP on the embedded Ethernet port.
  2. An edge gateway with one port on the machine network. It reads each CNC through FOCAS2 on TCP port 8193, and can optionally serve an MTConnect agent for other systems.
  3. An MQTT broker on the plant LAN, a local server, or in the cloud over TLS (Transport Layer Security).
  4. A monitoring platform subscribed to the broker, storing history and serving dashboards.

Data flows one way: CNC to gateway to broker to dashboard.

Step 1: Survey each machine

Item Where to find it
Control series (0i-D, 0i-F, 30i and so on) SYSTEM screen, or the control nameplate
Embedded Ethernet port present? Back of the CNC unit
Current IP settings Ethernet settings screen
Parts count parameter in use? Parameter 6711, check with the programmer
Machine builder signals of interest Ladder or I/O list from the machine builder

Step 2: Plan the network

Give each CNC a unique static IP on one subnet, for example 192.168.2.0/24, and give the gateway an address on the same subnet (we often use .100). Keep a sheet with machine name, control series, IP and FOCAS port.

Use shielded cable and route it away from spindle and servo power wiring.

Step 3: Configure Ethernet on the CNC

On most 0i-D, 0i-F and 30i-series controls the menu path is similar. Exact screens vary by series and software version.

  1. Go to SYSTEM, then the embedded Ethernet settings (often shown as EMBD ETH), then the COMMON page.
  2. Set the IP address and subnet mask.
  3. Check the active device. If it shows the PCMCIA card instead of Embedded, change it to Embedded.
  4. Select Execute to apply. Without Execute, nothing changes.
  5. Open the FOCAS2 page and confirm the TCP port (normally 8193) and the time interval.
  6. Restart the CNC if the screen asks for it.

On some machines, PMC online communication must also be enabled (PMC configuration, online settings, high-speed interface set to use) before certain PMC reads work.

Step 4: Test from a laptop

On a laptop on the same subnet:

ping 192.168.2.58
nmap -p 8193 192.168.2.58

If port 8193 shows open, the FOCAS service is listening. If ping works but the port is closed, recheck the active device, the FOCAS2 port and whether you pressed Execute.

Step 5: Build the tag list

Start with the data that drives decisions:

Data FOCAS source Poll
Run status, mode, alarm, e-stop Status information 200 ms to 1 s
Spindle load % Diagnostic 410 / load meter 1 s
Spindle speed Diagnostic 411 / actual speed 1 s
Servo loads, all axes Servo load meter 1 s
Program name Executing program On change
Alarms Alarm message read On status change
Part count Parameter 6711 2 s

Our gateways typically poll FANUC status at around 200 ms and analog values at 1 s. That catches short stops without loading the CNC.

Step 6: Configure the gateway logic

  • Status priority: emergency stop, then alarm, then running (automatic operation active), then idle, then offline (no FOCAS reply for 30 seconds).
  • Cycle time: start on the transition into automatic running, stop when the part counter increments. Ignore very short cycles caused by single-block or restart.
  • Part count: record increments, not raw values, so a reset on the CNC does not produce negative numbers.
  • Alarms: read the alarm list only when the status reports an alarm. This cuts load on the CNC.
  • Read-only: disable all FOCAS write functions in the gateway configuration.
  • Store and forward: buffer data when the broker is unreachable.

Step 7: Publish to MQTT

Keep one topic layout for every brand on the floor:

plant1/milling/vmc-fanuc-04/status
plant1/milling/vmc-fanuc-04/spindle
plant1/milling/vmc-fanuc-04/alarm

A status message:

{
  "ts": "2026-11-27T11:20:04.200+05:30",
  "state": "RUNNING",
  "program": "O2210",
  "spindle_load": 37,
  "spindle_rpm": 6000,
  "part_count": 418
}

Retain status messages so new subscribers see the current state. Use QoS (quality of service) 1 for alarms and cycle records.

If another system needs MTConnect, the gateway can also serve an MTConnect agent from the same FOCAS data, so you do not open a second connection to the CNC.

Step 8: Dashboard and OEE

  1. Set the shift calendar and planned breaks.
  2. Enter the ideal cycle time for each program.
  3. Add operator reason codes for stops and a simple reject entry.
  4. Set spindle-load alerts per tool or job, for example a warning above the normal band and an alarm far above it.
  5. Run one week alongside the manual log, then compare and correct.

Our virtual machine monitoring overview shows the kind of view you end up with.

Step 9: Secure it and hand it over

FOCAS is powerful. The same interface that reads spindle load can also write parameters and macro variables, so treat the machine network with care:

  • Keep the CNCs on their own subnet. Only the gateway connects to both the machine network and the plant LAN.
  • Block port 8193 on the plant firewall, so no office PC can reach a CNC directly.
  • Turn off remote write functions in the gateway, and protect the gateway’s own login with a strong password.
  • If you use remote support access, route it through the gateway with a VPN, never by port-forwarding to a CNC.

Then hand the system over properly. Name an owner in maintenance for the network and gateway, and an owner in production for reason codes and cycle standards. Keep the IP sheet and tag list in one shared document. Set an alert when a machine stays offline during a shift, so a loose cable is found in an hour, not a week.

Troubleshooting

  • Ping works, port 8193 closed. Active Ethernet device is PCMCIA, or the FOCAS2 settings were not executed.
  • Connection refused after working for days. The connection limit is reached. Find the other client (an old laptop, a DNC program) and close it.
  • Spindle load always zero. The diagnostic number differs on this spindle or drive. Check the maintenance manual for the machine.
  • Part count never changes. The machine builder does not use parameter 6711, or counts with a custom macro variable. Read that variable instead.
  • Status flickers during tool changes. Use the automatic operation state, not spindle speed, as the main status input.
  • Data stops at night. CNC powered down by the operator. Show it as “powered off”, not as a breakdown.

Conclusion

FANUC data acquisition is reliable once the basics are right: the embedded Ethernet device set and executed, FOCAS2 port confirmed, a short tag list, read-only gateway logic and clean MQTT topics. From there, the same dashboard can show your FANUC machines next to every other brand on the floor.

See the same process for Siemens CNC and PLCs, Haas machines, Mitsubishi CNC and PLCs and Delta PLCs over Modbus.

Want a hand with your FANUC machines? Book a free assessment. We will check your controls and network and show you what a gateway-based setup collects on day one.

Know More About Our CNC Machine Monitoring Software

Related Blogs