Loading .nc files

More
29 Dec 2010 04:02 - 29 Dec 2010 04:03 #6300 by JoeKumanchik
I am new to EMC and I am having had good success so far. I am using MasterCAM v9.1 and the emcmpfan.pst post processer. I used the stepconf program to set up a small bench top mill. The post processer outputs a .nc file. According to the Intergrater docs, I should be able to modify the (filter) parameter of the .ini file in the Axis program to include .nc files in the list rather then using *.* (all files) selection but I am having on luck. Anyone have any ideas?
Last edit: 29 Dec 2010 04:03 by JoeKumanchik.

Please Log in or Create an account to join the conversation.

More
29 Dec 2010 12:17 #6306 by Rick G
Replied by Rick G on topic Re:Loading .nc files
From the manual SECTION 4.2.3...

The [FILTER] section of the ini file controls how filters work. First, for each type of file, write
a PROGRAM_EXTENSION line. Then, specify the program to execute for each type of file. This
program is given the name of the input file as its first argument, and must write rs274ngc code to
standard output. This output is what will be displayed in the text area, previewed in the display
area, and executed by EMC when Run.
PROGRAM_EXTENSION = .extension Description
If your post processor outputs files in all caps you might want to add the following line:
PROGRAM_EXTENSION = .NGC XYZ Post Processor

If your files are xxx.nc
Then try
PROGRAM_EXTENSION = .nc XYZ Post Processor

Rick G

Please Log in or Create an account to join the conversation.

More
29 Dec 2010 14:50 #6311 by cnr437
Replied by cnr437 on topic Re:Loading .nc files
You can use as like this. add below lines under [FILTER] section in .INI file.

-"- .INI File -"-
PROGRAM_EXTENSION = .nc,.NC MasterCAM File
nc = path/to/mcam-axis
NC = path/to/mcam-axis

Also create one new script mcam-axis executable as like coded similar to below.
It filters "O" and "A" letters for XYZ machine, but if you are using A axis too,
you can modify below code for your purpose.

-*- mcam-axis -*-
#!/usr/bin/python
import sys, os
BASE = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))
sys.path.insert(0, os.path.join(BASE, "lib", "python"))

import gettext;
gettext.install("emc2", localedir=os.path.join(BASE, "share", "locale"), unicode=True)

def main():
    ncfile = open(sys.argv[1],'r')
    lines = ncfile.readlines()
        for line in lines:
            if not "O" in line:
                if "A" in line:
                    line = line.replace("A0.","")
                print line,

if __name__ == "__main__":
    main()

Caner

Please Log in or Create an account to join the conversation.

More
30 Dec 2010 06:28 - 30 Dec 2010 06:30 #6325 by JoeKumanchik
Replied by JoeKumanchik on topic Re:Loading .nc files
Hi Rick,
I tried this but it throws an error. I'm thinking it needs somewhere to point to.

Caner,

I will give this a try.

Thanks both of you for your responce
Last edit: 30 Dec 2010 06:30 by JoeKumanchik.

Please Log in or Create an account to join the conversation.

More
30 Dec 2010 10:42 #6330 by Rick G
Replied by Rick G on topic Re:Loading .nc files
Did you add the line to the FILTER section of your ini file? Or did you edit the existing line? What other lines are there? You could also use a line like ..
PROGRAM_EXTENSION = .nc,.tap xyz post processor
If there is more then one type of file you wish to use add then to the same line seperated by a comma.

Rick G

Please Log in or Create an account to join the conversation.

More
30 Dec 2010 23:39 #6337 by JoeKumanchik
Replied by JoeKumanchik on topic Re:Loading .nc files
OK I have had limited sucess so far. Here is where i am at. I have modified the [Filter] part of the .ini file as follows based on Caner's responce. This added the .nc extension but still gives me an error.

[filter]
PROGRAM_EXTENSION = .nc, .NC MasterCAM File
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image to program filter
PROGRAM_EXTENSION = .py Python Script
nc = /usr/share/axis
NC = /usr/share/axis
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python

I am very new to Linux and am having a hard time figuring out the file structure and I am sure the /usr/share/axis is wrong but I was unclear as to where the "nc = path/to/mcam-axis" was representing.

Please Log in or Create an account to join the conversation.

More
30 Dec 2010 23:55 - 31 Dec 2010 00:08 #6338 by BigJohnT
Replied by BigJohnT on topic Re:Loading .nc files
Just any error or something specific?

The PROGRAM_EXTENSION = .NC, .nc should be enough to allow you to open a nc file with out selecting *.*.

I would just put:

PROGRAM_EXTENSION = .NC NC Post Processor
PROGRAM_EXTENSION = .nc nc Post Processor

and both .nc and .NC files show up in All Machinable Files.have

Also just save all your machinable files in emc2/nc_files directory and your good to go.

John
Last edit: 31 Dec 2010 00:08 by BigJohnT.

Please Log in or Create an account to join the conversation.

More
31 Dec 2010 01:36 #6339 by JoeKumanchik
Replied by JoeKumanchik on topic Re:Loading .nc files
Thanks Everybody for the help.
I reentered the lines just as John suggested and it is working now (not sure what went wrong the last time I tried) and this completes my software chain.
I am using a combo of AUtoCAD 14 and MasterCAM 9.1 both at work and at home. The files are saved in a shared DROPBOX (a free file syncing system via the internet) folder. I redirected the .ini file within the EMC Axis program the the same folder. Now that the filter works, opening the .nc files is a seamless process. By the way, I am using a post processer called "emcmcfan.pst" this processer works great and removes the "0" and "A" codes from my nc files.
Thanks again
Joe

Please Log in or Create an account to join the conversation.

Time to create page: 0.091 seconds
Powered by Kunena Forum