Community
Fusion Manufacture
Talk shop with the Fusion (formerly Fusion 360) Manufacture Community. Share tool strategies, tips, get advice and solve problems together with the best minds in the industry.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can I use the post to insert a user defined line in the Gcode outputfile?

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
zigzag2015
256 Views, 7 Replies

Can I use the post to insert a user defined line in the Gcode outputfile?

Hi,

I have recently started to use a four axis Mach4 post and I have found need to insert a single line of code into the Gcode file, either at the top or near so. I have tried putting in a comment, an option within the post, and that does

insert a line, but in parentheses as a comment. Is there a means of inserting a line but without the parentheses?

 

Thanks

Craig

7 REPLIES 7
Message 2 of 8
a.laasW8M6T
in reply to: zigzag2015

you can add the pass through  function to your postprocessor:

pass through.png

 

then use  pass through in the manual NC command:

passythru.png

 

But if this line needs to be added to your program everytime it would be better to hard code it into the post processor so it does it automatically.

 

What line of code do you need to add?

Message 3 of 8
zigzag2015
in reply to: a.laasW8M6T

Hi,

thanks for the reply.

 

In the first instance I will try the Pass Through command.

 

Do I understand correctly that I need to place the function  in the post....and then the function  will become available in the drop down menu?

 

The code I wish to insert in the Gcode file is very simple:

m199()

Just the one line, it calls a macro within Mach4 to populate some registers that correspond to a safe location in relation to the part. My intention is that it will be in every four axis Gcode file I produce and would probably be best handled by a modification to the post such that it's included automatically.

 

In the first instance however I think using the manual Pass Through might be better at least until I understand the implications of it, and maybe refine the code somewhat.

Message 4 of 8
a.laasW8M6T
in reply to: zigzag2015

The pass through option is always there for manual NC, but if it isn't implemented in the post if just won't do anything.

 

You just add that section of code to the very bottom of the post and then pass through will work, note the warnings about pass through though(it will put ANYTHING you write in the code which could inadvertently cause a crash)

 

 

You could add something like 

if(!is3D()){
    writeBlock("M199()");
}

 

and add that to the appropriate place in the onOpen function to place it where you want.

 

3d.png

 

that will only add the M199 line to multiaxis programs

and 3 axis will not have it

Message 5 of 8
zigzag2015
in reply to: a.laasW8M6T

Hi,

kool, I'll try it out tomorrow.

 

I've never had to really deal with any code in a post. Is there a primer for how the post is composed and maybe some of the syntax used?

 

Thanks

Craig

Message 6 of 8
a.laasW8M6T
in reply to: zigzag2015
Message 7 of 8
zigzag2015
in reply to: a.laasW8M6T

Holy Snapping Duck **** Batman.....I asked and I got! That'll keep me occupied for a week minimum.

 

Craig

Message 8 of 8
zigzag2015
in reply to: zigzag2015

Hi, 

the function onPassThrough(text) works a treat. Thanks.

 

The link to the Post Processor Training Guide is also excellent.

 

Thanks Craig

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report