Skip to main content
Version: 2.4

HumanOS DNC Model

This chapter specifies the CyberTech DNC interface.

Overview

Methods for File Handling

NameDescription
ReadFileReads a single ASCII file from the NC
WriteFileWrite a single ASCII file to the NC
ReadDirectoryReads the directory content
MakeDirectoryCreates a new directory
DeleteFileDeletes a single file from the NC
DeleteDirectoryDeletes the directory

Methods for Stream-based File Handling

NameDescription
OpenFileStreamOpens a file stream for reading or writing.
CloseFileStreamCloses a file stream
ReadFileStreamReads from the file stream
WriteFileStreamWrite to the file stream

Methods to Handle NC Programs

The NC program is used to run a process on a CNC machine.

NameDescription
SelectProgramSelects a NC program for execution
SelectNcBlockSelects a NC program block for execution
SelectSequenceNrSelects a NC program line nr for execution

Commands to Access Tool Table

NameDescription
ReadToolRecordReads a single tool record as JSON
ReadAllToolRecordsReads all tool records as JSON
WriteToolRecordWrites a single tool record from JSON
RemoveToolRecordRemoves 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.

NameDescription
AvailableFlag if the controller is available
SignOfLifeSign of Life if the controller is available
CurrentProgramCurrent NC program executed by the controller
MainProgramMain NC program executed by the controller
CurrentSequenceNrCurrent sequence number of the executed block
CurrentNcBlockCurrent executed NC block
OperationModeSelected Operation mode
RunningStateState of the current executed NC program
CurrentToolIdCurrent 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.

ArgumentDirectionDescriptionData Type
NameInputProgram or filenameSystem.String
TypeInput [OPT]File type.System.Int32
ContentOutputText contentSystem.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.

ArgumentDirectionDescriptionData Type
NameInputProgram or filenameSystem.String
TypeInput [OPT]File type.System.Int32
ContentInputText contentSystem.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.

ArgumentDirectionDescriptionData Type
NameInputdirectory nameSystem.String
ContentOutputText contentSystem.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

ArgumentDirectionDescriptionData Type
NameInputDirectory nameSystem.String

DeleteDirectory

Deletes a directory from the NC control

ArgumentDirectionDescriptionData Type
NameInputDirectory nameSystem.String

DeleteFile

Deletes a file from the NC control

ArgumentDirectionDescriptionData Type
NameInputProgram or filenameSystem.String

Stream-based File Handling

The file stream can handle large file transmissions as well as binary file formats.

  1. Before accessing a file, the OpenFileStream must be called to obtain a file handle.
  2. Transmission of the data. The read or write operation can be called multiple times.
  3. 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.

ArgumentDirectionDescriptionData Type
NameInputProgram or filenameSystem.String
TypeInput [OPT]File type.System.Int32
AsyncTokenInput [OPT]Token for async callbackSystem.Int32
AccessModeInputAccess mode (Read or Write)System.Int32
HandleOutputFile handleSystem.Int32

CloseFileStream

Closes the file stream for reading or writing.

ArgumentDirectionDescriptionData Type
AsyncTokenInput [OPT]Token for async callbackSystem.Int32
HandleInputFile handleSystem.Int32
NOTE

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

ArgumentDirectionDescriptionData Type
HandleInputFile handleSystem.Int32
MaxBytesInputMaximum number of bytesSystem.Int32
ContentOutputContentSystem.Byte[]
LastContentOutputFlag is the last content has been sent.System.Boolean

WriteFileStream

Writes to a file stream

ArgumentDirectionDescriptionData Type
HandleInputFile handleSystem.Int32
ContentInputContentSystem.Byte[]