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:

Misc. Integer Help


Mic6
 Share

Recommended Posts

So I set-Up Misc Int. #4 with an M31 to turn on my chip auger. My program has 5 ops. I wanted to turn it on in the fourth op. After it's on and I post all the ops, it wont post. If I post the fourth operation by itself, it will come out correctly. Here's where it is in my post in the

 

psof$ #Start of file for non-zero tool number :

 

code:

       

comment$

pcan

n$=t$

pbld, n$, *t$, sm06,

ptoolcomment

e$

pindex

if mi1$ > one, absinc$ = zero

pcan1, pbld, n$, *sgcode, *sgabsinc, pwcs, pfxout, pfyout, pfcout,

*speed, *spindle, pgear, strcantext, e$

pbld, n$, sg43, *tlngno$, pfzout, pstagetool, e$

if mi4$ = 1, n$, "M31" "(CHIP AUGER ON)", e$ <------------------

pbld, n$, scoolant, e$

absinc$ = sav_absinc

pcom_movea

toolchng = zero

c_msng$ #Single tool subprogram call

banghead.gif

 

[ 06-17-2009, 09:12 AM: Message edited by: Mic6 ]

Link to comment
Share on other sites

You probably need to put the same condition into the ptlchg$ and the ptlchg0$ block as well because psof$ is only read at the beginning of the program so if the first operation has the mis value turn off it will never be read again.

By copying this condition in the 2 other post block I mentionned you will be able to read the value of your misc value at every operation.

HTH

Link to comment
Share on other sites

Can anybody tell me if I have the last 2 Misc Int's for my chip auger in the right place? I've moved them all around, but it still acts as if it's only in the psof$

 

code:

 psof$            #Start of file for non-zero tool number             

 

prv_tloffno$ = c9k

pcuttype

toolchng = one

if ntools$ = one,

[

#skip single tool outputs, stagetool must be on

stagetool = m_one

!next_tool$

]

pbld, n$, *smetric, e$

pbld, n$, *sgcode, *sgplane, scc0, sg49, sg80, *sgabsinc, e$

pbld, "G91 G28 Z0" #(added machine home 10/22/08)

sav_absinc = absinc$

if mi1$ <= one, #Work coordinate system

[`

absinc$ = one

pfbld, n$, sgabsinc, *sg28ref, "Z0.", e$

pfbld, n$, *sg28ref, "X0.", "Y0.", e$

pfbld, n$, sg92, *xh$, *yh$, *zh$, e$

absinc$ = sav_absinc

]

 

pcom_moveb

pcheckaxis

c_mmlt$ #Multiple tool subprogram call

# ptoolcomment marked out this line added it 4 Down to get tool comment on 1st tool change line

 

comment$

pcan

n$=t$

pbld, n$, *t$, sm06,

ptoolcomment

e$

pindex

if mi1$ > one, absinc$ = zero

pcan1, pbld, n$, *sgcode, *sgabsinc, pwcs, pfxout, pfyout, pfcout,

*speed, *spindle, pgear, strcantext, e$

pbld, n$, sg43, *tlngno$, pfzout, pstagetool, e$

if mi4$ = 1, n$, "M31" "(CHIP AUGER ON)", e$ #(added misc. int for auger 12/22/08)<---------------------------

pbld, n$, scoolant, e$

absinc$ = sav_absinc

pcom_movea

toolchng = zero

c_msng$ #Single tool subprogram call

 

ptlchg0$ #Call from NCI null tool change (tool number repeats)

pcuttype

pcom_moveb

pcheckaxis

!op_id$

c_mmlt$ #Multiple tool subprogram call

 

comment$

if mi4$ = 1, n$, "M31" "(CHIP AUGER ON)", e$ #(added misc. int for auger 12/22/08)<------------------------------

pcan

pbld, n$, sgplane, e$

pspindchng

pbld, n$, scoolant, e$

if mi1$ > one & workofs$ <> prv_workofs$,

[

sav_absinc = absinc$

absinc$ = zero

pbld, n$, sgabsinc, pwcs, pfxout, pfyout, pfzout, pfcout, e$

pe_inc_calc

ps_inc_calc

absinc$ = sav_absinc

]

if cuttype = zero, ppos_cax_lin

if gcode$ = one, plinout

else, prapidout

pcom_movea

c_msng$ #Single tool subprogram call

 

ptlchg$ #Tool change

pcuttype

toolchng = one

if mi1$ = one, #Work coordinate system

[

pfbld, n$, *sg28ref, "X0.", "Y0.", e$

pfbld, n$, sg92, *xh$, *yh$, *zh$, e$

]

if prog_stop = 1, pbld, n$, *sm01, e$

if prog_stop = 2, pbld, n$, *sm00, e$

pcom_moveb

pcheckaxis

c_mmlt$ #Multiple tool subprogram call

# ptoolcomment Same as above, disabled this line added it 4 down to enable all tool comments

comment$ #(comment before the N number 11/06/08)

n$=t$

pbld, *n$, "G91 G28 Z0", e$

pbld, "G80 G49 G40 G20 G17", e$

pcan

#comment$ #(placed comment between the T# and the N# 10/28/08)

pbld, n$, *t$, sm06,

ptoolcomment

e$

if mi4$ = 1, n$, "M31" "(CHIP AUGER ON)", e$ #(added misc. int for auger 12/22/08)<-------------------------------

pindex

sav_absinc = absinc$

if mi1$ > one, absinc$ = zero

pcan1, pbld, n$, *sgcode, *sgabsinc, pwcs, pfxout, pfyout, pfcout,

*speed, *spindle, pgear, strcantext, e$

pbld, n$, sg43, *tlngno$, pfzout, pstagetool, e$

pbld, n$, scoolant,e$ #added following line JM 021209

pbld, n$, "/M8", e$

absinc$ = sav_absinc

pcom_movea

toolchng = zero

c_msng$ #Single tool subprogram call


Link to comment
Share on other sites
  • 2 weeks later...

Well, I tried placing my Misc. Int right under neath the ptoolchange$ where Misc. Int 1 is placed, but it still won't post my M31 when I want to use it on something other than the first operation. Any other ideas?

 

code:

 ptlchg0$         #Call from NCI null tool change (tool number repeats)                        

pcuttype

pcom_moveb

pcheckaxis

!op_id$

c_mmlt$ #Multiple tool subprogram call

if mi4$ = one, n$, "M31" "(CHIP AUGER ON)", e$ #(added misc. int for auger 12/22/08)

comment$

pcan

pbld, n$, sgplane, e$

pspindchng

pbld, n$, scoolant, e$

if mi1$ > one & workofs$ <> prv_workofs$,

[

sav_absinc = absinc$

absinc$ = zero

pbld, n$, sgabsinc, pwcs, pfxout, pfyout, pfzout, pfcout, e$

pe_inc_calc

ps_inc_calc

absinc$ = sav_absinc

]

if cuttype = zero, ppos_cax_lin

if gcode$ = one, plinout

else, prapidout

pcom_movea

c_msng$ #Single tool subprogram call

 

ptlchg$ #Tool change

pcuttype

toolchng = one

if mi1$ = one, #Work coordinate system

if mi4$ = one, n$, "M31" "(CHIP AUGER ON)", e$ #(added misc. int for auger 12/22/08)

[

pfbld, n$, *sg28ref, "X0.", "Y0.", e$

pfbld, n$, sg92, *xh$, *yh$, *zh$, e$

]

if prog_stop = 1, pbld, n$, *sm01, e$

Link to comment
Share on other sites

This is the thermal comp on/off for my Hardinge lathes [last line]. This is where I needed to put it so that my code would look like I wanted, but I would suggest just putting yours at the top of the postblock to get it working and then screw around with the formatting

 

code:

 ltlchg          #Toolchange, lathe

toolchng = one

gcode = zero

copy_x = vequ(x)

pcc_capture #Capture LCC ends, stop output RLCC

c_rcc_setup #Save original in sav_xa and shift copy_x for LCC comp.

pcom_moveb #Get machine position, set inc. from c1_xh

c_mmlt #Position multi-tool sub, sets inc. current if G54...

ptoolcomment

comment

if home_type < two, #Toolchange G50/home/reference position

[

sav_xh = vequ(copy_x)

sav_absinc = absinc

absinc = zero

pmap_home #Get home position, xabs

ps_inc_calc #Set start position, not incremental

#Toolchange home position

if home_type = one,

pbld, n, *sgcode, pfxout, pfyout, pfzout, e

else,

[

#Toolchange g50 position

#------------------------------------------------------

# Was this (cdm)

# pbld, n, *sg28ref, "X20.", [if y_axis_mch, "V0."], "Z20.", e

#-------------------------------------------------------

pbld, n, *sg28ref, e

if mi5 = one, pbld, n, "M88", e # Added thermal comp (cdm)

Link to comment
Share on other sites

mic6,

 

Are you getting any post erros? From the code you posted above, you should have been.

 

It looks like you jammed the if statement for mi4$ right in the wrong spot breaking the logic for the if check of mi1$. when run, this should have produced some errors.

 

using the code from the above post

 

Change from this

code:

ptlchg$          #Tool change                                        

pcuttype

toolchng = one

if mi1$ = one, #Work coordinate system

if mi4$ = one, n$, "M31" "(CHIP AUGER ON)", e$ #(added misc. int for auger 12/22/08)

[

pfbld, n$, *sg28ref, "X0.", "Y0.", e$

pfbld, n$, sg92, *xh$, *yh$, *zh$, e$

]

if prog_stop = 1, pbld, n$, *sm01, e$


to this

code:

ptlchg$          #Tool change                                        

pcuttype

toolchng = one

if mi4$ = one, n$, "M31" "(CHIP AUGER ON)", e$ #(added misc.int for auger 12/22/08)

if mi1$ = one, #Work coordinate system

[

pfbld, n$, *sg28ref, "X0.", "Y0.", e$

pfbld, n$, sg92, *xh$, *yh$, *zh$, e$

]

if prog_stop = 1, pbld, n$, *sm01, e$


Link to comment
Share on other sites

Ok, were getting somwhere now... it only seems to work when placed here in the ptlchg0$ section as shown. Having it in pthchg$ makes no change

 

code:

 ptlchg0$         #Call from NCI null tool change (tool number repeats)                        

pcuttype

pcom_moveb

pcheckaxis

!op_id$

c_mmlt$ #Multiple tool subprogram call

 

comment$

pcan

pbld, n$, sgplane, e$

pspindchng

pbld, n$, scoolant, e$

if mi4$ = 1, n$, "M31" "(CHIP AUGER ON)", e$ #(added misc. int for auger 12/22/08)

if mi1$ > one & workofs$ <> prv_workofs$,

[

sav_absinc = absinc$

absinc$ = zero

pbld, n$, sgabsinc, pwcs, pfxout, pfyout, pfzout, pfcou

Now the wierd thing is, the M31 line comes on at every retract. I moved it all around that section, but it still comes on after every retract.

 

code:

 G1 X-1.697 F50.

G0 Z.25

( ROUGH ARM )

S8000 M3

M31 (CHIP AUGER ON)

X7.3883 Y-1.0752 Z.321

G1 Z.1286 F25.

Y-5.7827 F50.

Z.0363 F25.

Y-1.0752 F50.

Z-.0561 F25.

Y-5.7827 F50.

Z-.1485 F25.

Y-1.0752 F50.

Z-.2408 F25.

Y-5.7827 F50.

Z-.3332 F25.

Y-1.0752 F50.

Z-.4255 F25.

Y-5.7827 F50.

Z-.5179 F25.

Y-1.0752 F50.

Z-.6103 F25.

Y-5.7827 F50.

Z-.7026 F25.

Y-1.0752 F50.

Z-.795 F25.

Y-5.7827 F50.

G0 Z.25

Z.321

M31 (CHIP AUGER ON)

X5.8883 Y-.6166

G1 Z.1286 F25.

Y-5.2965 F50.

Z.0363 F25.

Y-.6166 F50.

Z-.0561 F25.

Y-5.2965 F50.

Z-.1485 F25.

Y-.6166 F50.

Z-.2408 F25.

Y-5.2965 F50.

Z-.3332 F25.

Y-.6166 F50.

Z-.4255 F25.

Y-5.2965 F50.

Z-.5179 F25.

Y-.6166 F50.

Z-.6103 F25.

Y-5.2965 F50.

Z-.7026 F25.

Y-.6166 F50.

Z-.795 F25.

Y-5.2965 F50.

G0 Z.25

Z.321

M31 (CHIP AUGER ON)

X4.3883 Y-.158

G1 Z.1286 F25.

Y-4.8655 F50.

Z.0363 F25.

Y-.158 F50.

Z-.0561 F25.

Y-4.8655 F50.

Z-.1485 F25.

Y-.158 F50.

Z-.2408 F25.

Y-4.8655 F50.

Z-.3332 F25.

Y-.158 F50.

Z-.4255 F25.

Y-4.8655 F50.

Z-.5179 F25.

Y-.158 F50.

Z-.6103 F25.

Y-4.8655 F50.

Z-.7026 F25.

Y-.158 F50.

Z-.795 F25.

Y-4.8655 F50.

G0 Z.25

Z.321

M31 (CHIP AUGER ON)

X2.8883 Y.1

G1 Z.1286 F25.

Y-4.4069 F50.

Z.0363 F25.

Y.1 F50.

Z-.0561 F25.

Y-4.4069 F50.

Z-.1485 F25.

Y.1 F50.

Z-.2408 F25.

Y-4.4069 F50.

Z-.3332 F25.

Y.1 F50.

Z-.4255 F25.

Y-4.4069 F50.

Z-.5179 F25.

Y.1 F50.

Z-.6103 F25.

Y-4.4069 F50.

Z-.7026 F25.

Y.1 F50.

Z-.795 F25.

Y-4.4069 F50.

G0 Z.25

Z.321

M31 (CHIP AUGER ON)

X1.6383 Y.1

G1 Z.1286 F25.

Y-4.4 F50.

Z.0363 F25.

Y.1 F50.

Z-.0561 F25.

Y-4.4 F50.

Z-.1485 F25.

Y.1 F50.

Z-.2408 F25.

Y-4.4 F50.

Z-.3332 F25.

Y.1 F50.

Z-.4255 F25.

Y-4.4 F50.

Z-.5179 F25.

Y.1 F50.

Z-.6103 F25.

Y-4.4 F50.

Z-.7026 F25.

Y.1 F50.

Z-.795 F25.

Y-4.4 F50.

G0 Z.25

M9

M5

G91 G28 Z0.

M01

So close.... headscratch.gif

Link to comment
Share on other sites

In ptlchg0$ you'll want to change the logic to:

 

if mi4$ = 1 & op_id$ <> prv_op_id$, n$, "M31" "(CHIP AUGER ON)", e$ #(added misc. int for auger 12/22/08)

 

Then you will want to make sure the previous value is updated at the bottom of the psof$, ptlchg$ and ptlchg0$ postblocks by adding a line like this:

 

!op_id$ #Update prv_op_id$ value

 

This way the M31 line will only be output if the operation changes (while still using the same tool) and the new operation has mi4 set to 1.

 

Shoot me over a zip2go if you still can't get it to work and I'll take care of it for you.

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...