We use cookies to personalize content, interact with our analytics companies, advertising networks and cooperatives, and demographic companies, provide social media features, and to analyze our traffic. Our social media, advertising and analytics partners may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services. Learn more.
Been working on learning G Code and have a fairly basic question. Below is a piece of code (part of Phil’s keyhole code) and just wanting to know about first and last line. Is there a rule for when the “0” is needed before the decimal point? In line one there isn’t one before the .15000 but in line four there is one before .37500. Running a test I added on in the first line and it seemed to go OK but just wondering if it makes a difference?
The leading zero before the decimal is optional. Some post-processors will omit it to reduce file size. It’s quite possible that if the negative sign is present, it’s no longer optional, which would explain the difference between the two in this case. I’m surprised that the X0.0000 and Y0.0000 aren’t just X0 Y0 as trailing zeros are optional too.
I usually like just messing with something to see how it works BUT I just learned more in 15 minutes than in 3 hrs of playing around with g code! Thanks for the information and links. Stephen, the three links were good but last one was especially helpful!