Appearance
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
- Message Example
- Message Fields
- Chinese-to-English Field Names
- Logical Equipment States
- 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
| Key | JSON type in the example | Meaning |
|---|---|---|
datas | Object | Collected CNC data, indexed by data-point name |
sn | String | Device identifier in the message; example: CNC01. Match this identifier to the machine record in the receiving platform. |
time | Number (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 key | English name | JSON type | Meaning / notes |
|---|---|---|---|
主程序名称 | Main program name | String | Program identifier |
主程序注释 | Main program comment | String | Program comment text |
主轴倍率 | Spindle override | Number | Override value; verify scaling |
主轴温度 | Spindle temperature | Number | Verify temperature unit |
主轴负载 | Spindle load | Number | Verify load scaling |
主轴速度 | Actual spindle speed | Number | Verify speed unit |
刀具号 | Tool number | String | Numeric-looking string in the example |
切割时间 | Cutting time | Number | Counter; verify unit and reset rules |
剩余距离X | X-axis distance to go | Number | Remaining travel; verify unit |
剩余距离Y | Y-axis distance to go | Number | Remaining travel; verify unit |
剩余距离Z | Z-axis distance to go | Number | Remaining travel; verify unit |
开机时间 | Power-on time | Number | Counter; verify unit and reset rules |
当前产量 | Current production count | Number | Current count reported by the CNC |
当前执行程序块 | Executing program block | String | Program text, with line breaks and control characters |
当前执行行号 | Current program line number | String | Numeric-looking string in the example |
当前程序名称 | Current program name | String | Program identifier |
当前程序注释 | Current program comment | String | Program comment text |
总产量 | Total production count | Number | Total count reported by the CNC |
报警信息 | Alarm message | String | Empty string in the example |
报警号 | Alarm number | String | Empty string in the example |
报警类型 | Alarm type | String | Empty string in the example |
机械坐标X | X-axis machine position | Number | Machine coordinate; verify unit |
机械坐标Y | Y-axis machine position | Number | Machine coordinate; verify unit |
机械坐标Z | Z-axis machine position | Number | Machine coordinate; verify unit |
模式 | Operating mode | String | Example: "Reference" |
目标产量 | Target production count | Number | Target count reported by the CNC |
相对坐标X | X-axis relative position | Number | Relative coordinate; supports negative and fractional values |
相对坐标Y | Y-axis relative position | Number | Relative coordinate; supports negative and fractional values |
相对坐标Z | Z-axis relative position | Number | Relative coordinate; supports negative and fractional values |
程序状态 | Program status | String | Example: "RESET" |
系统信息 | Controller information | String | One text field; see Section 3.2 |
绝对坐标X | X-axis absolute position | Number | Absolute coordinate; supports negative and fractional values |
绝对坐标Y | Y-axis absolute position | Number | Absolute coordinate; supports negative and fractional values |
绝对坐标Z | Z-axis absolute position | Number | Absolute coordinate; supports negative and fractional values |
设备逻辑状态 | Logical equipment state | String | String code; see Section 4 |
设定主轴速度 | Set spindle speed | Number | Spindle speed setpoint; verify unit |
设定进给速度 | Set feed rate | Number | Feed-rate setpoint; verify unit |
轴温度X | X-axis temperature | Number | Verify temperature unit |
轴温度Y | Y-axis temperature | Number | Verify temperature unit |
轴温度Z | Z-axis temperature | Number | Verify temperature unit |
轴负载X | X-axis load | Number | Verify load scaling |
轴负载Y | Y-axis load | Number | Verify load scaling |
轴负载Z | Z-axis load | Number | Verify load scaling |
运行时间 | Running time | Number | Counter; verify unit and reset rules |
进给倍率 | Feed override | Number | Override value; verify scaling |
进给速度 | Actual feed rate | Number | Verify feed-rate unit |
3.2 Controller Information Labels
系统信息 contains these labels within a string. They are not separate JSON keys.
| Chinese label | English name | Example value |
|---|---|---|
| 型号 | Controller model | 0i-F |
| 类型 | Controller type | M |
| 最大轴数 | Maximum axis count | 32 |
| 当前轴数 | Current axis count | 3 |
| 版本 | Controller version | 21.0 |
| 序列号 | Controller serial number | D4G3 |
| 主轴数 | Spindle count | 1 |
| 轴名称 | Axis names | [X Y Z] |
4. Logical Equipment States
Read datas["设备逻辑状态"] as a string code:
| JSON value | State |
|---|---|
"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.863and531.95. - Decode
\nas a line break and\u000fas 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]
