How to generate multiple files during post processing, one per tool change?

How to generate multiple files during post processing, one per tool change?

Anonymous
Not applicable
3,234 Views
9 Replies
Message 1 of 10

How to generate multiple files during post processing, one per tool change?

Anonymous
Not applicable

Hi. I'm using the LinuxCNC post processors from HSM Posts. I like to generate one post per operation generally, step through them one by one, tweaking each operation as needed. Currently, to generate the posts, I need to select each operation, one after another, type in 1001, then select the next and type in 1002, etc. Is there a way to generate one file per operation, in order?

 

I found the following link to a FAQ that suggests others out there have the opposite problem and want to know how to combine all the operations into a single file. If there is not an easy toggle for generating one file per operation, please point out a post that does generate one file per operation so I can learn how this is done.

 

https://knowledge.autodesk.com/support/fusion-360/troubleshooting/caas/sfdcarticles/sfdcarticles/Fus...

 

The most ideal situation would be one post per group of consecutive operations with the same tool, with no reordering of tools. For example, operations O1-4 using tools T1, T2, T2, T1 would generate three files F1-3, with operations O1, O2-3, O4. If there's something that I do to enable this behavior or anyone know of a post that already does this please let me know.

 

A small UI tweak that would help is to have the default file name in the post processor dialog update depending on the setup and operation that are currently selected. All increasing, without any filename collisions. Am I overlooking this? Even defining those manually in each operation would be an improvement over counting operations and typing a filename.

 

Thank you, Kent

3,235 Views
9 Replies
Replies (9)
Message 2 of 10

s.noke71
Collaborator
Collaborator

Hi Kent,

posting toolpaths together should be available, just highlight the ones you want then post process.

post processing all operations should be just a matter of posting from the setup header.

If im reading this correct if you right click on the setup you can define the program name and definition.

Can you upload a file here so i can see what else i can help with? 

 

you can also break up your programs with manual inserts of nc code ie stop or comment click setup manual NC

0 Likes
Message 3 of 10

Anonymous
Not applicable

Hi, please find the part and post files attached. Currently, posting the setup generates a single file. I frequently need to update individual operations or rerun them (e.g. because of tool deflection). Posting each operation as a separate file seems to make this easier, but this is a manual process. Perhaps I could modify the post to generate each operation as a subroutine, post the entire setup, call each subroutine. To make this slightly more involved, using the f3d file as an example, ideally the group of operations using tool 10, would be posted as a single file. I.e., generate files for each change in tool. Again, I could probably do this with subroutines triggered by change in tool. I'd like to follow common industry practice for posting and debugging each operation instead of any kludge I've made work, so all suggestions welcomed. Thank you, Kent

0 Likes
Message 4 of 10

s.noke71
Collaborator
Collaborator

Hi Kent,

 I believe this may do what you intended post all out as one program, or individually as consecutive prog numbers.

to post all out you have to right click on the higher level setups and post rom there. All others can be done as normal.

I Believe you could also do a lot more with a slightly different post processor one that would recognise goto or skip commands.

0 Likes
Message 5 of 10

s.noke71
Collaborator
Collaborator

Please delete the original lathe operations 👌

0 Likes
Message 6 of 10

Anonymous
Not applicable

@Anonymous wrote:

Hi, please find the part and post files attached. Currently, posting the setup generates a single file. I frequently need to update individual operations or rerun them (e.g. because of tool deflection). Posting each operation as a separate file seems to make this easier, but this is a manual process. Perhaps I could modify the post to generate each operation as a subroutine, post the entire setup, call each subroutine. To make this slightly more involved, using the f3d file as an example, ideally the group of operations using tool 10, would be posted as a single file. I.e., generate files for each change in tool. Again, I could probably do this with subroutines triggered by change in tool. I'd like to follow common industry practice for posting and debugging each operation instead of any kludge I've made work, so all suggestions welcomed. Thank you, Kent


Hi Kent,

What I've done in the past is modify the post such that sequence numbers are only posted at the beginning of each operation.  This makes it easier to jump around on the controller.  Then the post is also setup to output the safety line and tool change for every operation.  This way you can start on any toolpath without having to run through the first few lines of the program to run something further down.  Subroutines can also be added to the post but i haven't found it necessary for what you are trying to do.

Message 7 of 10

Anonymous
Not applicable

Hi Nick, I'm finally coming back to this. I have a CAM with many ops and tools and exporting them one by one is painful. I want to check that I'm understanding your recommendation: modify the post so that each call to onSection (I hope I remembered this correctly), export the entire preamble, the tool change, and then the operation code. Maybe add optional stops between all operations to allow pauses between operations with the same tool. Is that roughly correct? Will including the entire preamble each time make sure the modal states are correct and didn't know what you meant by safety line.

 

Thank you!

0 Likes
Message 8 of 10

ivan_rados
Enthusiast
Enthusiast

This is a really interesting topic, I am also looking if anyone for help is available?

It would be at least really nice to know which JavaScript function to use to get operations posted out as separate files, or how to use something like the node.js file system module to be able to call something like the function:

writeFile( Path, Data, Callback)

 

Saving would take mainly the function onSection and onSectionEnd in the post processors. Other information would be saved like in a main file (beginning of the program, ending of the program, tool list... basically everything else).

 

The option with click on every operation and post every single one of them is ok but not satisfying, imagine every time you have 20 of them, and 20x RC post process or if you would like to have a main file that calls the separate files.

 

regards,

Ivan  R

Message 9 of 10

ivan_rados
Enthusiast
Enthusiast

Now I've checked it, there is a Funuc with Subprograms, it has it under the properties and you get an output of one main program and Subprograms to make it all work.

 

That could be translated to any other PP. Working on the onSection beginning where it is all called and the onSection end. Along with some collected state variable, format for the output of subprograms names and the main property which makes it easy to decide weather you want multiple files for every operation.

 

This would suite me, what about the question of the thread:

Are Multiple files for every operation only needed, or is it ok to have a main program with multiple files for every program?

 

regards,

Ivan R

0 Likes
Message 10 of 10

yookey007
Explorer
Explorer

I am wondering if there are any other functions related to file handling. I found "FileSystem.copyFile" in one of the post-processors but couldn't find anything related to creating a new file.

0 Likes