File

src/api/model/spindle.ts

Description

Class representing a spindle of the CNC.

Extends

Base

Index

Properties
Methods
Accessors

Constructor

constructor(spindleRaw?: any, cncKernelType: enums.CncKernelType)
Parameters :
Name Type Optional
spindleRaw any Yes
cncKernelType enums.CncKernelType No

Properties

Public activset
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable({hooks: undefined})

activset Parameter set active at spindle.

Public autogear
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable()

autogear. Automatic gear change. 1 if yes, 0 if not.

Public channel
Type : number
Default value : 0
Decorators :
@Listenable()

channel. Channel associated to Spindle

Public channelindex
Type : number
Default value : 0
Decorators :
@Listenable()

channelindex. The index of the spindle on the active channel.

Public cncNodeIndex
Type : number | Variable
Default value : 0
Decorators :
@Listenable()

cncNodeIndex. Index of the cnc node that belongs.

Public cssreal
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable()

cssreal.

Public enable
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable({hooks: undefined})

enable. The CNC activates this mark to allow moving the Spindle

Public indexId
Type : number

indexId.

Public inhibit
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable({hooks: undefined})

inhibit. If true, the CNC inhibits any movement of the Spindle.

Public inUse
Type : boolean
Default value : false
Decorators :
@Listenable()

inUse. Boolean flag that indicates if spindle is in use

Public ismaster
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable({hooks: undefined})

ismaster.

Public logicId
Type : number
Decorators :
@Listenable({hooks: undefined})

logicId. The unique logic numeric identification (started from 1) of the spindle.

Public ms
Type : number
Decorators :
@Listenable()

ms. Array of integer numbers (32 bit integers). Each bit corresponds to a M function activation state of its spindle.

Public name
Type : string
Decorators :
@Listenable({hooks: undefined})

name. The parameterized name of the spindle.

Public parked
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable({hooks: undefined})

parked. If true, the CNC parks the spindle.

Public pos
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable()

pos. Real spindle position.

Public ppos
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable()

ppos. Programmed spindle position.

Public progcss
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable()

progcss. Speed active by program for G96.

Public progs
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable()

progs. Programmed spindle speed.

Public slimit
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable()

slimit. Maximum safety limit for spindle speed.

Public sreal
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable()

sreal. Real spindle speed.

Public sso
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable()

sso. Percentage of the active spindle speed override.

Public syncposi
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable({hooks: undefined})

syncposi. The CNC activates this mark when the spindle work as eslave in a syncronizatin and is has arrive the syncronization in position

Public synspeed
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable({hooks: undefined})

synspeed. The CNC activates this mark when the spindle work as eslave in a syncronizatin and is has arrive the syncronization in speed

Public torque
Type : Variable
Default value : <Variable>{}
Decorators :
@Listenable()

torque. Current torque on the master or slave axis of the tandem.

Methods

createListener
createListener(props: Array)

This method will return a custom listener object designed for listening to changes on some concrete properties. Pooling can be avoived, so it can represent a significant better performance.

// Considerer sp is a refence to a Spindle Object
const listener1 = sp.createListener(['srela', 'pos']);

listener1.start((sp, props) => {
console.log(`some props (${props.join(',')}) have changed on spindle ${sp.name} (within the last 100 ms)`)})
}, { debounceTime: 100 });

Various listeners can be instantiated at the same time.

// Considerer sp is a refence to an Spindle Object
const listener2 = sp.createListener(['logicId', 'name']);

listener2.start((sp, props) => {
console.log(`either logicId or named value have changed on spindle ${sp.name} (within the last 60 ms)`)})
}, { debounceTime: 60 });
Parameters :
Name Type Optional Description
props Array<string> No

Array containing string with current objects propeties (@Listenables) names

Returns : Listener
deleteListener
deleteListener(props: Array)

This method will remove the props listenar from current axis. The Propeties Listener has certain cost and must be un-plugged when is no longer needed.

// Considering previous example
const listener1 = ax.createListener(['apos', 'ppos']);
\/*
listener1.start((ax, props) => {
console.log(`some props (${props.join(',')}) have changed on axis ${ax.name} (within the last 100 ms)`)})
}, { debounceTime: 100 });
.....
\/

ax.deleteListener(listener1);
// After calling deleteListener "listener1"  will be null.
Parameters :
Name Type Optional Description
props Array<string> No

Array containing string with current objects propeties (@Listenables) names

Returns : void
Public m
m(m: number)

Returns if a M function is active or not.

Number of requested M function.

Parameters :
Name Type Optional Default value
m number No null
Returns : boolean

Accessors

nMs
getnMs()

Number of M functions

Returns : number[]

results matching ""

    No results matching ""