FOCAS

Reference for the FOCAS connector, which reads data from FANUC CNC machines using the FOCAS protocol.

The FOCAS connector connects to FANUC CNC machines using FANUC's FOCAS protocol, allowing you to collect machine data by creating subscribe and read endpoints.

For a full list of connection and endpoint properties, see:

FOCAS Methods

The following methods are available. For full details of each method, consult the FANUC FOCAS documentation.

Subscribe Methods

Define endpoints using these methods with the subscribe operation. Output is returned as a JSON object.

cnc_exeprgname

Reads the full path name of the program which is currently being executed in CNC.

Example output:

{ "id": 1, "timestamp": 1637339279827, "value": { "name": "SAMPLE", "o_num": 0 } }

cnc_rdgcode

Reads the information of CNC about the commanded G code.

Required properties:

  • type

  • block

  • numGcd

Example output:

cnc_rdopnlsgnl

Reads the output signal image of software operator’s panel.

Required properties:

  • slctData

Example output:

cnc_rdprgnum

Reads the program number (modal O number) of the program which is currently selected in CNC.

Example output:

cnc_rdspeed

Reads the actual feed rate and the actual rotational speed of the main spindle.

Required properties:

  • dataType

Example output:

cnc_rdspload

Reads the load information of the serial spindle.

Required properties:

  • spindleNumber

Example output:

cnc_statinfo2

Reads the status information of CNC.

Example output:

cnc_sysinfo

Reads system information such as the CNC system type, Machining (M) or Turning (T), the series and version of the CNC system software, and the number of controlled axes.

Example output:

pmc_rdpmcrng

Reads the PMC data of the specified PMC address/range.

Required properties:

  • addressType

  • dataType

  • addressStart

  • addressEnd

  • dataLength

Example output:

Read Methods

Define endpoints using these methods with the read operation. These methods require input on the request topic (req) and return output as a JSON object.

You can include a correlation id in the request payload to match responses to specific requests.

program_download

Downloads the specified NC data to the controller. Publish a valid G-code program (see G-code on Wikipedia) as the string value of the value key on the endpoint's request topic (req).

Format the program code string as follows before publishing:

  1. Insert a leading line break \n. All data before it is ignored.

  2. Replace all line breaks with \n.

  3. Remove all space characters.

  4. Remove all semicolons.

Example: Raw G-code program

Example: Formatted string to publish

The program is downloaded to the directory set as “Background Folder” in the FANUC controller.

Example response

Service Commissioning File Example

Last updated

Was this helpful?