HumanOS DNC Model
This chapter specifies the CyberTech DNC interface.
Overview
Methods for File Handling
Name | Description |
---|---|
ReadFile | Reads a single ASCII file from the NC |
WriteFile | Write a single ASCII file to the NC |
ReadDirectory | Reads the directory content |
MakeDirectory | Creates a new directory |
DeleteFile | Deletes a single file from the NC |
DeleteDirectory | Deletes the directory |
Methods for Stream-based File Handling
Name | Description |
---|---|
OpenFileStream | Opens a file stream for reading or writing. |
CloseFileStream | Closes a file stream |
ReadFileStream | Reads from the file stream |
WriteFileStream | Write to the file stream |
Methods to Handle NC Programs
The NC program is used to run a process on a CNC machine.
Name | Description |
---|---|
SelectProgram | Selects a NC program for execution |
SelectNcBlock | Selects a NC program block for execution |
SelectSequenceNr | Selects a NC program line nr for execution |
Commands to Access Tool Table
Name | Description |
---|---|
ReadToolRecord | Reads a single tool record as JSON |
ReadAllToolRecords | Reads all tool records as JSON |
WriteToolRecord | Writes a single tool record from JSON |
RemoveToolRecord | Removes a single tool record |
Data Nodes for Program Information
Some data nodes overlap the definition of the OEE and can therefore used for both applications.
Name | Description |
---|---|
Available | Flag if the controller is available |
SignOfLife | Sign of Life if the controller is available |
CurrentProgram | Current NC program executed by the controller |
MainProgram | Main NC program executed by the controller |
CurrentSequenceNr | Current sequence number of the executed block |
CurrentNcBlock | Current executed NC block |
OperationMode | Selected Operation mode |
RunningState | State of the current executed NC program |
CurrentToolId | Current tool id |
File Handling
ReadFile
Reads a text or ASCII based file from the NC control at once. This works for small files (e.g. less than 10MB).
Use File Streams for large or binary file transmissions.
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | Program or filename | System.String |
Type | Input [OPT] | File type. | System.Int32 |
Content | Output | Text content | System.String |
NOTE: Some controller require a file type. Typically, the file type is 0 for NC files.
WriteFile
Writes a text or ASCII based file to the NC control at once. This works for small files (e.g. less than 10MB).
Use File Streams for large or binary file transmissions.
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | Program or filename | System.String |
Type | Input [OPT] | File type. | System.Int32 |
Content | Input | Text content | System.String |
NOTE: Some controller require a file type. Typically, the file type is 0 for NC files.
ReadDirectory
Reads a directory content from the NC control. The content is returned in a JSON format.
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | directory name | System.String |
Content | Output | Text content | System.String |
The following example shows a JSON formatted content:
[
{
"Name": "..",
"Type": "Directory",
"Size": 4096,
"ModificationAt": "2022-12-17T14:01:56"
},
{
"Name": "AFC",
"Type": "Directory",
"ModificationAt": "2022-12-16T20:31:20"
},
{
"Name": "TOOL.T",
"Size": 31524,
"ModificationAt": "2022-12-16T20:31:20"
},
{
"Name": "TOOL_P.TCH",
"Size": 7140,
"ModificationAt": "2022-12-16T20:31:20"
}
]
MakeDirectory
Creates a directory on the NC control
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | Directory name | System.String |
DeleteDirectory
Deletes a directory from the NC control
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | Directory name | System.String |
DeleteFile
Deletes a file from the NC control
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | Program or filename | System.String |
Stream-based File Handling
The file stream can handle large file transmissions as well as binary file formats.
- Before accessing a file, the OpenFileStream must be called to obtain a file handle.
- Transmission of the data. The read or write operation can be called multiple times.
- At the end the file stream must be closed. The data is written to the NC controller after the close call.
OpenFileStream
Opens the file stream for reading or writing depending on the AccessMode
.
Argument | Direction | Description | Data Type |
---|---|---|---|
Name | Input | Program or filename | System.String |
Type | Input [OPT] | 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 |
CloseFileStream
Closes the file stream for reading or writing.
Argument | Direction | Description | Data Type |
---|---|---|---|
AsyncToken | Input [OPT] | Token for async callback | System.Int32 |
Handle | Input | File handle | System.Int32 |
The asynchronous token can be used to receive a callback through the event pool from the device. If the token is not passed or 0 (zero), the method call is synchronous.
ReadFileStream
Reads a file stream
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 |
WriteFileStream
Writes to a file stream
Argument | Direction | Description | Data Type |
---|---|---|---|
Handle | Input | File handle | System.Int32 |
Content | Input | Content | System.Byte[] |