Announcements

Announcement: We’re aware of an issue affecting starting a new topic from category pages and creating new blog posts. New topics can still be started directly from the relevant board. Learn more here.

G20 and G21 Brother Post

G20 and G21 Brother Post

wfreeman14932
Explorer Explorer
2,549 Views
11 Replies
Message 1 of 12

G20 and G21 Brother Post

wfreeman14932
Explorer
Explorer

I am using a post for the Brother and it (the machine) does not like when the post outputs G20. I tried to change it myself in the post and haven't had any luck. I contacted Fusion and they told me you can not change it. If someone has an idea that would be great! I posted a picture of the code and highlighted what I want to change in yellow.

 

 

Thanks,

 

Wesley 

0 Likes
Accepted solutions (1)
2,550 Views
11 Replies
Replies (11)
Message 2 of 12

RoccoHilton
Advocate
Advocate

прикрепите постпроцессор, который вы хотите изменить

0 Likes
Message 3 of 12

boopathi.sivakumar
Autodesk
Autodesk

Hi @wfreeman14932 

You can set the output unit to millimeters so that it output the coordinates in mm

 

boopathisivakumar_0-1709540191938.pngboopathisivakumar_0-1709540191938.png

 


Boopathi Sivakumar
Principal Technology Consultant

Message 4 of 12

wfreeman14932
Explorer
Explorer

I don't want it to post a G20 or G21. If I set it to millimeters it will post a G21.

0 Likes
Message 5 of 12

seth.madore
Community Manager
Community Manager

Do you not want MM at all and only Inch?


Seth Madore
Customer Advocacy Manager - Manufacturing


0 Likes
Message 6 of 12

wfreeman14932
Explorer
Explorer

My machine is in inch, but for some reason the machine dose not like having a G20 or G21 in the program. Once I post the program I open the program and delete the G20 and the program run perfect. 

0 Likes
Message 7 of 12

seth.madore
Community Manager
Community Manager

If you're using the stock Brother post, you'll need to edit line #431:

 writeBlock(gUnitModal.format(unit == MM ? 21 : 20));

Turn it into this:

// writeBlock(gUnitModal.format(unit == MM ? 21 : 20));

 

Now, really, that only solves half the problem. You really should have some logic that flips out at you if you accidentally post a program in MM (perhaps something from a customer or an accident on your part).


Seth Madore
Customer Advocacy Manager - Manufacturing


0 Likes
Message 8 of 12

wfreeman14932
Explorer
Explorer

That is one of the first things I done and it still post it out.

 

 

POST

  // absolute coordinates and feed per min
  writeBlock(gMotionModal.format(0), gAbsIncModal.format(90),  gFormat.format(40), gFormat.format(80));
  writeBlock(gFeedModeModal.format(94), gFormat.format(49));
  // writeBlock(gUnitModal.format(unit == MM ? 21 : 20));
  validateCommonParameters();
 
 Code
(T03 D=4.2 CR=0 TAPER=118DEG - ZMIN=-17.262 - DRILL)
N10 G00 G90 G40 G80
N15 G94 G49
N20 G21 (here is where it post it out)
 
 
Maybe I am overlooking something. When I contacted Fusion they said you can't change it, then they said I would have to post it here on the forum to figure it out.
 
Thanks,
 
Wesley
 
0 Likes
Message 9 of 12

seth.madore
Community Manager
Community Manager
Accepted solution

@wfreeman14932 wrote:
When I contacted Fusion they said you can't change it, then they said I would have to post it here on the forum to figure it out.
 
Thanks,
 
Wesley
 

Well that's....something.

 

 

I don't have a good way to ask this without sounding like I'm insulting your intelligence, but...are you certain you are editing, saving and using the same post processor? 

I just checked this edit in VSCode, and I get this for posted code:

2024-03-04_18h34_57.png2024-03-04_18h34_57.png

Are you using Machine Configurations, or just Setup and straight to Post Processing?

 

Can you share a sample file (with machine config and post processor) that is demonstrating this behavior?


Seth Madore
Customer Advocacy Manager - Manufacturing


0 Likes
Message 10 of 12

wfreeman14932
Explorer
Explorer

When the guys on the phone for Fusion told me that I couldn't change it, that blew my mind!!!! 

 

I am not sure which of the things I didn't do properly but I just went back and double checked the my process and made sure that I saved it and now it is working!!!

 

Maybe it was a good thing that you asked if I was doing the the basics first!!! I really do appreciate your help!!!! 

 

What is crazy is I made other changes to my post and they were working fine, all except the G20/G21. Then when I would reopen the post I could see the changes ( where I tried putting the // and even tried deleting the line) but my post would still output G20/G21. That is why I called and submitted a support ticket in the first place. 

 

On the other hand thanks to you My post is working properly!!!!!! 

 

Thanks,

 

Wesley 

0 Likes
Message 11 of 12

a.laasW8M6T
Mentor
Mentor

To be safe like Seth says, you should add a check to see if its posting in metric which will give an error message.

alaasW8M6T_1-1709609400849.pngalaasW8M6T_1-1709609400849.png

add the Highlighted code to your post just above where the G20/G21 line is commented out

 

 

 if (unit == MM) {
    error(localize("Post does not support Metric"));
  }

 

 

You can change the error message to whatever makes the most sense for you

Andrew Laas
Senior Machinist, Scott Automation


EESignature

Message 12 of 12

wfreeman14932
Explorer
Explorer

Awesome , I will try that and that is a great idea. 

 

Thanks again!

0 Likes