How can I write the "A Axis Rotary Gcode" out to a separate file for my indexer

Anonymous

How can I write the "A Axis Rotary Gcode" out to a separate file for my indexer

Anonymous
Not applicable

Hello all....

 

I would like to modify my post processor to be able to output the 4th axis rotary Gcode commands into a separate file that I could then load into the small controller i use for my "A-Axis rotary Device" bolted to the bed of my 3 axis mill.... I would trigger the rotary indexer by issuing an "M200" command that is interfaced to my main controller to make the rotary indexer turn based on the file loaded into the small indexer controller that Fusion post has created for me during the post of the toolpaths in my F360 file.

 

So basically I would like to end up with a "Main Posted File" and a "Separate Posted File"  that would contain output like this:

 

%

G0 A45

G0 A100

G0 A135

etc, etc, etc

M30

%

 

This file could reside on my "Desktop" perhaps and be called something like "Rotary.txt" for example.

If I am correct I believe the post is written in Java Script language but I am unsure of the proper syntax and format to add into my .cps file to make this secondary file output happen...

 

The line on the post option script that outputs the "A Axis Value" could be replaced with the proper syntax needed to create and write the output into this file.... Each subsequent "A Axis Value" would be appended into this opened file and then at the end the file would need to be closed out..... Along with this output to the separate file i would need an "M200" code to be output into the "Main Posted File" to trigger the indexer controller....

 

Clear as mud ?  Would really appreciate direction to take for this functionality .... This is the last piece of the puzzle to close out for my integration with my mill machine...

 

Thanks in advance.

 

Brian

0 Likes
Reply
390 Views
1 Reply
Reply (1)

bob.schultz
Autodesk
Autodesk

Hello Brian,

 

You can take a look at the Siemens 840D post processor for an example of writing a portion of the output to a separate file.  Search for useFilesForSubprograms and you will see that the output is redirected to separate file.  You will see this code where it redirects the output to the separate file.  All output after this will be to the separate file until...

    var path = FileSystem.getCombinedPath(FileSystem.getFolderPath(getOutputPath()), subprogram + "." + subprogramExtension); // set the output path for the subprogram(s)
    redirectToFile(path); // redirect output to the new file (defined above)

... this code is reached in subProgramEnd

  closeRedirection();

Then the output will be directed back to the main file.

 

I hope this helps.



Bob Schultz
Sr. Post Processor Developer

0 Likes