2.9 PLC Calls NC Subprogram


A sub program, which in NC can call by PLC, and the subprogram name must "PLC-xxx.CNC", for example: PLC-M168.CNC. The calling method is that NC will send out M code to PLC. After receiving M code, PLC will put "PLC-xxx.CNC" file name into subprogram plc.subprogram and then return M code execution completion signal to NC.



static char *horizontalMap="PLC-M168.CNC";

case 168://map to hozintail

plc.subprogram=horizontalMap; //subprogram to call

plc.mCode.finish=1; //call subprogram

break;