Fanuc Data Capture¶
Windows Installation¶
Instructions documented here are for non-Docker builds.
- Download latest fanuc-driver Windows release from https://github.com/Ladder99/fanuc-driver/releases.
- Direct link to 1.2.0
- (optional) Download latest MTConnect Agent release from https://github.com/mtconnect/cppagent/releases.
- Direct link to 2.2.0.17
-
Unblock and decompress the release archives into
c:\, for example.- Right click on zip file, select properties, check the
Unblockcheckbox, and press OK. - Your folder structure will look similar to this:
c:\ | |- ladder99 | | | |- fanuc-driver | |- agent-2.2.0.17-win32 - Right click on zip file, select properties, check the
Below is the folder and files structure that you can expect inside c:\ladder99\fanuc-driver folder.
fanuc-driver
|
|- logs ... location of runtime log files
|
|- runtimes ... .NET supporting files
|
|- user
| |
| |- agent.cfg ... MTConnect Agent example configuration
| |- config.machines.yml ... machines configuration file
| |- config.system.yml ... system configuration file
| |- config.user.yml ... user configuration file
| |- devices_template.xml ... MTConnect Agent devices information model blank template
| |- nlog.config ... logging configuration file
| |- win_install.bat ... install fanuc-driver as a Windows Service (run as administrator)
| |- win_restart.bat ... restart fanuc-driver Windows Service (run as administrator)
| |- win_run.bat ... run fanuc-driver from console
| |- win_start.bat ... start fanuc-driver Windows Service (run as administrator)
| |- win_stop.bat ... stop fanuc-driver Windows Service (run as administrator)
| |- win_uninstall.bat ... stop and remove fanuc-driver Windows Service (run as administrator)
| |- mtc_device_*.xml ... MTConnect device model generated at runtime
|
|- fanuc.exe ... fanuc-driver executable
|- *.* ... fanuc-driver supporting files
Configure Machines¶
- Open
c:\ladder99\fanuc-driver\user\config.machines.ymland replace its contents with the YAML section below. YAML is tab and white space sensitive. In the below example, use two white spaces to indent, not the tab key. Modify thel99.driver.fanuc.FanucMachinesection to the correct address and port of your Fanuc controller.
Below example will:
- Connect to Fanuc controller at 192.168.111.12 on port 8193.
- Collect basic machine, state, and production data.
- Sink data to MQTT Endpoint
#
# user configuration section
#
user:
# sources
source-mynx4300v5: &source-mynx4300
l99.driver.fanuc.FanucMachine, fanuc:
sweep_ms: !!int 1000
net:
ip: 192.168.0.1
port: !!int 8193
timeout_s: !!int 3
# collectors
collector-standard: &collector-standard
l99.driver.fanuc.strategies.FanucMultiStrategy, fanuc:
stay_connected: !!bool true
collectors:
- l99.driver.fanuc.collectors.MachineInfo, fanuc
- l99.driver.fanuc.collectors.Alarms, fanuc
- l99.driver.fanuc.collectors.Messages, fanuc
- l99.driver.fanuc.collectors.StateData, fanuc
- l99.driver.fanuc.collectors.ToolData, fanuc
- l99.driver.fanuc.collectors.ProductionData, fanuc
- l99.driver.fanuc.collectors.GCodeData, fanuc
- l99.driver.fanuc.collectors.AxisData, fanuc
- l99.driver.fanuc.collectors.SpindleData, fanuc
# sinks
target-mqtt: &target-mqtt
<< : *transport-base-mqtt
l99.driver.fanuc.transports.MQTT, fanuc:
<< : *default-mqtt-options
publish_model: !!bool false
net:
type: tcp
ip: 65.0.0.1
port: !!int 7883
anonymous: !!bool false
user: admin
password: bzdhjryjzgh34s4d
Running as a Windows Service¶
- Run
./user/win_install.batas administrator to install the fanuc-driver Windows Service. - Modify the fanuc-driver Windows Service to log-on as
Network Serviceuser. - Run
./user/win_start.batto start fanuc-driver Windows Service.