Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 478 -
------------------------------------------------------------------------------
1.65 Read P-code macro variables (range specified). <Main,Alarm>
------------------------------------------------------------------------------
[Name]
cnc_rdpmacror
[Syntax]
#include <data.h>
#include <fwindow.h>
int cnc_rdpmacror( long s_number, long e_number, int length,
struct iodbpr *buf ) ;
struct iodbpr {
long datano_s ; /* Start P-code macro variable number. */
int dummy ; /* Not used. */
long datano_e ; /* End P-code macro variable number. */
union {
struct {
long mcr_val ; /* P-code macro variable value. */
int dec_val ; /* Digit number after decimal */
/* point. */
} p6_r ;
struct {
int mcr_val ; /* P-code macro variable value. */
int dec_val ; /* Digit number after decimal */
/* point. */
} p2_r ;
} pm_r[N] ; /* N is number of variables to be read. */
} ;
[Arguments]
s_number Start P-code macro variable number.
e_number End P-code macro variable number.
length Data block length ( =10+6*(number of variables to be
read) )
buf Buffer in which the P-code macro variable data are
stored.
[Return]
0 Successful.
2 Incorrect data block length "length".
3 Incorrect P-code macro variable number "s_number" or
"e_number".
5 Value of the P-code macro variable is out of the limit.
6 Macro executor option isn't added, or macro module isn't
loaded.
-1 It has been failed to read P-code macro variable because
the CNC software was updating the P-code macro variable.