6.22 Use NC COMMAND to Switch Hold-Normal Manual Mode


Use NC_COMMAND_MANUAL_FEED to switch to manual feed mode. In this mode, "Motion and Speed →[  ] Hold – Normal Manual" is not checked in the machine parameters.


Use NC_COMMAND_MANUAL_HOLD to switch to pause-normal manual mode, and perform normal manual operation during pause. When exiting manual mode, the system will move back to the program position when the execution program is paused. In this mode, "Motion and Speed →[√] Hold – Normal Manual" is checked in the machine parameters.


Example:

Use the NC_COMMAND_MANUAL_HOLD, NC_COMMAND_MANUAL_FEED switch mode for NcCommandHandShake in PLC_HSK.H


In plcRun, add the following code:

if(plc.mCode.flag){        

switch(plc.mCode.data){

..

..

case 42: //Manual feed mode:

if( plc.ncCommand.flag == NC_COMMAND_MANUAL_FEED && plc.ncCommand.finish ) {

       plc.ncCommand.flag = 0;

       plc.mCode.finish = 1;

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

       plc.ncCommand.flag = NC_COMMAND_MANUAL_FEED;

     }

      break;


case 43: // Pause - normal manual mode

   if( plc.ncCommand.flag == NC_COMMAND_MANUAL_HOLD && plc.ncCommand.finish ) {

     plc.ncCommand.flag = 0;

     plc.mCode.finish = 1;

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

     plc.ncCommand.flag = NC_COMMAND_MANUAL_HOLD;

   }

    break;

..

..

  }

}


Note:

Please note that the use of this function must be declared at the beginning of each machining program, for example:

G54G90G49G40G80

M42

..

..


Otherwise the CNC controller will keep the previous setting.