6.5.3 Insert Data


Format:

M62


case 62: // to insert data into the file just created

if( sts.state0.bRun && !sts.state0.bDnc && !sts.state0.bMdi && !sts.state0.bManual ) {

 if( (plc.ncCommand.flag&0xff) == NC_COMMAND_INSERT_DATA && plc.ncCommand.finish ) {

  plc.ncCommand.flag = 0;

  plc.mCode.finish = 1;

 } else if( plc.ncCommand.flag == 0 ) {

  plc.ncCommand.flag = NC_COMMAND_INSERT_DATA;

  plc.ncCommand.data.x = DATA_TYPE_CNC;        

 }

} else

 plc.mCode.finish = 1;

break;


The CNC example program for this application is as follows:

M60 ; to create a file for data input

G90 G00 Y-5. Z10.

M97 P0000 L5

M61 ; to close the newly created data file

M30


O0000

G90 G00 X-5.

G91 G00 Y5.

M97 P0001 L5

M99



O0001

G91 G00 X5.

G90 G31 Z-10. ; to measure Z position

M62 ; to insert data

G90 G00 Z10.

M99