FANUC Device Commands
FANUC Control Driver offers several commands for tool and file management.
The Id must be generated each time a device configuration is created!
Overview
NOTE:
Nc{n}
stands for the n-th Nc channel to be addressed.
File Handling
Command | Description | Capability |
---|---|---|
Nc{n}.deleteAllPrograms | Deletes all Nc programs. | ProgramManagement |
Nc{n}.deleteProgram | Deletes a specific Nc program. | ProgramManagement |
Nc{n}.readFile | Reads a file from FANUC control | ProgramManagement |
Nc{n}.writeFile | Writes a file to FANUC control | ProgramManagement |
Nc{n}.writeMDI | Writes data to the Manual Data Input Buffer (MDI) | ProgramManagement |
Nc{n}.readDirContent | Reads directory content from nc | ProgramManagement |
Nc{n}.createDirectory | Creates a new NC directory (only for 0i-D/F and 3xi ) | ProgramManagement |
Nc{n}.deleteDirectory | Deletes a NC directory (only for 0i-D/F and 3xi ) | ProgramManagement |
Nc{n}.getCurrentDirectory | Gets the current NC directory (only for 0i-D/F and 3xi ) | ProgramManagement |
Nc{n}.changeCurrentDirectory | Sets the current NC directory (only for 0i-D/F and 3xi ) | ProgramManagement |
FANUC also supports stream based transmissions. This allows to transmit binary as well as very large files (> 10MB).
Some services like OPC-UA Server have transmission limits. Use stream based transmissions and limit the transmission size when reading or writing parts of the file.
Command Address | Description | Capability |
---|---|---|
Nc{n}.openDncStream | Opens a dnc stream for reading or writing. | ProgramManagement (and DirectDNC for direct DNC) |
Nc{n}.closeDncStream | Closes a dnc stream | ProgramManagement (and DirectDNC for direct DNC) |
Nc{n}.readDncStream | Reads from the dnc stream | ProgramManagement (and DirectDNC for direct DNC) |
Nc{n}.writeDncStream | Write to the dnc stream | ProgramManagement (and DirectDNC for direct DNC) |
Nc{n}.getDncStreamStatus | Gets the status of the dnc stream | ProgramManagement (and DirectDNC for direct DNC) |
Nc Program Handling
Command | Description | Capability |
---|---|---|
Nc{n}.selectProgram | Selects an Nc program for execution. | ProgramManagement |
Nc{n}.selectSequenceNr | Selects a block by given sequence number. | ProgramManagement |
Nc{n}.selectBlockNr | Selects a block by given its number. | ProgramManagement |
Tool Management
Command | Description | Capability |
---|---|---|
Nc{n}.deleteToolRecord | Removes a tool from the tool management table | ToolLifeManagement |
Nc{n}.readToolRecord | Reads a tool from the tool management table | ToolLifeManagement |
Nc{n}.writeToolRecord | Writes a tool to the tool management table | ToolLifeManagement |
Nc{n}.clearToolLifeData | Clears the life counter of a specific tool group. | ToolLifeManagement |
Nc{n}.writeToolLifeGroupInfo | Writes tool life group information. | ToolLifeManagement |
Other Commands
Command | Description | Capability |
---|---|---|
Global.ReadValue | Reads any value from the FANUC | |
Global.WriteValue | Writes any value to the FANUC | |
Nc{n}.reset | Executes the external reset | |
Nc{n}.clearAlarm | Clears the PS100/101 alarms | |
Nc{n}.synchTime | synchronize the time and date with the FANUC control. |
File Handling
Older FANUC controls support only program numbers instead of names. The commands
return o{number}
, eg. o0001
.
Use always "o" + number as program name. For 0i-D/F; 3xi series the parameter "Name" could be any alphanumeric name.
For 0i-D/F and for 3xi controls, the default directory is normally //CNC_MEM/USER/PATH{n}
where {n}
is the channel number of the NC path.
ReadDirectory
Reads a directory content from the NC control. The content is returned in a JSON format.
Requires the ProgramManagement capability.
Address: Nc{n}.readDirContent
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | directory name. If empty, the current directory is returned. | System.String |
Content | Output | JSON formatted directory content | System.String |
Example from a device info file:
{
"Id": "<generate your own id>",
"Name": "ReadDirectory",
"Type": "CommandNode",
"Address": "Nc1.readDirContent",
"Arguments": [
{
"Name": "Name",
"Type": "Input",
"DataType": "System.String",
"Description": "Directory Name"
},
{
"Name": "Content",
"Type": "Output",
"DataType": "System.String",
"Description": "Directory Content"
}
]
}
The content is returned as JOSN formatted text.
- 16i, 18i, 21i: Program number, comment, size and modification date are returned.
- 0i-D, 0i-F, 3xi: file/subdirectory name, comment, size and modification date are returned.
- all others: Only program number, comment and size are returned
Example of a 30i-A (reading directory: //CNC_MEM/USER/PATH1
)
[
{
"Name": "SAMPLE",
"Comment": "ROUGH",
"Size": 26000,
"ModificationAt": "2014-11-17T14:28:18"
},
{
"Name": "O10",
"Comment": "TEST",
"Size": 500,
"ModificationAt": "2022-12-18T00:28:54"
}
]
MakeDirectory
Creates a sub directory within the selected Nc directory.
Requires the ProgramManagement capability.
Address: Nc{n}.createDirectory
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | Directory name | System.String |
Example:
{
"Id": "<generate your own id>",
"Name": "MakeDirectory",
"Type": "CommandNode",
"Address": "Nc1.createDirectory",
"Arguments": [
{
"Name": "Name",
"Type": "Input",
"DataType": "System.String"
}
]
}
DeleteDirectory
Deletes a sub directory within the selected Nc directory.
Requires the ProgramManagement capability.
Address: Nc{n}.deleteDirectory
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | Directory name | System.String |
Example:
{
"Id": "<generate your own id>",
"Name": "DeleteDirectory",
"Type": "CommandNode",
"Address": "Nc1.deleteDirectory",
"Arguments": [
{
"Name": "Name",
"Type": "Input",
"DataType": "System.String"
}
]
}
GetCurrentDirectory
Gets the current directory of the Nc.
Requires the ProgramManagement capability.
Address: Nc{n}.getCurrentDirectory
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Output | Directory name | System.String |
Available only for 0i-D/F and 3xi series.
Example:
{
"Id": "<generate your own id>",
"Name": "GetCurrentDirectory",
"Type": "CommandNode",
"Address": "Nc1.getCurrentDirectory",
"Arguments": [
{
"Name": "Name",
"Type": "Output",
"DataType": "System.String"
}
]
}
SetCurrentDirectory
Sets the current directory of the Nc.
Requires the ProgramManagement capability.
Address: Nc{n}.changeCurrentDirectory
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | Directory name | System.String |
Available only for 0i-D/F and 3xi series.
Example:
{
"Id": "<generate your own id>",
"Name": "SetCurrentDirectory",
"Type": "CommandNode",
"Address": "Nc1.changeCurrentDirectory",
"Arguments": [
{
"Name": "Name",
"Type": "Input",
"DataType": "System.String"
}
]
}
ReadFile
Reads a text or ASCII based file from the NC control.
Requires the ProgramManagement capability.
Address: Nc{n}.readFile
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | Program or filename | System.String |
Type | Input | File type (default = 0) | System.Int32 |
Content | Output | Text content | System.String |
Following file types are supported:
- 0: NC program (ISO)
- 1: Tool offset data
- 2: Parameter
- 3: Pitch error compensation data
- 4: Custom macro variables
- 5: Work zero offset data
- 18: Rotary table dynamic fixture offset
Example:
{
"Id": "<generate your own id>",
"Name": "ReadFile",
"Type": "CommandNode",
"Address": "Nc1.readFile",
"Arguments": [
{
"Name": "Name",
"Type": "Input",
"DataType": "System.String",
"Description": "File name"
},
{
"Name": "Type",
"Type": "Input",
"DataType": "System.Int32",
"Description": "File type"
},
{
"Name": "Content",
"Type": "Output",
"DataType": "System.String",
"Description": "File Content"
}
]
}
WriteFile
Writes a text or ASCII based file to the NC control.
Requires the ProgramManagement capability.
Address: Nc{n}.writeFile
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | Program or filename | System.String |
Type | Input | File type (default = 0) | System.Int32 |
Content | Input | Text content | System.String |
Following file types are supported:
- 0: NC program (ISO)
- 1: Tool offset data
- 2: Parameter
- 3: Pitch error compensation data
- 4: Custom macro variables
- 5: Work zero offset data
- 18: Rotary table dynamic fixture offset
Example:
{
"Id": "<generate your own id>",
"Name": "WriteFile",
"Type": "CommandNode",
"Address": "Nc1.writeFile",
"Arguments": [
{
"Name": "Name",
"Type": "Input",
"DataType": "System.String",
"Description": "File name"
},
{
"Name": "Type",
"Type": "Input",
"DataType": "System.Int32",
"Description": "File type"
},
{
"Name": "Content",
"Type": "Input",
"DataType": "System.String",
"Description": "File Content"
}
]
}
DeleteFile
Deletes a specific nc file within the selected Nc directory.
Requires the ProgramManagement capability.
Address: Nc{n}.deleteProgram
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | Program or filename | System.String |
Example:
{
"Id": "<generate your own id>",
"Name": "DeleteFile",
"Type": "CommandNode",
"Address": "Nc1.deleteProgram",
"Arguments": [
{
"Name": "Name",
"Type": "Input",
"DataType": "System.String",
"Description": "Program Name"
}
]
}
Delete All Files
Deletes all program within the selected Nc directory.
Requires the ProgramManagement capability.
Address: Nc{n}.deleteAllPrograms
Example:
{
"Id": "<generate your own id>",
"Name": "DeleteAllFiles",
"Type": "CommandNode",
"Address": "Nc1.deleteAllPrograms",
"Arguments": []
}
Dnc Stream Handling
The dnc stream handling can be used for following applications:
- active transmission of NC programs (small and large files)
- passive transmission of NC programs dynamically requested by the controller.
The stream handling requires ProgramManagement for regular NC file transmission, and DirectDNC capabilities for direct DNC transmissions.
OpenFileStream
Opens the dnc stream for reading or writing depending on the AccessMode
.
Address: Nc{n}.openDncStream
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | Program or filename | System.String |
Type | Input | File type. | System.Int32 |
AsyncToken | Input [OPT] | Token for async callback | System.Int32 |
AccessMode | Input | Access mode (Read or Write) | System.Int32 |
Handle | Output | File handle | System.Int32 |
See DNC Model - OpenFileStream for details on arguments and return values.
Example:
{
"Id": "<generate your own id>",
"Name": "OpenFileStream",
"Type": "CommandNode",
"Address": "Nc1.openDncStream",
"Arguments": [
{
"Name": "Name",
"Type": "Input",
"DataType": "System.String"
},
{
"Name": "AccessMode",
"Type": "Input",
"DataType": "System.Int32"
},
{
"Name": "Type",
"Type": "Input",
"DataType": "System.Int32"
},
{
"Name": "Handle",
"Type": "Output",
"DataType": "System.Int32"
}
]
}
CloseFileStream
Closes the dnc stream for reading or writing.
Address: Nc{n}.closeDncStream
Argument | Direction | Description | Data Type |
---|---|---|---|
AsyncToken | Input [OPT] | Token for async callback | System.Int32 |
Handle | Input | File handle | System.Int32 |
See DNC Model - CloseFileStream for details on arguments and return values.
Example:
{
"Id": "5608D2DA-7CAF-416A-B31F-42DF706B9FD0",
"Name": "CloseFileStream",
"Address": "Nc1.closeDncStream",
"ScriptFile": "",
"Type": "CommandNode",
"Arguments": [
{
"Name": "Handle",
"DataType": "System.Int32",
"Description": ""
}
]
}
ReadFileStream
Reads from a dnc stream
Address: Nc{n}.readDncStream
Argument | Direction | Description | Data Type |
---|---|---|---|
Handle | Input | File handle | System.Int32 |
MaxBytes | Input | Maximum number of bytes | System.Int32 |
Content | Output | Content | System.Byte[] |
LastContent | Output | Flag is the last content has been sent. | System.Boolean |
See DNC Model - ReadFileStream for details on arguments and return values.
Example:
{
"Id": "C71D6C63-6EEF-4020-98CC-6F3085AF4478",
"Name": "ReadFileStream",
"Address": "Nc1.readDncStream",
"ScriptFile": "",
"Type": "CommandNode",
"Arguments": [
{
"Name": "Handle",
"DataType": "System.Int32",
"Description": ""
},
{
"Name": "MaxBytes",
"DataType": "System.Int32",
"Description": ""
},
{
"Name": "Content",
"DataType": "System.Byte[]",
"Type": "Output",
"Description": ""
},
{
"Name": "LastContent",
"DataType": "System.Boolean",
"Type": "Output",
"Description": ""
}
]
}
WriteFileStream
Writes to a dnc stream
Address: Nc{n}.writeDncStream
Argument | Direction | Description | Data Type |
---|---|---|---|
Handle | Input | File handle | System.Int32 |
Content | Input | Content | System.Byte[] |
See DNC Model - WriteFileStream for details on arguments and return values.
Example:
{
"Id": "5AAB615E-8663-4B9F-95E2-221317F65E3F",
"Name": "WriteFileStream",
"Address": "Nc1.writeDncStream",
"ScriptFile": "",
"Type": "CommandNode",
"Arguments": [
{
"Name": "Handle",
"DataType": "System.Int32",
"Description": ""
},
{
"Name": "Content",
"DataType": "System.Byte[]",
"Description": ""
}
]
}
GetFileStreamStatus
Gets the status of the dnc stream
Address: Nc{n}.getDncStreamStatus
Argument | Direction | Description | Data Type |
---|---|---|---|
Handle | Input | Stream handle | System.Int32 |
Content | Output | Content (JSON formatted) | System.String |
See DNC Model - GetFileStreamStatus for details on arguments and return values.
Example:
{
"Id": "5AAB615E-8663-4B9F-95E2-221317F65E3F",
"Name": "GetFileStreamStatus",
"Address": "Nc1.getDncStreamStatus",
"ScriptFile": "",
"Type": "CommandNode",
"Arguments": [
{
"Name": "Handle",
"DataType": "System.Int32",
"Description": ""
},
{
"Name": "Content",
"DataType": "System.String",
"Type": "Output",
"Description": ""
}
]
}
NC Program Handling
Select Main Program
Selects the main program within the selected Nc directory. This command requires the program management capability.
Requires the ProgramManagement capability.
Address: Nc{n}.selectProgram
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | Program or filename | System.String |
Example:
{
"Id": "<generate your own id>",
"Name": "SelectProgram",
"Type": "CommandNode",
"Address": "Nc1.selectProgram",
"Arguments": [
{
"Name": "Name",
"Type": "Input",
"DataType": "System.String",
"Description": "Program Name"
}
]
}
Important note: This function is released ONLY for 0i-D/F; 30i-A/B and newer series. The parameter “Name” could be any alphanumeric name.
Select Sequence Number
Selects a block by given sequence number.
Address: Nc{n}.selectSequenceNr
Argument | Direction | Description | Data Type |
---|---|---|---|
Number | Input | sequence number (without N) | System.Int32 |
Example:
{
"Id": "<generate your own id>",
"Name": "SelectSequenceNr",
"Type": "CommandNode",
"Address": "Nc1.selectSequenceNr",
"Arguments": [
{
"Name": "Number",
"Type": "Input",
"DataType": "System.Int32",
"Description": "Sequence number"
}
]
}
Select Block Number
Selects a block by given its number.
Address: Nc{n}.selectBlockNr
Argument | Direction | Description | Data Type |
---|---|---|---|
Number | Input | Block number | System.Int32 |
Example:
{
"Id": "<generate your own id>",
"Name": "SelectBlockNr",
"Type": "CommandNode",
"Address": "Nc1.selectBlockNr",
"Arguments": [
{
"Name": "Number",
"Type": "Input",
"DataType": "System.Int32",
"Description": "Block number"
}
]
}
Write MDI Program
Writes data to the MDI buffer of the CNC.
Requires the ProgramManagement capability.
Address: Nc{n}.writeMDI
Argument | Direction | Description | Data Type |
---|---|---|---|
Content | Input | Content of MDI program | System.String |
Example:
{
"Id": "8FEDA09C-C947-4A56-9703-59A6662B0E9F",
"Name": "WriteMDI",
"Type": "CommandNode",
"Address": "Nc1.writeMDI",
"Arguments": [
{
"Name": "Content",
"Type": "Input",
"DataType": "System.String",
"Description": "Content"
}
]
}
Tool Handling
Following tool table fields are accessible:
Name | FieldName | DataType | Read | Write |
---|---|---|---|---|
tool number(T) | T_code | System.Int32 | X | X |
tool life counter | life_count | System.Int32 | X | X |
maximum of tool life | max_life | System.Int32 | X | X |
rest of tool life | rest_life | System.Int32 | X | X |
state of tool life | life_stat | System.Byte | X | X |
customizing bit | cust_bits | System.Byte | X | X |
tool info. | tool_info | System.UInt16 | X | X |
tool length compensation number (H) | H_code | System.Int16 | X | X |
cutter compensation number (D) | D_code | System.Int16 | X | X |
spindle speed (S) | spindle_speed | System.Int32 | X | X |
feed rate(F) | feedrate | System.Int32 | X | X |
magazine number | magazine | System.Int16 | X | - |
pot number | pot | System.Int16 | X | - |
tool geometric compensation number(G) | G_code | System.Int16 | X | X |
tool wear compensation number(W) | W_code | System.Int16 | X | X |
tool geometric number | gno | System.Int16 | X | X |
edge group number(only 0i-F, 30i/31i/32i) | grp | System.Int16 | X | X |
edge number(only 0i-F, 30i/31i/32i) | edge | System.Int16 | X | X |
origin magazine number(only 0i-F, 30i/31i/32i) | org_magazine | System.Int16 | X | X |
origin pot number(only 0i-F, 30i/31i/32i) | org_pot | System.Int16 | X | X |
customizing data 1..40 | custom1 to custom40 | System.Int32 | X | X |
Above customizing data(5-20) are available at only "the additional customized data on tool management function option(5-20)".
Above customizing data(5-40) are available at only "the additional customized data on tool management function option(5-40)".
Read a Tool Record
Reads a tool record from tool management table.
Address: Nc{n}.readToolRecord
The command requires following arguments:
Argument | Direction | Description | Data Type |
---|---|---|---|
ToolId | Input | Id of the tool (T) | System.Int32 |
Content | Output | Tool record, formatted in JSON | System.String |
Example:
{
"Id": "adb73d17-1ca3-4fe9-adc8-9de21aacec4c",
"Name": "ReadToolRecord",
"Type": "CommandNode",
"Address": "Nc1.readToolRecord",
"Arguments": [
{
"Name": "ToolId",
"DataType": "System.Int32",
"Type": "Input"
},
{
"Name": "Content",
"DataType": "System.String",
"Type": "Output"
}
]
}
Returned content (formatted in JSON):
[
{
"Name": "T_code",
"DataType": "System.Int32",
"Value": 1
},
{
"Name": "life_count",
"DataType": "System.Int32",
"Value": 30
},
{
"Name": "magazine",
"DataType": "System.Int32",
"Value": 1
},
{
"Name": "pot",
"DataType": "System.Int32",
"Value": 0
}
...
]
Create Tool Record
Creates or registers a tool record in the tool management table. Call this command first before you can read/write or delete a tool record.
Argument | Direction | Description | Data Type |
---|---|---|---|
ToolId | Input | Id of the tool (T) | System.Int32 |
Content | Input | Tool record, formatted in JSON | System.String |
Address: Nc{n}.createToolRecord
Example:
{
"Id": "adb73d17-1ca3-4fe9-adc8-9de21aacec4c",
"Name": "CreateToolRecord",
"Type": "CommandNode",
"Address": "Nc1.createToolRecord",
"Arguments": [
{
"Name": "ToolId",
"DataType": "System.Int32",
"Type": "Input"
},
{
"Name": "Content",
"DataType": "System.String",
"Type": "Input"
}
]
}
Writing Tool Record
Writes a tool record to tool management table.
The record must not be complete. Only the values provided are overwritten in the tool table.
Argument | Direction | Description | Data Type |
---|---|---|---|
ToolId | Input | Id of the tool (T) | System.Int32 |
Content | Input | Tool record, formatted in JSON | System.String |
Address: Nc{n}.writeToolRecord
Example:
{
"Id": "adb73d17-1ca3-4fe9-adc8-9de21aacec4c",
"Name": "WriteToolRecord",
"Type": "CommandNode",
"Address": "Nc1.writeToolRecord",
"Arguments": [
{
"Name": "ToolId",
"DataType": "System.Int32",
"Type": "Input"
},
{
"Name": "Content",
"DataType": "System.String",
"Type": "Input"
}
]
}
Deleting Tool Records
Deletes a tool entry from tool management table.
Address: Nc{n}.deleteToolRecord
The command needs following inputs:
Argument | Direction | Description | Data Type |
---|---|---|---|
ToolId | Input | Id of the tool (T) | System.Int32 |
Example:
{
"Id": "adb73d17-1ca3-4fe9-adc8-9de21aacec4c",
"Name": "DeleteToolRecord",
"Type": "CommandNode",
"Address": "Nc1.deleteToolRecord",
"Arguments": [
{
"Name": "ToolId",
"DataType": "System.Int32",
"Type": "Input"
}
]
}
Add Tool to Magazine
Registers a tool in a physical magazine place (pot).
Address: Nc{n}.addToolToMagazine
The command needs following inputs:
Argument | Direction | Description | Data Type |
---|---|---|---|
ToolId | Input | Id of the tool (T) | System.Int32 |
MagazineId | Input | Id of the magazine (1..4) | System.Int32 |
MagazinePlaceId | Input | Id of the place (pot) | System.Int32 |
Example:
{
"Id": "adb73d17-1ca3-4fe9-adc8-9de21aacec4c",
"Name": "AddToMagazine",
"Type": "CommandNode",
"Address": "Nc1.addToolToMagazine",
"Arguments": [
{
"Name": "ToolId",
"DataType": "System.Int32",
"Type": "Input"
},
{
"Name": "MagazineId",
"DataType": "System.Int32",
"Type": "Input"
},
{
"Name": "MagazinePlaceId",
"DataType": "System.Int32",
"Type": "Input"
}
]
}
Remove Tool from Magazine
Removes a tool from a physical magazine place (pot).
Address: Nc{n}.removeToolFromMagazine
The command needs following inputs:
Argument | Direction | Description | Data Type |
---|---|---|---|
MagazineId | Input | Id of the magazine (1..4) | System.Int32 |
MagazinePlaceId | Input | Id of the place (pot) | System.Int32 |
Example:
{
"Id": "adb73d17-1ca3-4fe9-adc8-9de21aacec4c",
"Name": "RemoveFromMagazine",
"Type": "CommandNode",
"Address": "Nc1.removeToolFromMagazine",
"Arguments": [
{
"Name": "MagazineId",
"DataType": "System.Int32",
"Type": "Input"
},
{
"Name": "MagazinePlaceId",
"DataType": "System.Int32",
"Type": "Input"
}
]
}
Clear ToolLife Data
Clears the life counter of a specific tool group. This command requires
an argument named GroupNumber
. It specifies the group where the life
counter should be reset.
Requires the ToolLifeManagement capability.
Address: Nc{n}.clearToolLifeData
Argument | Direction | Description | Data Type |
---|---|---|---|
GroupNumber | Input | Number of group to reset life counter | System.Int32 |
Example:
{
"Id": "<generate your own id>",
"Name": "ClearToolLifeData",
"Type": "CommandNode",
"Address": "Nc1.clearToolLifeData",
"Arguments": [
{
"Name": "GroupNumber",
"Type": "Input",
"DataType": "System.Int32",
"Description": "Number of group to reset life counter"
}
]
}
Write ToolLife Group Information
Writes tool life group information.
Requires the ToolLifeManagement capability.
Address: Nc{n}.writeToolLifeGroupInfo
Argument | Direction | Description | Data Type |
---|---|---|---|
GroupNumber | Input | Tool group number | System.Int32 |
ToolLifeCounterType | Input | Tool life counter type (0 = counter, 1 = time) | System.Int32 |
ToolLife | Input | Tool life in total | System.Int32 |
ToolLifeCounter | Input | Current tool life counter | System.Int32 |
Example:
{
"Id": "<generate your own id>",
"Name": "WriteToolLifeGroupInfo",
"Type": "CommandNode",
"Address": "Nc1.writeToolLifeGroupInfo",
"Arguments": [
{
"Name": "GroupNumber",
"Type": "Input",
"DataType": "System.Int32",
"Description": "tool group number",
"MinMaxConstraint": {
"MinValue": 1,
"MaxValue": 999
}
},
{
"Name": "ToolLifeCounterType",
"Type": "Input",
"DataType": "System.Int32",
"Description": "tool life counter type (0 = counter, 1 = time)",
"MinMaxConstraint": {
"MinValue": 0,
"MaxValue": 1
}
},
{
"Name": "ToolLife",
"Type": "Input",
"DataType": "System.Int32",
"Description": "tool life in total"
},
{
"Name": "ToolLifeCounter",
"Type": "Input",
"DataType": "System.Int32",
"Description": "current tool life counter"
}
]
}
Other Commands
ReadValue
Reads synchronously a value from the FANUC Control. All variables can be read with addresses specified in chapter Data Access. The function is global which means that addresses of all Pmc and Nc channels can be passed to the function. The value is returned as a System.String.
Address: Global.ReadValue
Example:
{
"Id": "<generate your own id>",
"Name": "ReadValue",
"Type": "CommandNode",
"Address": "Global.ReadValue",
"Arguments": [
{
"Name": "Address",
"Type": "Input",
"DataType": "System.String",
"Description": "Memory address"
},
{
"Name": "Value",
"Type": "Output",
"DataType": "System.String",
"Description": "Return value"
}
]
}
WriteValue
Writes synchronously a value to the FANUC Control. All variables can be written with addresses specified in chapter Data Access. The function is global which means that addresses of all Pmc and Nc channels can be passed to the function.
Address: Global.WriteValue
Example:
{
"Id": "<generate your own id>",
"Name": "WriteValue",
"Type": "CommandNode",
"Address": "Global.WriteValue",
"Arguments": [
{
"Name": "Address",
"Type": "Input",
"DataType": "System.String",
"Description": "Memory address"
},
{
"Name": "Value",
"Type": "Input",
"DataType": "System.String",
"Description": "Value to write "
}
]
}
Reset
Executes the external resets of the CNC control. Used to reset program execution, clear alarms etc.
Address: Nc{n}.reset
{
"Id": "<generate your own id>",
"Name": "Reset",
"Type": "CommandNode",
"Address": "Nc1.reset",
"Arguments": []
}
Clear Alarm
Clears the alarm state of the CNC. This command requires an argument “Number ”:
-
0: clear PS100 alarm (30i, 0i-D/F, PMi-A:SW100). Corresponds to
[CAN]
+[RESET]
on the MDI operation. -
1: clear PS101 alarm (This alarm does not occur at 30i, 0i-D/F, PMi-A). Corresponds to
[PROG]
+[RESET]
on the MDI operation.
Address: Nc{n}.clearAlarm
{
"Id": "<generate your own id>",
"Name": "ClearAlarm",
"Type": "CommandNode",
"Address": "Nc1.clearAlarm",
"Arguments": [
{
"Name": "Number",
"Type": "Input",
"DataType": "System.Int32",
"Description": "0=PS100, 1=PS101 clear",
"MinMaxConstraint": {
"MinValue": 0,
"MaxValue": 1
}
}
]
}
Synchronize Time and Date
Command to synchronize the time and date with the FANUC control. This could be used to synchronize the timer of the control with the HumanOS host IPC. The host timer is the master.
Address: Nc{n}.synchTime
{
"Id": "<generate your own id>",
"Name": "SynchTime",
"Type": "CommandNode",
"Address": "Nc1.synchTime",
"Arguments": []
}