How to Collect Data from CNC Machines: Fanuc, Siemens, and Mazak

Last updated: June 2026 · 11 min read

Your CNC Machine Is a Gold Mine of Data

Every CNC machine on your shop floor knows exactly what it's doing — spindle speed, axis positions, feed rate, tool life, alarm status, part count, cycle time. This data is sitting inside the controller, waiting to be extracted. The question is: how do you get it out?

The answer depends on which CNC controller you have. This guide covers the three most common controllers in mid-size factories: Fanuc, Siemens SINUMERIK, and Mazak, plus a universal approach for everything else.

Fanuc CNC: FOCAS Protocol

Fanuc is the world's most popular CNC controller, installed on millions of machines. Most modern Fanuc controllers (16i, 18i, 21i, 30i, 31i, 32i, 0i-D, 0i-F series) support FOCAS (Fanuc Open CNC API Specifications) — a built-in Ethernet communication library.

What You Can Read via FOCAS

How to Enable FOCAS

1
Check if FOCAS is enabled. On the CNC, go to SYSTEM → ETHPRM. If you see TCP/IP parameters, FOCAS is available. If not, you may need a Fanuc option license (typically $500-1500 from your machine builder).
2
Configure Ethernet. Set a static IP address on the CNC's Ethernet port. Note the port number (default: 8193 for FOCAS).
3
Connect the gateway. Plug an edge gateway into the same network switch. Configure the gateway with the CNC's IP address and select the Fanuc FOCAS driver.
4
Map data points. Select which FOCAS functions to poll. Start with: machine status (cnc_statinfo), alarm status (cnc_alarm), and part count (cnc_rdparam).

Common Gotchas

Siemens SINUMERIK: OPC UA Native

Siemens took a different approach. SINUMERIK 840D sl and ONE controllers have OPC UA built in — no extra hardware or licenses needed for basic data access.

What You Can Read via OPC UA

How to Enable OPC UA on SINUMERIK

1
Check firmware version. SINUMERIK 840D sl needs firmware 4.7+ for OPC UA. SINUMERIK ONE has it from the start.
2
Enable OPC UA server. In the SINUMERIK HMI: Setup → Network → OPC UA → Enable. Set security policy (we recommend "Sign & Encrypt" for production).
3
Configure access rights. Create user accounts with appropriate read permissions. Don't use the default admin account for data collection.
4
Connect via gateway. The gateway's OPC UA client connects to the SINUMERIK's OPC UA server. Browse the node tree and subscribe to the variables you need.

Advantages over Fanuc

Mazak: MTConnect + Smooth API

Mazak CNC machines support MTConnect — an open, royalty-free protocol specifically designed for manufacturing data collection.

How MTConnect Works

MTConnect uses HTTP/XML. A small agent (software) runs on the CNC or a connected PC, exposing machine data as a structured XML stream. Any system can request data by sending HTTP GET requests to the agent.

What You Can Read

Enabling MTConnect

Newer Mazak machines (SmoothX, SmoothG controllers) come with MTConnect agent pre-installed. For older machines, you may need to install the Mazak MTConnect adapter on a connected PC. The adapter communicates with the CNC via Mazak's proprietary protocol and exposes data via MTConnect.

Universal Approach: For Any CNC Controller

What if your CNC doesn't support FOCAS, OPC UA, or MTConnect? You still have options:

Option 1: Macro B Output

Many CNC controllers support custom macro programming. You can write a macro that outputs data (part count, cycle time, alarm codes) to a serial port or Ethernet socket at the end of each cycle. This works on virtually any CNC with macro capability.

Option 2: I/O Monitoring

Every CNC has digital I/O signals — machine ready, cycle start, cycle end, alarm. You can tap into these signals with a simple digital input module connected to a gateway. This gives you basic status monitoring without touching the CNC software.

Option 3: Current Sensing

A current transformer (CT) clamp on the spindle motor power cable can tell you when the machine is cutting, idle, or off. This is the least invasive method — no electrical connection to the CNC at all.

Choosing the Right Approach

Controller Best Method Data Richness Setup Difficulty
Fanuc 0i/16i/18i/30i FOCAS ⭐⭐⭐⭐⭐ ⭐⭐
Siemens SINUMERIK OPC UA ⭐⭐⭐⭐⭐ ⭐⭐
Mazak SmoothX/G MTConnect ⭐⭐⭐⭐
Any CNC (basic monitoring) I/O + Current ⭐⭐
Any CNC (full monitoring) Macro B Output ⭐⭐⭐ ⭐⭐⭐

Need Help Connecting Your CNC Machines?

Tell us your CNC controller model and we'll recommend the exact approach, hardware, and configuration — with remote setup support if needed.

Get Expert Advice →

Related Articles

FAQ

Q: Will data collection slow down my CNC?
No, if done correctly. FOCAS, OPC UA, and MTConnect are designed for background data extraction. Polling rates of 500ms-1s have zero impact on CNC performance. Avoid polling faster than 100ms.
Q: My Fanuc doesn't have FOCAS enabled. What do I do?
Contact your machine builder (OEM) to purchase the FOCAS option. Alternatively, use the I/O monitoring approach for basic status, or the Macro B approach for cycle data.
Q: Can I collect data from multiple CNC machines with one gateway?
Yes. A single edge gateway can typically connect to 10-50 CNC machines over Ethernet, depending on the data polling rate and number of data points per machine.
Q: Do I need to stop production to install data collection?
For Ethernet-based methods (FOCAS, OPC UA, MTConnect): no downtime needed. For I/O monitoring: a brief stop (10-15 minutes) to install current sensors or tap into digital signals.
Q: What about Heidenhain, Mitsubishi, or Haas controllers?
Heidenhain supports DNC/DCI protocol. Mitsubishi supports MELSEC communication. Haas supports MTConnect (newer models) or serial output. Each has its own approach — contact us with your specific controller model for detailed guidance.