Skip to content

FANUC CNC Data Acquisition Gateway JSON Data Reference ​

The Ethernet-version message contains CNC values in datas, a device identifier in sn, and a timestamp value in time. Chinese names are the incoming JSON keys. English names in the field table are display labels, not replacement keys sent by the gateway.

The example represents one machine snapshot, not defaults or limits. Compare a message from the supplied gateway before configuring the receiver. Other versions and firmware configurations require a separate payload check.

For wiring, network settings, and MQTT connection setup, see the User Manual. For supported data categories and hardware selection, see the Datasheet.

Contents ​

  1. Message Example
  2. Message Fields
  3. Chinese-to-English Field Names
  4. Logical Equipment States
  5. Parsing and Validation

1. Message Example ​

json
{
  "datas": {
    "主程序名称": "O22",
    "主程序注释": "",
    "主轴倍率": 100,
    "主轴温度": 15,
    "主轴负载": 0,
    "主轴速度": 0,
    "刀具号": "0",
    "切割时间": 23624466,
    "剩余距离X": 0,
    "剩余距离Y": 0,
    "剩余距离Z": 0,
    "开机时间": 63862560,
    "当前产量": 12586,
    "当前执行程序块": "O0022(XR240EII-FK05)(10M+2M)\n(10M)\nG40G17G49G80\nG91G30Z0.0\nT1M06(DJ20)\nM01\nG00G90G58X12.Y-12.S1200M03\nG43Z20.H1T3\nM7\nG98G81Z-1.\u000f",
    "当前执行行号": "0",
    "当前程序名称": "O22",
    "当前程序注释": "",
    "总产量": 12586,
    "报警信息": "",
    "报警号": "",
    "报警类型": "",
    "机械坐标X": 0,
    "机械坐标Y": 0,
    "机械坐标Z": 0,
    "模式": "Reference",
    "目标产量": 0,
    "相对坐标X": -100.863,
    "相对坐标Y": 531.95,
    "相对坐标Z": -610,
    "程序状态": "RESET",
    "系统信息": "型号:0i-F,类型:M,最大轴数:32,当前轴数:3,版本:21.0,序列号:D4G3,主轴数:1,轴名称:[X Y Z]",
    "绝对坐标X": -100.863,
    "绝对坐标Y": 531.95,
    "绝对坐标Z": -610,
    "设备逻辑状态": "2",
    "设定主轴速度": 0,
    "设定进给速度": 0,
    "轴温度X": 11,
    "轴温度Y": 11,
    "轴温度Z": 18,
    "轴负载X": 7,
    "轴负载Y": 7,
    "轴负载Z": 10,
    "运行时间": 31112170,
    "进给倍率": 0,
    "进给速度": 0
  },
  "sn": "CNC01",
  "time": 1765864916126
}

2. Message Fields ​

KeyJSON type in the exampleMeaning
datasObjectCollected CNC data, indexed by data-point name
snStringDevice identifier in the message; example: CNC01. Match this identifier to the machine record in the receiving platform.
timeNumber (integer)Message timestamp value; example: 1765864916126. Verify its unit, time origin, and whether it represents acquisition or publishing time before converting it.

3. Chinese-to-English Field Names ​

3.1 CNC Data Keys ​

All 46 keys belong to datas. Types describe the supplied example. Field names do not establish measurement units or scaling.

Chinese JSON keyEnglish nameJSON typeMeaning / notes
主程序名称Main program nameStringProgram identifier
主程序注释Main program commentStringProgram comment text
主轴倍率Spindle overrideNumberOverride value; verify scaling
主轴温度Spindle temperatureNumberVerify temperature unit
主轴负载Spindle loadNumberVerify load scaling
主轴速度Actual spindle speedNumberVerify speed unit
刀具号Tool numberStringNumeric-looking string in the example
切割时间Cutting timeNumberCounter; verify unit and reset rules
剩余距离XX-axis distance to goNumberRemaining travel; verify unit
剩余距离YY-axis distance to goNumberRemaining travel; verify unit
剩余距离ZZ-axis distance to goNumberRemaining travel; verify unit
开机时间Power-on timeNumberCounter; verify unit and reset rules
当前产量Current production countNumberCurrent count reported by the CNC
当前执行程序块Executing program blockStringProgram text, with line breaks and control characters
当前执行行号Current program line numberStringNumeric-looking string in the example
当前程序名称Current program nameStringProgram identifier
当前程序注释Current program commentStringProgram comment text
总产量Total production countNumberTotal count reported by the CNC
报警信息Alarm messageStringEmpty string in the example
报警号Alarm numberStringEmpty string in the example
报警类型Alarm typeStringEmpty string in the example
机械坐标XX-axis machine positionNumberMachine coordinate; verify unit
机械坐标YY-axis machine positionNumberMachine coordinate; verify unit
机械坐标ZZ-axis machine positionNumberMachine coordinate; verify unit
模式Operating modeStringExample: "Reference"
目标产量Target production countNumberTarget count reported by the CNC
相对坐标XX-axis relative positionNumberRelative coordinate; supports negative and fractional values
相对坐标YY-axis relative positionNumberRelative coordinate; supports negative and fractional values
相对坐标ZZ-axis relative positionNumberRelative coordinate; supports negative and fractional values
程序状态Program statusStringExample: "RESET"
系统信息Controller informationStringOne text field; see Section 3.2
绝对坐标XX-axis absolute positionNumberAbsolute coordinate; supports negative and fractional values
绝对坐标YY-axis absolute positionNumberAbsolute coordinate; supports negative and fractional values
绝对坐标ZZ-axis absolute positionNumberAbsolute coordinate; supports negative and fractional values
设备逻辑状态Logical equipment stateStringString code; see Section 4
设定主轴速度Set spindle speedNumberSpindle speed setpoint; verify unit
设定进给速度Set feed rateNumberFeed-rate setpoint; verify unit
轴温度XX-axis temperatureNumberVerify temperature unit
轴温度YY-axis temperatureNumberVerify temperature unit
轴温度ZZ-axis temperatureNumberVerify temperature unit
轴负载XX-axis loadNumberVerify load scaling
轴负载YY-axis loadNumberVerify load scaling
轴负载ZZ-axis loadNumberVerify load scaling
运行时间Running timeNumberCounter; verify unit and reset rules
进给倍率Feed overrideNumberOverride value; verify scaling
进给速度Actual feed rateNumberVerify feed-rate unit

3.2 Controller Information Labels ​

系统信息 contains these labels within a string. They are not separate JSON keys.

Chinese labelEnglish nameExample value
型号Controller model0i-F
类型Controller typeM
最大轴数Maximum axis count32
当前轴数Current axis count3
版本Controller version21.0
序列号Controller serial numberD4G3
主轴数Spindle count1
轴名称Axis names[X Y Z]

4. Logical Equipment States ​

Read datas["设备逻辑状态"] as a string code:

JSON valueState
"1"Running
"2"Standby
"3"Alarm
"4"Offline

The example reports Standby. 模式 and 程序状态 are separate fields: "Reference" describes the operating mode, while "RESET" describes the program status.

5. Parsing and Validation ​

  • Use a JSON parser that preserves the Chinese keys. Translate display labels in the application without renaming incoming fields.
  • Preserve numeric-looking strings such as "刀具号": "0", "当前执行行号": "0", and "设备逻辑状态": "2". Convert them only when the application requires a numeric value.
  • Keep empty strings distinct from a missing key, null, and numeric zero. An empty alarm field alone does not establish the machine's alarm state.
  • Parse coordinates as numbers that support fractions and negative values. The example includes -100.863 and 531.95.
  • Decode \n as a line break and \u000f as a control character within the program-block string. Escape control characters when displaying or logging that text; do not execute it as a machine command.
  • Treat 系统信息 as a string. It is not a nested JSON object, and its internal text format needs verification before extracting individual values.
  • Verify counter units, speed units, coordinate units, temperature units, and override/load scaling against the CNC display and gateway configuration. The sample does not define these units or the counter reset rules.
  • Test the receiver with the selected data points and with unavailable or missing values. This snapshot does not establish how other firmware versions report unavailable data or offline transitions.

YenGear · www.yengear.com · [email protected]