2 - Fanuc Focas
Unlocking Factory Automation: The Definitive Guide to Fanuc FOCAS 2 In the race toward the "lights-out" factory and Industry 4.0, data is the new oil. For manufacturers using CNC machine tools, the single greatest bottleneck to digital transformation isn't hardware—it's communication. How do you extract real-time data from a 20-year-old machining center? How do you send a new program to 50 machines simultaneously without a USB stick? The answer, for the vast majority of the global manufacturing floor, lies in Fanuc FOCAS 2 . If you are a manufacturing engineer, an MES developer, or an IT manager in a machine shop, understanding FOCAS 2 is no longer optional. It is the key to unlocking visibility, predictive maintenance, and autonomous operation. What is Fanuc FOCAS 2? (The "Ethernet Handshake") First, let's decode the acronym. FOCAS stands for Fanuc Open CNC API Specification . Originally released as FOCAS1 (Library for CNC), the evolution to Fanuc FOCAS 2 represented a seismic shift. FOCAS 2 is the dynamic link library (DLL) and protocol set that allows external computers (PCs, servers, edge devices) to communicate directly with Fanuc CNCs (Series 0i, 15i, 16i, 18i, 21i, 30i, 31i, 32i, and Power Motion i) via standard Ethernet. Think of FOCAS 2 as the "universal translator" for your machine tools. It bridges the gap between the low-level, real-time CNC memory and high-level languages like C++, C#, Python, or VB.NET. FOCAS 1 vs. FOCAS 2: The Crucial Difference
FOCAS 1 relied on legacy hardware (RS-232 serial ports, HSSB). It was slow, prone to noise, and limited to short distances. Fanuc FOCAS 2 leverages Ethernet TCP/IP . This allows for high-speed data collection, remote file transfer, and connection to hundreds of machines over a standard network switch.
Why FOCAS 2 is the Backbone of Smart Manufacturing Without FOCAS 2, operators rely on the "windshield survey"—walking around the shop floor, staring at the green/yellow/red lights on machine pendants. With FOCAS 2, the machine becomes a data server. Here is what you can monitor in real-time using native FOCAS 2 functions: 1. Dynamic Machine Status (The "Now" Data)
Current Program Name & Line Number: Know exactly which tool is running and where it is in the cycle. Feed Rate & Spindle Load: Detect a dull tool instantly via load spikes or drops. Alarm History & Current Alarms: Get instant push notifications when a machine stops (e.g., "OT0501 Over Travel"). Mode Status: Is the machine in MEM (Auto), MDI, JOG, or HANDLE? fanuc focas 2
2. Performance & Quality Metrics (The "OEE" Data)
Part Counts: Automatically tally good parts vs. scrap. Cycle Times: Calculate Idle time, Running time, and Setup time automatically. Axis Positions (Absolute, Machine, Relative): Verify that critical dimensions are being machined correctly.
3. File Management (The "DNC" Bridge) FOCAS 2 completely modernizes Distributed Numerical Control (DNC). Unlocking Factory Automation: The Definitive Guide to Fanuc
Upload/Download .NC files: Push a new program to the CNC's internal memory or PCMCIA card. Directory Listing: Read the entire file catalog of the CNC without touching the pendant. Delete/Manage files: Clean up old programs remotely to free up memory.
The Architecture: How FOCAS 2 Works (Technically) For the developers and engineers in the room, understanding the stack is vital.
Physical Layer: Standard Ethernet (Cat5e/Cat6). Transport Layer: TCP/IP (Ports 8193 or 8192 typically, though configurable). Protocol: FOCAS 2 uses a proprietary, binary packet structure wrapped in Ethernet frames. It is not a web API (REST/SOAP). You cannot simply type a URL into a browser. Library: You must reference Fwlib32.dll (or the newer Fwlib64.dll ) in your project. How do you send a new program to
The Handshake Process
Initiate: The PC client calls cnc_allclibhndl3() to establish a handle to the CNC IP address. Authenticate: The CNC verifies the client (usually via a stored IP table or no authentication depending on security settings). Request: The client calls a function (e.g., cnc_rdstatus() to read machine status). Response: The CNC populates a structure with data (e.g., Status: Running, Alarm: 0 ). Terminate: cnc_freelibhndl() closes the connection.