Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

POST PROCESSOR NCI FILE


HEAVY METAL
 Share

Recommended Posts

I don't know about a post nci.

 

But I did try a few thing on the MC9 generic fanuc post

 

And I was able to get it to output this

 

code:

%

O1000

(PROGRAM NAME - TEST )

(DATE=DD-MM-YY - 19-01-06 TIME=HH:MM - 21:37 )

N2 G20

N4 G0 G17 G40 G49 G80 G90

( 1/4 CENTERDRILL TOOL - 1 DIA. OFF. - 1 LEN. - 1 DIA. - .25 )

( DRILL AT 0 DEG )

N6 T1 M6

N8 G0 G90 G54 X0. Y0. S3667 M3

N10 G43 H1 Z2.

N12 G98 G81 Z.9 R1.1 F7.33

N14 X-1.

N16 G80

( DRILL AT 90 DEG )

N18 M99

N20 M90

N22 X0.

N24 G98 G81 Z.9 R1.1 F7.33

N26 X-1.

N28 G80

( DRILL AT 45 DEG )

N30 M84

N32 M85

N34 X0.

N36 G98 G81 Z.9 R1.1 F7.33

N38 X-1.

N40 G80

( DRILL AT 135 DEG )

N42 M91

N44 M93

N46 M95

N48 X0.

N50 G98 G81 Z.9 R1.1 F7.33

N52 X-1.

N54 G80

N56 M5

N58 G91 G28 Z0.

N60 G28 X0. Y0.

N62 M80

N64 M01

( 1/8 FLAT ENDMILL TOOL - 2 DIA. OFF. - 2 LEN. - 2 DIA. - .125 )

( MILL AT 0 DEG )

N66 T2 M6

N68 G0 G90 G54 X-.2625 Y-.025 S5000 M3

N70 G43 H2 Z2.

N72 Z1.1

N74 G1 Z1. F50.

N76 G41 D2 X-.2125 F9.6

N78 G3 X-.1875 Y0. R.025

N80 G2 X.1875 R.1875

N82 X-.1875 R.1875

N84 G3 X-.2125 Y.025 R.025

N86 G1 G40 X-.2625

N88 G0 Z2.

N90 X-1.2625 Y-.025

N92 Z1.1

N94 G1 Z1. F50.

N96 G41 D2 X-1.2125 F9.6

N98 G3 X-1.1875 Y0. R.025

N100 G2 X-.8125 R.1875

N102 X-1.1875 R.1875

N104 G3 X-1.2125 Y.025 R.025

N106 G1 G40 X-1.2625

N108 G0 Z2.

( MILL AT 135 DEG )

N110 M91

N112 M93

N114 M95

N116 X-.2625 Y-.025

N118 Z1.1

N120 G1 Z1. F50.

N122 G41 D2 X-.2125 F9.6

N124 G3 X-.1875 Y0. R.025

N126 G2 X.1875 R.1875

N128 X-.1875 R.1875

N130 G3 X-.2125 Y.025 R.025

N132 G1 G40 X-.2625

N134 G0 Z2.

N136 X-1.2625 Y-.025

N138 Z1.1

N140 G1 Z1. F50.

N142 G41 D2 X-1.2125 F9.6

N144 G3 X-1.1875 Y0. R.025

N146 G2 X-.8125 R.1875

N148 X-1.1875 R.1875

N150 G3 X-1.2125 Y.025 R.025

N152 G1 G40 X-1.2625

N154 G0 Z2.

N156 M5

N158 G91 G28 Z0.

N160 G28 X0. Y0.

N162 M80

N164 M30

%

Here is what i changed in the post

code:

# Table rotation direction 

# Table rotation direction, index

sindx_cw M8 #Rotate CW code

sindx_ccw M9 #Rotate CCW code

sindx_mc #Target for string

 

fstrsel sindx_cw indx_mc sindx_mc

code:

pindex          #Index output

if index & rot_on_x,

[

if cabs <> prvcabs,

[

spaces = 0

if indx_out = 0, n, " ", sindx_mc, "0", e

if indx_out >= 100,

[

n, " ", sindx_mc, "1", e

indx_out = indx_out-100

if indx_out = 0, n, " ", sindx_mc, "0", e

]

 

if indx_out >= 90,

[

if indx_out < 100,

[

n, " ", sindx_mc, "9", e

indx_out = indx_out-90

if indx_out = 0, n, " ", sindx_mc, "0", e

]

]

 

if indx_out >= 80,

[

if indx_out < 90,

[

n, " ", sindx_mc, "8", e

indx_out = indx_out-80

if indx_out = 0, n, " ", sindx_mc, "0", e

]

]

 

if indx_out >= 70,

[

if indx_out < 80,

[

n, " ", sindx_mc, "7", e

indx_out = indx_out-70

if indx_out = 0, n, " ", sindx_mc, "0", e

]

]

 

if indx_out >= 60,

[

if indx_out < 70,

[

n, " ", sindx_mc, "6", e

indx_out = indx_out-60

if indx_out = 0, n, " ", sindx_mc, "0", e

]

]

 

if indx_out >= 50,

[

if indx_out < 60,

[

n, " ", sindx_mc, "5", e

indx_out = indx_out-50

if indx_out = 0, n, " ", sindx_mc, "0", e

]

]

if indx_out >= 40,

[

if indx_out < 50,

[

n, " ", sindx_mc, "4", e

indx_out = indx_out-40

if indx_out = 0, n, " ", sindx_mc, "0", e

]

]

 

if indx_out >= 30,

[

if indx_out < 40,

[

n, " ", sindx_mc, "3", e

indx_out = indx_out-30

if indx_out = 0, n, " ", sindx_mc, "0", e

]

]

 

if indx_out >= 20,

[

if indx_out < 30,

[

n, " ", sindx_mc, "2", e

indx_out = indx_out-20

if indx_out = 0, n, " ", sindx_mc, "0", e

]

]

 

if indx_out >= 10,

[

if indx_out < 20,

[

n, " ", sindx_mc, "1", e

indx_out = indx_out-10

if indx_out = 0, n, " ", sindx_mc, "0", e

]

]

 

if indx_out = 9, n, " ", sindx_mc, "9", e

if indx_out = 8, n, " ", sindx_mc, "8", e

if indx_out = 7, n, " ", sindx_mc, "7", e

if indx_out = 6, n, " ", sindx_mc, "6", e

if indx_out = 5, n, " ", sindx_mc, "5", e

if indx_out = 4, n, " ", sindx_mc, "4", e

if indx_out = 3, n, " ", sindx_mc, "3", e

if indx_out = 2, n, " ", sindx_mc, "2", e

if indx_out = 1, n, " ", sindx_mc, "1", e

 

 

spaces = 1

]

]

Maybe someone else knows an easier way. But this is what worked for me in a couple test programs.

 

However i was not able to get this to work in a program that I used transform rotate toolpath.

 

 

Also, i only used whole numbers. I'm not sure how to go about doing it if you are rotating in less than 1 deg increments.

 

HTH

Link to comment
Share on other sites

I just realised i didn't have it set up for any angle over 180

 

so I changed this

 

code:

pindex          #Index output

if index & rot_on_x,

[

if cabs <> prvcabs,

[

spaces = 0

 

if indx_out = 0, n, " ", sindx_mc, "0", e

 

if indx_out >= 300,

[

n, " ", sindx_mc, "3", e

indx_out = indx_out-300

if indx_out = 0, n, " ", sindx_mc, "0", e

]

 

if indx_out >= 200,

[

n, " ", sindx_mc, "2", e

indx_out = indx_out-200

if indx_out = 0, n, " ", sindx_mc, "0", e

]

 

if indx_out >= 100,

[

n, " ", sindx_mc, "1", e

indx_out = indx_out-100

if indx_out = 0, n, " ", sindx_mc, "0", e

]

in the post

 

and was able to get this nc output

 

code:

( DRILL AT 45 DEG )

N30 M84

N32 M85

N34 X0.

N36 G98 G81 Z.9 R1.1 F10.

N38 X-1.

N40 G80

( DRILL AT 315 DEG )

N42 M83

N44 M81

N46 M85

N48 X0.

N50 G98 G81 Z.9 R1.1 F10.

N52 X-1.

N54 G80

( DRILL AT 135 DEG )

N56 M91

N58 M93

N60 M95

N62 X0.

N64 G98 G81 Z.9 R1.1 F10.

N66 X-1.

N68 G80

( DRILL AT 225 DEG )

N70 M92

N72 M92

N74 M95

N76 X0.

N78 G98 G81 Z.9 R1.1 F10.

N80 X-1.

N82 G80

N84 M5

N86 G91 G28 Z0.

also just so you are aware I have the post setup to always be positive between 0 and 360 deg

here

 

code:

pindxcalc       #Index move calculations, direction is shortest

#Check if in tolerance

cdelta = frac(abs(csav)/ctable)

if cdelta > ixtol & cdelta < 1-ixtol,

result = mprint(sindxerror)

cdelta = prvcabs - cabs

#Phase shift delta 10 revolutions, check odd/even

if frac(int((cdelta + 3600)/180)/two), indx_mc = one

else, indx_mc = zero

#Set range 0-360

indx_out = csav

while indx_out < 0, indx_out = indx_out + 360

while indx_out >= 360, indx_out = indx_out - 360

Link to comment
Share on other sites

Not, a problem.

 

I'll be honest w/ you. I've never seen a rotary that requires code like that. I just thought it would be fun to try and figure out how to do it.

 

But I'm guessing yes, you will need code for each angle. ex. our rotary requires a G120 before each rotation. but almost all rotaries and indexers required something different.

 

Do you by any chance have a manual for the indexer you are using. That may have a better definition of exactly what is required at each rotation. Then if there is more, or less required than what you currently have we can probably find the answer.

Link to comment
Share on other sites

code:

( DRILL AT 135 DEG )

N56 M91

N58 M93

N60 M95

N62 X0.

N64 G98 G81 Z.9 R1.1 F10.

N66 X-1.

N68 G80

( DRILL AT 225 DEG )

N70 M92

N72 M92

N74 M95

N76 X0.

N78 G98 G81 Z.9 R1.1 F10.

N80 X-1.

N82 G80

( DRILL AT 180 DEG )

N84 M81

N86 M88

N88 M80

N90 X0.

N92 G98 G81 Z.9 R1.1 F10.

N94 X-1.

N96 G80

( DRILL AT 270 DEG )

N98 M92

N100 M97

N102 M90

N104 X0.

N106 G98 G81 Z.9 R1.1 F10.

N108 X-1.

N110 G80

N112 M5

N114 G91 G28 Z0.

N116 G28 X0. Y0.

N118 M90

N120 M01

I'll put the post on the FTP. Like I said it's just the generic fanuc. It's under the text_post_misc folder

 

Called it Heavy_post.zip

 

If you want, and it wouldn't get you in trouble you could send me the file (or upload it) you're working on and I'll run my test using it. There may be something I'm over looking.

Link to comment
Share on other sites

Heavy,

I think I have fixed the output to be three places

 

Here are all of the changes I made

 

Replace the entire pindex section to this. It's cleaner i believe fixed our issues

code:

pindex          #Index output

spaces = 0

if index & rot_on_x & cabs <> prvcabs,

[

if indx_out < 100, n, " ", sindx_mc, "0", e

 

if indx_out < 10, n, " ", sindx_mc, "0", e

 

if indx_out >= 300,

[

n, " ", sindx_mc, "3", e

indx_out = indx_out-300

]

 

if indx_out >= 200,

[

n, " ", sindx_mc, "2", e

indx_out = indx_out-200

]

 

if indx_out >= 100,

[

n, " ", sindx_mc, "1", e

indx_out = indx_out-100

]

 

if indx_out >= 90 & indx_out < 100,

[

n, " ", sindx_mc, "9", e

indx_out = indx_out-90

]

 

if indx_out >= 80 & indx_out < 90,

[

n, " ", sindx_mc, "8", e

indx_out = indx_out-80

]

 

if indx_out >= 70 & indx_out < 80,

[

n, " ", sindx_mc, "7", e

indx_out = indx_out-70

]

 

if indx_out >= 60 & indx_out < 70,

[

n, " ", sindx_mc, "6", e

indx_out = indx_out-60

]

 

if indx_out >= 50 & indx_out < 60,

[

n, " ", sindx_mc, "5", e

indx_out = indx_out-50

]

 

if indx_out >= 40 & indx_out < 50,

[

n, " ", sindx_mc, "4", e

indx_out = indx_out-40

]

 

if indx_out >= 30 & indx_out < 40,

[

n, " ", sindx_mc, "3", e

indx_out = indx_out-30

]

 

if indx_out >= 20 & indx_out < 30,

[

n, " ", sindx_mc, "2", e

indx_out = indx_out-20

]

 

if indx_out >= 10 & indx_out < 20,

[

n, " ", sindx_mc, "1", e

indx_out = indx_out-10

]

 

if indx_out < 10, n, " ", sindx_mc, indx_out, e

 

]

 

 

spaces = 1

also change this

 

code:

fmt  A   4   indx_out    #Index position

to this

code:

fmt     16   indx_out    #Index position

These changes caused the post to put out the following nc code

 

code:

( DRILL AT 0 DEG )

N24 M80

N26 M80

N28 M80

N30 X0.

N32 G98 G81 Z.9 R1.1 F10.

N34 X-1.

N36 G80

( DRILL AT 3 DEG )

N38 M90

N40 M90

N42 M93

N44 X0.

N46 G98 G81 Z.9 R1.1 F10.

N48 X-1.

N50 G80

( DRILL AT 9 DEG )

N52 M90

N54 M90

N56 M99

N58 X0.

N60 G98 G81 Z.9 R1.1 F10.

N62 X-1.

N64 G80

( DRILL AT 45 DEG )

N66 M90

N68 M94

N70 M95

N72 X0.

N74 G98 G81 Z.9 R1.1 F10.

N76 X-1.

N78 G80

Link to comment
Share on other sites

Maybe this coding is a little more compact. You can run this post with a dummy -.NCI file (any -.NCI file -- the -.NCI file is not read if the only prenamed postblock is the PQ postblock.

 

fastmode : yes

 

fs 6 1 0n

 

fmt 6 a1 # Hundreds digit

fmt 6 a2 # Tens digit

fmt 6 a3 # Units digit

# ^ When there is no prefix letter, the number will concatenate (no space)

 

spaces : 1

 

fq 1 a Input positive angle 0..360, neg. angle to exit

 

pq

q1 # Prompt to input test number

pdig

 

pdig # Find the separate digits in input value 'A'

a3 = frac(a/10) * 10 # Units digit

a1 = int(a/10)

if a1 = 0, pdig1 # Delete this line to output leading zeroes

a2 = frac(a1/10) * 10 # Tens digit

a1 = int(a1/10)

if a1 = 0, pdig2 # Delete this line to output leading zeroes

pdig3 # Hundreds digit

 

pdig3 # Output 3 digits

a1, e # ",e" produces a linfeed

pdig2

 

pdig2 # Output 2 digits

a2, e

pdig1

 

pdig1 # Output 1 digit

a3,e

ex

 

1999. Product major version number that post supports? 9

Link to comment
Share on other sites

FS is the Format Statement. FS 6 means it's Format Statement number 6. It could be an;y number except 1 if it should concatenate with the CW/CCW variable (add on with no spaces). The FMT statement for the angle digit should then reference FS 6. The last two digits of the FS (1 0n) mean "output 1 digit before the decimal point and 0 digits after the decimal". The 'n' is important. It means non-modal, which means output the digit even if the digit was the same the last time it was output. The space between the 1 and 0 would be a "." if you wanted to output the decimal point.

Link to comment
Share on other sites

The original angle is "a".

The purpose of a1, a2, and a3 are explained at the top of the post in 3 FMT statements. They are the hundreds digit, the tens digit, and the units digit of the 0..360 number being broken down. A1 is also used temporarily to store a partial breakdown number. There is no manual which will explain this, since these are user-named variables. I made up both their name and usage. INT and FRAC isolate the integer and fraction portion of a number. If you send me an e-mail I can send you the file.

Link to comment
Share on other sites

I will definetly agree that Johns way was Nice and compact. I only know enough about post's to be dangerous.

 

I will have to learn more about the math involved w/ the Int and Frac values.

 

Mike thanks for the link.

 

and Heavy, Wasn't a problem. John ended up doing all the work for me I just had to get it into your post. I think my original way would have ended up working (once I got all the bugs worked out) But fortunately someone else saved the day.

cheers.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...