File

src/api/interface/cnc.ts

Description

This class main purpose is build and keep updated current CNC Model.

emits created event when a new model is built.

emits updated event every time a new model is updated (many times per second)

It also emits cnc events:

emits CncStateEvent

emits CncModeEvent

emits CncErrorEvent

emits CncMessageEvent

emits PlcMessageEvent

emits CncKernelMessageEvent

emits CncJogKeyEvent

emits CncDoubleStartEvent

emits CncInspectionAxisReposEvent

emits CncInspectionKeyReportEvent

emits CncInspectionMhfsPendEvent

emits CncSmTransitionErrorEvent

emits CncPrgSelecDataEvent

emits CncToolEvent

emits CncMagazineEvent

emits [CncHandwheelAxisEvent]

Extends

Base

Index

Properties
Methods

Constructor

constructor(hmiComm: CommHmiNodeServer, cncKernelType: enums.CncKernelType, cncClientId: number)

Constructor of CNC class

Parameters :
Name Type Optional Description
hmiComm CommHmiNodeServer No

CommHmiNodeServer Current remote connection object must be injected.

cncKernelType enums.CncKernelType No
cncClientId number No

Properties

Public axes
Type : any
Decorators :
@Listenable()

axes. Public Proxy to axes, indexed by name and logicId

Public channels
Type : any
Decorators :
@Listenable()

channels. Public Proxy to channels, indexed by logicId

Public cncClientId
Type : number

Unique id used by the cnc to identify libfagorclient instances. We can connect up to 8 clients for cnc kernel.

By default, all the instances are set to 1.

Public cncKernelType
Type : enums.CncKernelType
Default value : enums.CncKernelType.REAL
Public general
Type : General
Decorators :
@Listenable()

general. The general Object configured in the CNC.

Public generalPool
Type : General[]
Default value : []
Decorators :
@Listenable()
Public graphics
Type : Graphics
Default value : null

graphics. Object thar contains all the services and parameters related to cnc solid graphics usage.

Public listenToModelLifeCycleEvents
Default value : () => {...}
Public modelCreated
Type : boolean
Default value : false

modelCreated. Defines whether the model has been created or not

Public modelRequested
Type : boolean
Default value : false

Whether model has been requested or not.

Public nCncNodes
Type : number
Default value : 1

Number of cnc nodes in the system.

Public parametersServices
Type : ParametersServices
Default value : null
Decorators :
@Listenable()

parametersServices.

Public spindles
Type : any
Decorators :
@Listenable()

spindles. Public Proxy to spindles, indexed by logicId

Public techTableServices
Type : TechTableServices
Public terminalAccess
Type : TerminalAccess
Decorators :
@Listenable()
Public terminalAccessPool
Type : TerminalAccess[]
Default value : []
Decorators :
@Listenable()
Public toolsAndMagazineServices
Type : ToolsAndMagazineServices
Default value : null

toolsAndMagazineServices.

Public traceManagerServices
Type : TraceManager
Public variables
Type : CncVariables
Decorators :
@Listenable()

variables object gorups all the services related to CNC variables.

Methods

Public checkProgramLine
checkProgramLine(content: string, parserType: string, language: string)

Checks line of editor program

It calls to CommHmiNodeServer to call appropiate REST API route.

Returns a promise. This promise is fulfilled with reply object if everything is ok or is rejected with CncServiceOperationException when something goes wrong.

Parameters :
Name Type Optional Default value
content string No
parserType string No "FRESA_TORNO_8070"
language string No "English"
Public connectCNC
connectCNC()

Method that connects to the CNC.

It calls to CommHmiNodeServer to call appropiate REST API route.

Returns a promise. This promise is fulfilled with reply object if everything is ok or is rejected with CncServiceOperationException when something goes wrong.

Public disconnectCNC
disconnectCNC()

Method that disconnects from the CNC.

It calls to CommHmiNodeServer to call appropiate REST API route.

Returns a promise. This promise is fulfilled with reply object if everything is ok or is rejected with CncServiceOperationException when something goes wrong.

Public Async disconnectFromModel
disconnectFromModel()

Method that disconnect from model to the CNC.

It calls to CommHmiNodeServer to call appropiate REST API route.

Returns a promise. This promise is fulfilled with reply object if everything is ok or is rejected with CncServiceOperationException when something goes wrong.

Public disconnectFromModelWs
disconnectFromModelWs()

Stops auto updating loop for CNC Model. Usefull to save resources when no more updates are needed.

Returns : void
Public getAxis
getAxis(...args: any[])

Returns axis object by passing the name.CONFLICT (content): Merge conflict in src/api/model/model.ts

Parameters :
Name Type Optional
args any[] No
Returns : any
Public getChannel
getChannel(channel: number, cncNodeIndex: number, property: "index" | "localCncNodeIndex")

Returns Channel object by passing the logic ID.

Parameters :
Name Type Optional Default value Description
channel number No 0

logic ID

cncNodeIndex number No 0
property "index" | "localCncNodeIndex" No 'index'
Returns : Channel
Public getGeneral
getGeneral(cncNodeIndex: number)

Get general model

Parameters :
Name Type Optional Default value
cncNodeIndex number No 0
Returns : any
Public getProgramHelpList
getProgramHelpList(type: string)
Parameters :
Name Type Optional
type string No
Public getSpindle
getSpindle(...args: any[])

Returns spindle object by passing the name.

Parameters :
Name Type Optional
args any[] No
Returns : Spindle
Public Async requestModel
requestModel()

Method that request model to the CNC.

It calls to CommHmiNodeServer to call appropiate REST API route.

Returns a promise. This promise is fulfilled with reply object if everything is ok or is rejected with CncServiceOperationException when something goes wrong.

Public requestModelWs
requestModelWs()

Starts the ultra-optimized updating loop for CNC Model. Only needed when building a pseudo-real time interface, must be called when connection is online.

Returns : any
Public setMachineParameter
setMachineParameter(name: string, value: string)
Parameters :
Name Type Optional Default value
name string No ""
value string No ""
Returns : Promise<any>

results matching ""

    No results matching ""