User Tools

Site Tools


mycnc:stop_end_program

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mycnc:stop_end_program [2019/10/28 13:48] ivanmycnc:stop_end_program [2024/02/21 13:54] (current) ivan
Line 2: Line 2:
  
 {{:mycnc:stop-end-002.png}} {{:mycnc:stop-end-002.png}}
 +
 +A video recap of the following manual is available on our YouTube channel:
 +
 +{{youtube>e0-lxkf8BSo?large}}
  
 When using myCNC, the actions performed by the program when the Stop button is pressed are defined in the following files: When using myCNC, the actions performed by the program when the Stop button is pressed are defined in the following files:
Line 38: Line 42:
   exit(99);   exit(99);
 };</code> };</code>
 +
 +:!: **NOTE:** Note the ''proc=plc_proc_idle'' code at the end of the M02 macro. If this line is not present, then the Stop command is not completed, and the system will remain suspended as it waits for the PLC code to complete all operations. As a result, running/restarting the control program will not work correctly. 
  
 {{:mycnc:stop-end-003-m02.png}} {{:mycnc:stop-end-003-m02.png}}
  
-If the Stop button is pressed TWICE, the OFF.plc procedure will be used. Below is the default code for the OFF.plc procedure for the X1366P profile (note that the procedures will be different for other profiles and different user cases):+If the Stop button is pressed TWICE, the OFF.plc procedure will be used (the OFF.plc command is also launched upon completion of every small command, including macros and single G-codes completion).  Below is the default code for the OFF.plc procedure for the X1366P profile (note that the procedures will be different for other profiles and different user cases):
  
 <code C OFF.plc>#include pins.h <code C OFF.plc>#include pins.h
Line 68: Line 74:
 {{:mycnc:stop-end-004-off.png}} {{:mycnc:stop-end-004-off.png}}
  
-The two separate commands allow for a variety of stopping configurations. M02.plc procedure will often be set to have some sort of lift control to prevent issues due to the working tool potentially coming into contact with the working material/surface, while the OFF.plc might be set to clear all relevant ports to turn the system off, and end the program without any additional movement. Alternatively, on some profiles the OFF.plc will not perform any additional actions as compared to M02.plc, or vice versa - the configuration depends almost entirely on the particular needs of the user and the machine.  +The two separate commands allow for a variety of stopping configurations. M02.plc procedure will often be set to have some sort of lift control to prevent issues due to the working tool potentially coming into contact with the working material/surface, while the OFF.plc might be set to clear all relevant ports to turn the system off, and end the program without any additional movement. Alternatively, on some profiles the OFF.plc will not perform any additional actions as compared to M02.plc, or vice versa - the configuration depends almost entirely on the particular needs of the user and the machine. 
  
 Sometimes, when issues arise with the lift procedure, or with any of the processes described in the M02 procedure, it is advisable to click the Stop button twice in order to obtain a complete and total G-code run shutdown (if that is the way that the codes have been set up).  Sometimes, when issues arise with the lift procedure, or with any of the processes described in the M02 procedure, it is advisable to click the Stop button twice in order to obtain a complete and total G-code run shutdown (if that is the way that the codes have been set up). 
Line 92: Line 98:
  
 In non-default configurations, there can be a number of outputs/inputs being set and cleared upon program stop. Often, when issues arise with ports being set and cleared upon program start/stop, it is an issue with port set / port clear code being left over in the M02, OFF, and %%__HANDLER_GCODE_STOP%% commands. Therefore, it is advisable to begin diagnostics with looking for portset/portclr codes in these commands to see if the behaviour has been previously defined there.  In non-default configurations, there can be a number of outputs/inputs being set and cleared upon program stop. Often, when issues arise with ports being set and cleared upon program start/stop, it is an issue with port set / port clear code being left over in the M02, OFF, and %%__HANDLER_GCODE_STOP%% commands. Therefore, it is advisable to begin diagnostics with looking for portset/portclr codes in these commands to see if the behaviour has been previously defined there. 
 +
 +
  
  
mycnc/stop_end_program.1572284894.txt.gz · Last modified: 2019/10/28 13:48 by ivan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki