Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 394 -
------------------------------------------------------------------------------
1.35 Read servo delay amount. <Main,Alarm>
------------------------------------------------------------------------------
[Name]
cnc_srvdelay
[Syntax]
#include <data.h>
#include <fwindow.h>
int cnc_srvdelay( int axis, int length, struct iodbaxis *buf ) ;
struct iodbaxis {
int dummy ; /* Not used. */
int type ; /* Axis number. */
long data[N] ; /* Servo delay amount of */
} ; /* controlled axis. N is the amount */
/* of controlled axes. */
[Arguments]
axis Axis number ( =(1,..,amount of controlled axes),
or -1 ).
length Data block length ( =4+4*(amount of axes to be read)).
buf Buffer in which the servo delay amounts are stored.
[Return]
0 Successful.
2 Incorrect data block length "length".
4 Incorrect axis number "axis".
Any data other than -1 or (1,..,amount of controlled axes) has
been specified.
-1 It has been failed to read servo delay amount because
the CNC software was updating the servo delay amount of the
controlled axis.
[Description]
Reads the difference between the commanded position and the actual
servo position of the CNC's controlled axis, i.e. the servo delay
amount.
Specify one of (1,..,amount of controlled axes) for each axis or -1
for all axes as axis number in "axis".
The servo delay amount is stored in "buf.data" with signed binary
format. (The negative value is represented as 2's complement.)
The servo delay amount of specified axis is stored in "buf.data[0]"
in case of reading one axis's data.
The unit of the servo delay amount is detection unit.
[Example]
The following program displays the servo delay amount of all axes
(amount of axes = MAX).
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
void example( void )
{
struct iodbaxis buf ;
unsigned int idx ;
cnc_srvdelay( -1, 4+4*MAX, &buf ) ;