Initial G codes?
- jeeybee
- Offline
- Premium Member
Less
More
- Posts: 122
- Thank you received: 0
25 Aug 2014 19:14 #50265
by jeeybee
Initial G codes? was created by jeeybee
Is there a file where I can change the inital G codes that seem to be loaded in Linux cnc?
(tried to search for it but found nothing, maybe I search with the wrong keywords so please point me in the right direction if there is a thread on this already)
If I only want to use the mdi for example it would be good if the g codes I use most frequently is already loaded.
(tried to search for it but found nothing, maybe I search with the wrong keywords so please point me in the right direction if there is a thread on this already)
If I only want to use the mdi for example it would be good if the g codes I use most frequently is already loaded.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Away
- Platinum Member
Less
More
- Posts: 4957
- Thank you received: 1441
25 Aug 2014 20:12 #50266
by Todd Zuercher
Replied by Todd Zuercher on topic Initial G codes?
If you are talking about the the ngc file that is opened when Linuxcnc starts it is defined in the INI file in the display secetion.
www.linuxcnc.org/docs/html/config/ini_co...#sub:DISPLAY-section
OPEN_FILE = /full/path/to/file.ngc - The file to show in the preview plot when AXIS starts. Use a blank string "" and no file will be loaded at start up.
If you are talking about the g-codes that are initialized when Linuxcnc is started they are defined in the RS272 section of the INI file.
www.linuxcnc.org/docs/html/config/ini_co...sub:RS274NGC-section
RS274NGC_STARTUP_CODE = G17 G20 G40 G49 G64 P0.001 G80 G90 G92 G94 G97 G98 - A string of NC codes that the interpreter is initialized with. This is not a substitute for specifying modal g-codes at the top of each ngc file, because the modal codes of machines differ, and may be changed by g-code interpreted earlier in the session.
www.linuxcnc.org/docs/html/config/ini_co...#sub:DISPLAY-section
OPEN_FILE = /full/path/to/file.ngc - The file to show in the preview plot when AXIS starts. Use a blank string "" and no file will be loaded at start up.
If you are talking about the g-codes that are initialized when Linuxcnc is started they are defined in the RS272 section of the INI file.
www.linuxcnc.org/docs/html/config/ini_co...sub:RS274NGC-section
RS274NGC_STARTUP_CODE = G17 G20 G40 G49 G64 P0.001 G80 G90 G92 G94 G97 G98 - A string of NC codes that the interpreter is initialized with. This is not a substitute for specifying modal g-codes at the top of each ngc file, because the modal codes of machines differ, and may be changed by g-code interpreted earlier in the session.
Please Log in or Create an account to join the conversation.
- BigJohnT
- Offline
- Administrator
Less
More
- Posts: 7000
- Thank you received: 1172
25 Aug 2014 23:32 #50279
by BigJohnT
Replied by BigJohnT on topic Initial G codes?
While you can set the initial G codes in the ini file it is bad practice to depend on that. It is much better to start each G code file with a preamble that sets the state of the machine.
gnipsel.com/linuxcnc/g-code/gen01.html
JT
gnipsel.com/linuxcnc/g-code/gen01.html
JT
Please Log in or Create an account to join the conversation.
- jeeybee
- Offline
- Premium Member
Less
More
- Posts: 122
- Thank you received: 0
26 Aug 2014 01:17 #50281
by jeeybee
Replied by jeeybee on topic Initial G codes?
Yes it was the initial g codes I was looking for, cant belive I missed them in the ini file.
You are right BigJohnT but this is only for the most basic things, like for example to set it for mm and not inch which I will never use so that one can issue a mdi command without having to think about such simple things.
Thanks!
You are right BigJohnT but this is only for the most basic things, like for example to set it for mm and not inch which I will never use so that one can issue a mdi command without having to think about such simple things.
Thanks!
Please Log in or Create an account to join the conversation.
- BigJohnT
- Offline
- Administrator
Less
More
- Posts: 7000
- Thank you received: 1172
26 Aug 2014 02:00 #50282
by BigJohnT
Yea, that works until you run a G code file that leaves you in inch mode... it's best not to guess about the machine state when you start a G code file.
JT
Replied by BigJohnT on topic Initial G codes?
Yes it was the initial g codes I was looking for, cant belive I missed them in the ini file.
You are right BigJohnT but this is only for the most basic things, like for example to set it for mm and not inch which I will never use so that one can issue a mdi command without having to think about such simple things.
Thanks!
Yea, that works until you run a G code file that leaves you in inch mode... it's best not to guess about the machine state when you start a G code file.
JT
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Away
- Platinum Member
Less
More
- Posts: 4957
- Thank you received: 1441
26 Aug 2014 02:22 #50283
by Todd Zuercher
Replied by Todd Zuercher on topic Initial G codes?
It might also be helpful to make a little sub program that resets everything to how you like it. Then make a little pyvcp button called "RESET" that calls it. I have something similar on most of the machines I've set up.
Please Log in or Create an account to join the conversation.
- jeeybee
- Offline
- Premium Member
Less
More
- Posts: 122
- Thank you received: 0
26 Aug 2014 14:02 #50294
by jeeybee
Replied by jeeybee on topic Initial G codes?
Thats interesting, I´l have to find out more about that when I have time
Please Log in or Create an account to join the conversation.
- sudocrapo
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
04 Apr 2022 19:55 #239277
by sudocrapo
Replied by sudocrapo on topic Initial G codes?
This is an old thread, so I assuming that the startup/preamble code location has changed. I don't see any of this under my ini RS272 section.
The wiki was no help, it still mentions the RS272 section. Other posts mention a work around.
Where is the hidden file that these preamble codes are loaded from?
Thanks
The wiki was no help, it still mentions the RS272 section. Other posts mention a work around.
Where is the hidden file that these preamble codes are loaded from?
Thanks
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Away
- Platinum Member
Less
More
- Posts: 4957
- Thank you received: 1441
05 Apr 2022 12:27 - 05 Apr 2022 12:29 #239326
by Todd Zuercher
Replied by Todd Zuercher on topic Initial G codes?
Not exactly sure what your asking for. Normally the "preamble" refers to one or more lines of G-code that you or your cam software inserts at the start of every G-code file to make sure that all machine settings (modal G-codes) are correct to run your g-code file correctly. It is generally considered the best practice to do it there, rather than rely on default settings that may or may not have been set correctly in the control prior to running your code. Some examples of G-codes that are often included in a preamble would be G20/G21(inch/metric), G17-19(coordinate plane selection), G54-59(machine offsets) G64Px(path blending tolerance), G80(canned cycle cancel), G91(absolute coordinates). All of these could easily result in a crash if not set correctly for the file to be ran.
Last edit: 05 Apr 2022 12:29 by Todd Zuercher.
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
Less
More
- Posts: 7778
- Thank you received: 2074
05 Apr 2022 12:49 #239328
by cmorley
Replied by cmorley on topic Initial G codes?
Please Log in or Create an account to join the conversation.
Time to create page: 0.123 seconds