Category Archives: FOCAS

MTConnect Blog Posts

MTConnect Links

As the number of posts increases, some are getting lost.  Just to keep things organized here is a list of posts grouped by topic.

Machine

FANUC FS0iD FOCAS Setup

Adapter

MTConnect FANUC Adapter on Ubuntu Linux

MTConnect Adapter for Windows

MTConnect FANUC Adapter PMC Addresses

MTConnect-FANUC Macro Variables

Agent

MTConnect Agent on Ubuntu Linux

MTConnect Agent – FANUC Macro Variables

Client

This would be a great place to make any requests for tutorials or posts.  I’m happy to entertain.  Of course the target should be MTConnect :)

MTConnect for FANUC Overview

 

 

When first starting developing with MTConnect all of the pieces can be very overwhelming.  I thought it might be helpful to break down the pieces and the connection between them.  Even though the MTConnect Adapter for FANUC and the MTConnect agent are complete from the GitHub repository, when developing client applications or setting up the pieces an overview is helpful.

overview

Click the picture for a larger view

Devices

Setting up MTConnect starts at the FANUC control.  The control must have an Ethernet connection and the optional FOCAS function.  Most modern controls have FOCAS available from the factory via an embedded Ethernet port on the main board of the CNC control.  Check this blog post here to setup the FOCAS connection.

The adapter and agent are best run on a server based on either Linux or Microsoft Windows.  Additionally, running the adapter on a low cost Linux platform located directly in the CNC can help reduce server and network load.

Communication

The FANUC control only speaks FOCAS, a very robust and powerful API that personal computers use to read and write information on the CNC.  The MTConnect adapter does all the heavy lifting and converts FOCAS to an MTConnect data stream.   The adapter streams data to the agent via http protocol which is human readable from Internet Explorer.  Here is the sample output from the FANUC adapter:  http://adapter.ip.address:7878/

2014-07-08T20:45:54.373983Z|system|NORMAL||||
2014-07-08T20:45:54.373983Z|Xtravel|NORMAL||||
2014-07-08T20:45:54.373983Z|Xoverheat|NORMAL||||
2014-07-08T20:45:54.373983Z|Xservo|NORMAL||||
2014-07-08T20:45:54.373983Z|Ytravel|NORMAL||||

Collation

As all of the pieces of MTConnect are based on some type of TCP communication, the devices find each other by knowing the IP Address and port number of the previous device.  The client knows the IP address of the agent, the agent knows the adapter, and the adapter knows the FANUC CNC.

Finally

Ultimately the client will consume XML requested from the agent.  The structure of the XML is determined by the schema specified for each machine.  The agent takes adapter data and matches the schema name‘s with adapter stream labels.  It records the stream into a buffer.  It is that buffer of data that is served when the client requests the XML.

 

MTConnect FANUC Adapter for Windows

In this tutorial we install the MTConnect FANUC Adapter in Windows and connect to a FANUC FS0iD control.  The source code is downloaded and compiled before some settings are made to establish a connection to the machine.

1.  Download the MTConnect Adapter source code from:  https://github.com/mtconnect/adapter

2.  Extract the source code to your PC

3.  Copy the appropriate  Fwlib32.h file from FANUC FOCAS cd into the /adapter/fanuc/ directory for the control we are connecting to.

4.  Copy all of the .dll and library files from the FANUC FOCAS cd into the /adapter/fanuc/ directory on your PC.

4.5  Copy the Fwlib32.dll file from the FOCAS cd to C:\Windows\System32\

5.  Open the /fanuc/fanuc.sln solution file in Microsoft Visual C++ 2010.

6.  Right click on the project and open the properties dialog from the context menu.

7.  Select Linker->Input from the left menu.

c++ properties dialog

8.  Change the Configuration drop down box to Release 0iD

9.  Remove the /fwlib/ from the additional dependencies so they properly point to the libraries.

10.  Close the properties dialog.

11.  Change the build drop down to Release 0iD

Visual c++ configuration

12.  Press F7 to build the solution.

13.  Copy /adapter/fanuc/adapter.cfg to /adapter/fanuc/Release0iD/adapter.cfg

14.  Open the adapter.cfg file with a text editor and change the IP Address to match the machine we are connecting to.

15.  From the command prompt, run the compiled binary with the option debug.

c:\adapter\fanuc\release0id\fanuc_0id debug

adapter dos run

16.  Test by having your agent connect to this adapter!  Once the adapter is tested it can be installed into windows by running:

c:\adapter\fanuc\release0id\fanuc_0id install

Good Luck!