src/api/model/channel/cncServices.ts
This class groups all the services that interact with cnc kernel, changing its state, execution modes or request the s state of running kernels.
Methods |
|
constructor(hmiComm: CommHmiNodeServer, cncKernelType: enums.CncKernelType, route: string, cncNodeIndex: number, cncClientId: number)
|
||||||||||||||||||
Parameters :
|
Public Async axisZeroSearchBlock | ||||||
axisZeroSearchBlock(axisName: string)
|
||||||
Method that sends to the CNC a string with the name of the axis to set for zero search. Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Parameters :
Returns :
Promise<interfaces.ServiceResponse>
|
Public cancelBlock |
cancelBlock()
|
Method that cancels an interrupted block. This method is only applicable if a running block is cancellable. You can find out it using request method. Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Returns :
Promise<interfaces.ServiceResponse>
|
Public cancelStart |
cancelStart()
|
Method that cancel start in double start mode. This method is used to reset the first stage of double start mode Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Returns :
Promise<interfaces.ServiceResponse>
|
Public disableSblk |
disableSblk()
|
Method that disables single block execution. Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Returns :
Promise<interfaces.ServiceResponse>
|
Public enableSblk |
enableSblk()
|
Method that enables single block execution. Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Returns :
Promise<interfaces.ServiceResponse>
|
Public enterBlockMode | ||||||||
enterBlockMode(keep: string)
|
||||||||
Method that sets the CNC in block execution mode. Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error. Cnc will fire CncModeEvent when cnc has completed the transition.
Parameters :
Returns :
Promise<interfaces.ServiceResponse>
|
Public existsZeroSearchSubr |
existsZeroSearchSubr()
|
Returns if there is Zero Search Subroutine Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Returns :
Promise<interfaces.ServiceResponse>
|
Public leaveBlockMode |
leaveBlockMode()
|
Method that takes the CNC out of block execution mode. Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error. Cnc will fire CncModeEvent when cnc has completed the transition.
Returns :
Promise<interfaces.ServiceResponse>
|
Public leaveControl |
leaveControl()
|
Method that tries to leave control of the channel in the CNC. Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Returns :
Promise<interfaces.ServiceResponse>
|
Public request | ||||||||
request(type: string)
|
||||||||
Method that gets CNC info: status, mode, available actions. Possible request types: CNC_STATUS, CANCEL_BLOCK_ALLOWED, INSPECTION_ALLOWED, MDI_ALLOWED CANCEL_CONTINUE_ALLOWED. Returns a promise. This promise is fulfilled with reply object ServiceResponse. return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Parameters :
Returns :
Promise<interfaces.ServiceResponse>
|
Public reset |
reset()
|
Sends to the CNC the reset signal. Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Returns :
Promise<interfaces.ServiceResponse>
|
Public Async resetError | ||||||
resetError(errorPosition: number)
|
||||||
Resets an error indexed by position. Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Parameters :
Returns :
Promise<interfaces.ServiceResponse>
|
Public selectProgram | ||||||||||||||||||||||||||||||||||||||||||||||||||
selectProgram(programName: string, path: string, mode: string, startOffset: number, stopOffset: number, nTimes: number, stopProgram: string, externalStop, cursorOffset)
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Method that sends to the CNC the program that will be selected for execution. Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Parameters :
Returns :
Promise<interfaces.ServiceResponse>
|
Public setBlock | ||||||||||
setBlock(block: string)
|
||||||||||
Method that sends to the CNC the block that will be selected for execution. Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Parameters :
Returns :
Promise<interfaces.ServiceResponse>
|
Public setDoubleStart | ||||||||||
setDoubleStart(bDoubleStart: boolean)
|
||||||||||
Method that set CNC start mode. To execute a program start key must be pressed only 1 odoublesr 2 times Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error. If double start mode is enabled, when a START is detected channel object will fire CncDoubleStartEventData event
Parameters :
Returns :
Promise<interfaces.ServiceResponse>
|
Public setTool | ||||||||
setTool(tool: number)
|
||||||||
Method that sets a tool selection block in the CNC for execution. Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Parameters :
Returns :
Promise<interfaces.ServiceResponse>
|
Public startExecution |
startExecution()
|
Method that start CNC execution. It is only applicable to simulated kernel, real kernel will raise a warning. Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Returns :
Promise<interfaces.ServiceResponse>
|
Public stopExecution |
stopExecution()
|
Method that stops CNC execution. It is only applicable to simulated kernel, real kernel will raise a warning. Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Returns :
Promise<interfaces.ServiceResponse>
|
Public takeControl |
takeControl()
|
Method that tries to take control of the channel in the CNC. Returns a promise. This promise is fulfilled with reply object ServiceResponse return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.
Returns :
Promise<interfaces.ServiceResponse>
|