simCNC features, gcodes, Python - Questions & Answers (in construction)

Created by CS-Lab Support, Modified on Tue, 13 Aug at 8:31 AM by CS-Lab Support

I am setting up a 2 axis [X and Z] machine using simCNC/ CSMIO/IP-M. I can home the axes Z first then X using ref all axes button using the simCNC GUI. I have an input that calls  a python script , the code should  home the Z axis first  then home  the X axis. Both axes home simultaneously when I run this code . Is my code incorrect can you help me get the axes to home in order Z first then X. 


Your code is incorrect. Use this code:

d.executeAxisHoming( Axis.Z ) 

d.executeAxisHoming( Axis.X ) 
or:
d.executeGCode( "G91" )
d.executeGCode( "G28 Z0" )
d.executeGCode( "G28 X0" )
d.executeGCode( "G90" )

I recommend the first solution because it is safer for many reasons. For example, if you interrupt homing, the machine will remain in G91 mode (incremental mode). If you do not notice this, you can cause a collision.


Would you have any solution for substituting current coordinates as a new zeroed base that I can refer to and then return to the original? I am not a specialist in g-code but I am creating my own system that automates the creation of g-code for a simCNC machine.


There are several ways to do this, but G92 is the most appropriate. G92 X10 Y20 Z30 will temporarily shift the material base so that the X axis is a nice program coordinate value of 10, Y 20, and Z30. Calling G92.1 will restore the original state.


We use a machine with your simCNC software. I have a question about the G10 function or rather its syntax. From experience on other machines I used the function as e.g. G10 P05 X100 Y100 Z200 setting a new point for G58, here I have a syntax error.


 G10 - Changes the coordinate values of the work offset with a given index.  In the case of repetitive production where devices with fixed table attachment points are used, a faster way to set the coordinate values of the work offset is to save them in gcode, rather than laboriously entering data into the offset table based on notes or each measurement. To change the coordinate value of the work offset with a given index, use the following notation:


G10 L2 P_ X_ Y_ Z_ A_ B_ C_

• L2 – parameter indicating the mode of changing the coordinate values of the work offset

• P – Work offset index. Currently, simCNC has the ability to save 9 work offsets (9 material databases). As a result, work offsets can take an index from 1 (G54) to 9 (G59.3).


For clarity: 1 = G54 | 2 = G55 | 3 = G56 | 4 = G57 | 5 = G58 | 6 = G59 | 7 = G59.1 | 8 = G59.2 | 9 = G59.3

• X, Y, Z, A, B and C – coordinate values for each axis.


Remember that: The G10 command always overwrites the work offset coordinate value in the table.


Does simcnc support the GOTO command?


No, but it can be added via macro script. From the macro position we can end gcode and jump to any line.


Our machine has a cut tool and a pentool. So the software should know what to tell to each different tool.


SimCNC has been equipped with additional offsets for the X and Y axes. This gives the possibility of mounting several tools next to each other and by using the m6 macro to alternately lower and raise them. Additionally, simCNC has a function that allows you to turn off the tangential knife. Thanks to this, the tangential knife drive does not limit the axis speed (a machine is as fast as the slowest drive) and does not rotate unnecessarily, causing a hazard.








Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article