FANUC control state and load over FOCAS2 right in the chat
Connect FANUC CNCs over FOCAS2 to the AI agent: state, mode, alarms, program and part count. The agent works out how long each machine ran and stood idle in a shift.
How the agent works with FANUC FOCAS
A FANUC control sits on the site's network, so the gateway reaches it: a program installed on a computer on the same network. The gateway is added on the Gateways tab and assigned to the connection. The connection takes the control address, for example tcp://10.0.12.5:8193, and if needed the library file and a tag list. While there is no link outside, the gateway keeps the data on disk.
FOCAS is FANUC's library, not an open network protocol, so the gateway does not talk to port 8193 itself but calls the library from your site's FOCAS2 package: FANUC lets only buyers of the package ship it. The library is loaded in a separate helper process for each round, and a crash or hang inside it ends only that round while the gateway's other connections keep reading.
Only read calls of the library are declared: the gateway has no parameter or PMC writes, no program download and no control commands. The agent reads status, program, spindle, feed, axes, parameters, macro variables and PMC, but changes nothing in the control. The state word comes from run and motion by the same rules as FANUC's MTConnect adapter, so one control reads the same by either path.
The control is polled every Scan interval (1000 ms by default), and an answer is awaited up to the Timeout (3000 ms by default). If the control lacks a function or option, that value arrives with the FOCAS refusal code while the other tags keep reading. The gateway does not read alarm texts: it sees the alarm flag, the alarm mask and the emergency stop. History builds up from the moment of connection.
Integration scenarios
How the machines are now
The agent shows each control with its state word (running, interrupted, stopped, idle), its mode and the alarm and emergency stop flags.
Running and downtime per shift
The agent takes state observations for a period and works out how long the control ran a program, sat in HOLD or waited.
Program and parts
The agent reads the name and number of the running and main program and the part count and shows how many parts were added over a period.
Spindle and feed
The agent collects the history of spindle speed and load and actual feed in intervals: minimum, maximum and average.
Axis positions
The agent shows the absolute and machine coordinates of every axis the control names, with its decimal places.
Macro variables and PMC
The agent reads the macro variables, parameters and PMC addresses you list, such as a door closed bit or a cycle counter.
FANUC FOCAS examples
Из 4 стоек дольше всех работала №2: 6 ч 50 мин из 8.
- №1 простояла 2 ч 10 мин в HOLD после аварии
- №3 и №4 работали больше 6 часов каждая
- Счётчик деталей за смену прибавил 186
Состояние читаю по FOCAS2 через библиотеку FANUC на компьютере шлюза.
How to connect
Before you connect
- A FANUC control with FOCAS2 over embedded Ethernet, TCP port 8193
- The FANUC library from your FOCAS2 package (A02B-0207-K737)
- A computer on the site's network for the gateway, matching the library's bitness
- Network access to the control from the gateway computer
- Server admits listed addresses only? Allow connections from 158.160.205.91 and 87.228.27.163.
- 1
Put the FANUC library on the gateway
Copy Fwlib64.dll with its fwlib*.dll files (Windows) or libfwlib32.so (Linux) from your FOCAS2 package into the focas folder in the gateway's data.
- 2
Check the library's bitness
The library must match the gateway program's bitness. A file of another bitness is refused before anything starts, with its path named.
- 3
Open port 8193 to the control
The FOCAS2 library talks to the control's embedded Ethernet on TCP 8193. The gateway computer must reach the control at that address and port.
- 4
Add your own tags if needed
With no list the gateway reads status, program, spindle, feed, parts and axes. Add a parameter, macro variable (#500) or PMC address as a line: path, address, type.
FAQ
Install the gateway on a computer on the site's network and add it on the Gateways tab. Copy the library from your FOCAS2 package into the focas folder in the gateway's data, and in the connection enter the control address, for example tcp://10.0.12.5:8193.
Without a tag list: status, mode, the alarm and emergency stop flags, program name and number, spindle speed and load, actual feed, part count, the control model and axis positions. With a list: parameters, macro variables and PMC addresses as well.
No. The gateway declares only read calls of the FANUC library: it has no parameter or PMC writes, no program download and no control commands.
FANUC lets only buyers of the FOCAS2 package ship the FOCAS library, so the gateway does not contain it. Put the file from your package into the gateway's focas folder; on an error the connection names the path that did not load.