Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 561 -
------------------------------------------------------------------------------
1.102 Read load information of serial spindle. <Main,Alarm>
------------------------------------------------------------------------------
[Name]
cnc_rdspload
[Syntax]
#include <data.h>
#include <fwindow.h>
int cnc_rdspload( int sp_no, struct odbspn *buf ) ;
struct odbspn {
int datano ; /* Spindle number. */
int type ; /* Not used. */
int data[2] ; /* Spindle load data. */
} ;
[Arguments]
sp_no Spindle number.
buf Buffer in which the spindle load data are stored.
[Return]
0 Successful.
3 Incorrect spindle number "sp_no".
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.4127)
This function is available for only FS16/18 Model C or later.