Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 383 -
------------------------------------------------------------------------------
1.29 Read actual spindle speed. <Main,Alarm>
------------------------------------------------------------------------------
[Name]
cnc_acts
[Syntax]
#include <data.h>
#include <fwindow.h>
int cnc_acts( struct odbact *buf ) ;
struct odbact {
int dummy[2] ; /* Not used. */
long data ; /* Actual spindle speed. */
} ;
[Arguments]
buf Buffer in which the actual spindle speed is stored.
[Return]
0 Successful.
[Description]
Reads the actual rotational speed of the spindle connected to CNC.
The actual spindle speed data is stored in "buf.data" with unsigned
binary format.
The unit of the actual spindle speed is "[rpm]".
[Example]
The following program displays "CURRENT S=2470" while the actual
rotational speed of the main spindle is 2470 [rpm].
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
void example( void )
{
struct odbact buf ;
cnc_acts( &buf ) ;
printf( "CURRENT S=%ld\n", buf.data ) ;
}