Skip to main content

FANUC CNC 0i

Purpose

This plugin connects to a FANUC CNC 0i, polls PMC byte areas, and provides dedicated operations for machine status, macros, tool offsets, alarms, programs, and directories. Authorized users can also write values and execute controls. It is named FanucCnc0iMaster in the device selector.

See Collection Configuration for common channel, device, variable, and import operations. This page covers only CNC 0i settings, PMC addresses, special methods, and dedicated debug functions.

Open the plugin

Open Development Configuration → Collection Configuration, create a TCP client channel and device, and select FanucCnc0iMaster. The common CNC 0i TCP port is 8193.

Supported scope

ItemDescription
ChannelTCP client. Confirm that the Gateway can reach the CNC IP and port.
Data typesByte, Int16, UInt16, Int32, UInt32, Int64, UInt64, Float, Double, and String.

Plugin properties

SettingDefaultRangeDescription
Operation path11 to 32767Target path on a multi-path machine, starting at 1.
Text encodingGB2312Valid encoding nameEncoding used for programs, alarms, and text. Check the CNC character set when text is corrupted.
Maximum PMC batch bytes10241 to 65535Maximum consecutive bytes in one cyclic PMC read.
Maximum program bytes167772161 to 268435456Maximum bytes allowed for a program read or write.

Address rules

  • Cyclic variables support PMC byte areas G, F, Y, X, A, R, T, K, C, D, and E.
  • Address numbers are decimal, for example R0 and D100.
  • Consecutive length is measured in bytes. Adjacent variables must not overlap the bytes occupied by their data types.
  • Use the special methods or dedicated debug panel for system status, alarms, macros, offsets, programs, directories, and controls.

Special methods

Status and operating data

MethodPurposeParameters
ReadSystemInfoAsyncRead system information-
ReadSpeedAsyncRead feed and spindle speed-
ReadFeedOverrideAsyncRead feed override-
ReadSpindleOverrideAsyncRead spindle override-
ReadCurrentProgramInfoAsyncRead current program information-
ReadProgramNumberAsyncRead current program number-
ReadLanguageAsyncRead CNC language-
ReadAxisLoadsAsyncRead axis loads-
ReadSpindleLoadAsyncRead spindle load-
ReadCoordinatesAsyncRead coordinates-
ReadAlarmsAsyncRead alarm list-
ReadTimeSecondsAsyncRead accumulated timetimeType: time type
ReadAlarmStatusAsyncRead alarm state-
ReadStatusAsyncRead operating state-
ReadAxisNamesAsyncRead axis names-
ReadSpindleNamesAsyncRead spindle names-
ReadDiagnosticsAsyncRead diagnostic datanumber: start; length: count; axis: axis number
ReadWorkpieceSizesAsyncRead workpiece sizes-
ReadDateTimeAsyncRead CNC date and time-
ReadCurrentProductionCountAsyncRead current production count-
ReadExpectedProductionCountAsyncRead target production count-
ReadOperatorMessagesAsyncRead operator messages-

Macros and tool offsets

MethodPurposeParameters
ReadMacroAsyncRead one macronumber: macro number
ReadMacrosAsyncRead consecutive macrosnumber: start; length: count
WriteMacrosAsyncWrite consecutive macrosnumber: start; values: value array
ReadToolOffsetsAsyncRead tool offsetstoolCount: tool count
ReadCurrentToolNumberAsyncRead current tool number-
WriteToolLengthShapeAsyncWrite tool-length geometry offsettool: tool number; offset: value
WriteToolLengthWearAsyncWrite tool-length wear offsettool; offset
WriteToolRadiusShapeAsyncWrite tool-radius geometry offsettool; offset
WriteToolRadiusWearAsyncWrite tool-radius wear offsettool; offset
ReadToolGroupAsyncRead a tool groupgroupId: group number
ReadCurrentToolGroupAsyncRead current tool group-
ClearToolGroupsAsyncClear tool groupsstart: first group; end: last group

PMC and raw memory

MethodPurposeParameters
ReadPmcAsyncRead PMC bytesaddress: PMC address; length: bytes
WritePmcAsyncWrite PMC bytesaddress; data: byte array
ReadRawDataAsyncRead raw memorycode: function code; start; end
WriteRawDataAsyncWrite raw memorycode; start; data: byte array

Programs and directories

MethodPurposeParameters
ReadProgramListAsyncRead program list-
ReadCurrentProgramFragmentAsyncRead current program fragment-
ReadForegroundDirectoryAsyncRead foreground directory-
ReadDirectoryCountAsyncRead directory countpath: device directory
ReadDirectoryAsyncRead a directorypath: device directory
ReadProgramByNumberAsyncRead program by numberprogramNumber; devicePath
ReadProgramByNameAsyncRead program by nameprogramName; devicePath
WriteProgramFileAsyncWrite a program from a Gateway filefilePath; blockSize; devicePath
WriteProgramAsyncWrite program textprogram; blockSize; devicePath
SetCurrentProgramAsyncSelect current program by numberprogramNumber
SetCurrentProgramFileAsyncSelect current program by file nameprogramName
StartProcessingAsyncStart machining-
DeleteProgramAsyncDelete a programprogramNumber
DeleteFileAsyncDelete a filefileName

Macro, offset, PMC, raw-memory, and program writes, tool-group clearing, program selection/start, and deletion change the CNC. Use an allowed operating mode, back up affected data, and prepare a stop or rollback action first.

Functions

FunctionPurpose
Read or monitorRead current values or monitor the latest device update.
Variable mappingCheck how incoming data is mapped to the selected variable.
Plugin operationUse the controls on this plugin page and review the returned result.
Plugin operationUse the controls on this plugin page and review the returned result.
Program and directoryUse Program and directory and review the returned result.

Device debug

Open Development Configuration → Collection Configuration, select the FANUC CNC 0i device, and click More Functions, then open Debug → Protocol Debug · FanucCnc.

FeaturePurpose
Machine StatusReads system, operating, speed, coordinate, load, and alarm state.
MacrosReads or writes consecutive macros by start number and count.
Tools and OffsetsReads offsets and tool groups and writes offsets or clears groups.
PMC / RawReads or writes PMC and raw memory.
Programs and DirectoriesLists and reads programs/directories and writes, selects, starts, or deletes programs.

Machine status

FANUC CNC 0i machine status

Macros

FANUC CNC 0i macros

Tools and offsets

FANUC CNC 0i tools and offsets

PMC and raw memory

FANUC CNC 0i PMC and raw memory

Programs and directories

FANUC CNC 0i programs and directories

Begin with read-only machine-status, macro, PMC, or directory queries. Every red write, clear, start, or delete command requires site safety confirmation.

Verify the configuration

  1. Confirm that the runtime instance is available and can read system and machine status.
  2. Create one test PMC variable and compare its current value with the CNC screen or maintenance tool.
  3. Read one macro and the program directory in the dedicated panel.
  4. Test a write only during an approved maintenance window, using a dedicated test number, then read it back immediately.

Troubleshooting

SymptomCheck
Data session cannot startCNC IP, port 8193, network, operation path, and CNC Ethernet function.
PMC variable has no valueByte area, decimal address, data type, batch size, and variable interval.
Text is corruptedText encoding, CNC language, and program-file encoding.
Program read is truncatedMaximum program bytes, device directory, program permission, and network stability.
Special method failsMethod parameters, current path, CNC mode, and operation permission.
Write or control is rejectedCNC operating mode, write protection, site interlocks, user permission, and parameter range.