Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 399 -
[Arguments]
axis Axis number ( =(1,..,amount of controlled axes),
or -1 ). (This is effective to only data who have axis
attribute.)
length Data block length ( =22+4*4*(amount of axes to be
read) ).
buf Buffer in which the dynamic data 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 dynamic data because
the CNC software was updating any data.
[Description]
Reads various data which are changing every second while NC program is
executing at the same time.
This function is used for getting data to display the current position
screen or the monitoring screen, etc.
This function reads the following data.
Function used
for reading
Data individually
-----------------------------------------------+--------------
Alarm status cnc_alarm
Program number in executing cnc_rdprgnum
Program number of the main program cnc_rdprgnum
Sequence number cnc_rdseqnum
Actual feed rate cnc_actf
Actual spindle speed cnc_acts
Absolute position data of controlled axis cnc_absolute
Machine position data of controlled axis cnc_machine
Relative position data of controlled axis cnc_relative
Amount of distance to go of control. axis cnc_distance
The formats of each data are same as "Function used for reading
individually". Refer each functions for formats of data, etc.
Specify one of (1,..,amount of controlled axes) for each axis or -1
for all axes as axis number in "axis".
The array size of each members of "odbdy.pos.faxis" which is used for
reading all axes's data is always 8 regardless of the amount of
controlled axes. In case that the amount of controlled axes is less
than 8, no data are stored in the members corresponding with the axes
No. (amount of controlled axes + 1),..,8.
[Example]
The following program reads the dynamic data of all axes (amount of
axes = MAX) and displays them on the screen.
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
void example( void )
{
struct odbdy buf ;
unsigned int idx ;