Haas post processor won't let me name files with words.

Haas post processor won't let me name files with words.

Jools-Taylor
Advocate Advocate
2,484 Views
11 Replies
Message 1 of 12

Haas post processor won't let me name files with words.

Jools-Taylor
Advocate
Advocate

Hi All

 

Since the latest update of fusion where the post area has been modernised I can't name programs. I can only number them. I used to be able to rename them when I saved them but this has now gone. 

 

In the post processor I changed the parameter/variable  'programNameIsInteger = true;' to "programNameIsInteger = false;' which allowed me to click post and it did some working out but then it throws this error.

 

Information: Configuration: HAAS - Next Generation Control
Information: Vendor: Haas Automation
Information: Posting intermediate data to '/Volumes/User Data/Keycap/latest underside.nc'
Error: Failed to post process. See below for details.
...
Start time: Fri Sep 10 10:11:43 2021
Post processor engine: 4.5793.0
Configuration path: /Users/Jools_1/Autodesk/Fusion 360 CAM/Posts/haas next generation.cps
Include paths: /Users/Jools_1/Autodesk/Fusion 360 CAM/Posts
Configuration modification date: Thu Sep  9 10:31:14 2021
Output path: /Volumes/User Data/Keycap/latest underside.nc
Checksum of intermediate NC data: 32221df2a790b7a736d02a7a8a4c3193
Checksum of configuration: c3a1ef4aacecac7534f3029230cdcb94
Vendor url: https://www.haascnc.com
Legal: Copyright (C) 2012-2020 by Autodesk, Inc.
Generated by: Fusion 360 CAM 2.0.10940
...
Error: Failed to invoke function 'onOpen'.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Failed to invoke 'onOpen' in the post configuration.
Error: Failed to execute configuration.
Stop time: Fri Sep 10 10:11:43 2021
Post processing failed.

 

 

 

 

I've attached the Haas next gen post in the attachments so it can maybe be searched easier.

Please help, this is really grinding my gears 🙂

Cheers

Jools 

0 Likes
2,485 Views
11 Replies
Replies (11)
Message 2 of 12

seth.madore
Community Manager
Community Manager

There is a series of post edits that are required (in the current NC dialog) to save as a name. Basically, you have to swap the Program Name and Program Comment places (in the post) and then switch (in your mind) what info goes where. You end up having to make your "Name/number" your file name and your "Comment" your actual program number. The edits look similar to this:

extension = "nc";
programNameIsInteger = false;
setCodePage("ascii");

writeln("%");

   if (programComment) {
    var programId;
    try {
      programId = getAsInt(programComment);
    } catch(e) {
      error(localize("Program name must be a number."));
      return;
    }
    if (properties.o8) {
      if (!((programId >= 1) && (programId <= 99999999))) {
        error(localize("Program number is out of range."));
        return;
      }
    } else {
      if (!((programId >= 1) && (programId <= 9999))) {
        error(localize("Program number is out of range."));
        return;
      }
    }
    if ((programId >= 8000) && (programId <= 9999)) {
      warning(localize("Program number is reserved by tool builder."));
    }
    var oFormat = createFormat({width:(properties.o8 ? 8 : 4), zeropad:true, decimals:0});
    if (programName) {
      writeln("O" + oFormat.format(programId) + " (" + filterText(String(programName).toUpperCase(), permittedCommentChars) + ")");
    } else {
      writeln("O" + oFormat.format(programId));
    }
  } else {
    //error(localize("Program name has not been specified."));
    return;
  }

 

Barring that, you can also swap back to the Legacy Post Dialog in Preferences > Preview Features


Seth Madore
Customer Advocacy Manager - Manufacturing


0 Likes
Message 3 of 12

engineguy
Mentor
Mentor

@Jools-Taylor 

 

Another way to do it that I have used is as shown below, just an alternative but you would still put the Program Name in the Program Name box and a Comment in the Comments box which I find easier to use, just IMHO 🙂 🙂 🙂

I don`t know if you have any other modifications to the PP that you are using so I am just attaching this version of the PP only as an example for you to study, not for code generation use !!

 

extension = "nc";
programNameIsInteger = (programName);   Change the (true) to (programName) as shown
setCodePage("ascii");
keywords = "MODEL_IMAGE PREVIEW_IMAGE";


saveShowSequenceNumbers = getProperty("showSequenceNumbers");
sequenceNumber = getProperty("sequenceNumberStart");
writeln("%");
writeln(programName);            Add this line here
writeln(programComment);      Add this line here

 

Then either delete all the stuff shown below or just comment it out as shown below using the /* start and */ end

 

/*
if (programName) {
var programId;
try {
programId = getAsInt(programName);
} catch (e) {
error(localize("Program name must be a number."));
return;
}
if (!((programId >= 1) && (programId <= 99999))) {
error(localize("Program number is out of range."));
return;
}
writeln(
"O" + oFormat.format(programId) +
conditional(programComment, " " + formatComment(programComment.substr(0, maximumLineLength - 2 - ("O" + oFormat.format(programId)).length - 1)))
);
lastSubprogram = (initialSubprogramNumber - 1);
} else {
error(localize("Program name has not been specified."));
return;
}
*/

0 Likes
Message 4 of 12

RandyY98W5
Participant
Participant
While this works it will be a pain to go back and change it in all of my existing programs which use program name and program comment the "right way around." If you are going to get rid of the file picker it would be more useful to have an option to generate the file name and path in code in the post. I name my programs very consistently OP1, OP2, OP3 and so on for the different steps to make a complete part, and it would be handy to automate this naming convention. This could be extended to, for example, automatically create a subfolder for each project to keep programs for the same part together. Or to change the name based on other factors such as the number of work offsets used. I often post two versions of a program using the same program number, a single offset for setup and multiples for production.
0 Likes
Message 5 of 12

engineguy
Mentor
Mentor

@RandyY98W5 

 

Puzzled, why would you need to go and swap everything over ??

Did you not read the response that I Posted saying that the method of modifying the PP that I used does keep the Program Name and the Program Comment in the original boxes so I am not undestanding your problem ??

There is a sample PP attached to my previous Post that will output the Program Name as it is typed into the Program Name/Number in the G code at the top as in the image below 🙂 🙂 🙂

HAAS Names example code.jpg

 

Message 6 of 12

seth.madore
Community Manager
Community Manager

@RandyY98W5 @Jools-Taylor for the record, we are looking into a mechanism to introduce "File Name" into the new NC Program dialog, this should help solve this particular issue


Seth Madore
Customer Advocacy Manager - Manufacturing


Message 7 of 12

engineguy
Mentor
Mentor

@seth.madore 

 

Yes, that would be good, taking a while but getting there hopefully soon 🙂 🙂

 

Also good to see that some stuff is being made easier to read, I am almost happy with the NC Program now, I can mostly see it OK 🙂 🙂 🙂

0 Likes
Message 8 of 12

Jools-Taylor
Advocate
Advocate

Hi All and thanks for the answers. 

 

For me I think I'm going to go back to legacy. The problem with all the answers here are that while they essentially solve my problem they make overwriting an issue. Say I edit a file and I'm not sure what I've called it then I have to interrupt workflow to get the name right. With legacy I just clicked on the file I wanted to overwrite and done. If I was working on this at the time the machine updated straight away too. 

@Anonymous where is the legacy? I looked and couldn't find an obvious one to click?

Jools

0 Likes
Message 9 of 12

seth.madore
Community Manager
Community Manager

In Preferences:

2021-09-17_05h52_49.png

For the record, we are working on a way to allow users to search to a directory and overwrite a file. Stay tuned! 


Seth Madore
Customer Advocacy Manager - Manufacturing


0 Likes
Message 10 of 12

cam.mdyer
Community Visitor
Community Visitor

Thanks for your help this worked great!!! 

0 Likes
Message 11 of 12

programming2C78B
Mentor
Mentor

Is there any way you can try it with my post? When I do it, Fusion won't import it and says its an invalid PP.

Please click "Accept Solution" if what I wrote solved your issue!
0 Likes
Message 12 of 12

engineguy
Mentor
Mentor

@programming2C78B 

 

Seems to work OK here assuming that what I have is what you want. This works in both the "Legacy" and the "NC Program" Post Processing methods, see images below, I have typed text into the "Name/Number" and also in the "Comment" box as shown in the first image, both are output as shown in the second image. Your PP modified is attached, all you should need to do is "Copy/Paste" it into your Post Processor Library that you normally use. If they need to be in Brackets (Name) for the machine control then just type them in.

HAAS Name in code.jpg

 

HAAS Name in code-2.jpg

 

0 Likes