
------------------------------------------------------------------------------
1.68 Read load information of serial spindle. <Main,Alarm>
------------------------------------------------------------------------------
[Name]
cnc_rdspload
[Syntax]
#include <data.h>
#include <fwindow.h>
short cnc_rdspload( short sp_no, struct odbspn *buf ) ;
struct odbspn {
short datano ; /* Spindle number. */
short type ; /* Not used. */
short data[2] ; /* Spindle load data. */
} ;
[Arguments]
sp_no Spindle number.
buf Buffer in which the spindle load data are stored.
[Return]
EW_OK( 0) Successful.
EW_NUMBER( 3) Incorrect spindle number "sp_no".
EW_NOOPT( 6) The required option (Spindle serial output) is not
added.
[Description]
Reads the load information of the serial spindle controlled by the
CNC.
This function is used for displaying the spindle load information
by the application program, etc.
Specify one of (1 or 2)(for one specified spindle) or -1 (for all
spindles) in "sp_no" as spindle number.
The spindle load information is stored in "buf.data" with binary
format. In case that 1 or 2 is specified in "sp_no", the spindle load
information is stored in data[0]. In case of -1 in "sp_no", data is
stored in both data[0] and data[1]. The spindle load ratio (%) can be
calculated from this value using the following expression. (This is
conversion expression of the spindle load meter value displayed in the
CNC screen.)
Load ratio = buf.data / 32767 * (CNC parameter No.3127)