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:

Using mi to set extended offset


Recommended Posts

I am trying to have the mi variables work to set the extended offset if needed. This is a modified HAAS post.

I have the misc page set up with additional text correctly (see screen shot attached). I can't seem to remember what I need to get the mi5 to output correctly;(

 

Here is what I have in the post:

 

if mi4$ = 1, #use extended offset

[

extoffsetnum = mi5$

"G154 P", extoffsetnum #output extended offset

]

 

and here is the output :

N120 T116 M6

N130 G0 G90 G154 P extoffsetnum 10. X2.0359 Y.5566 S6000 M3

N140 G43 H116 Z.25

 

I would like it to just output "G154 P10" or whatever number is in mi5

 

Thanks

Karl

post-930-0-85511800-1385058236_thumb.jpg

Link to comment
Share on other sites

Upon second look, it appears that you were declaring the variable and assigning the value of mi5$ in the same line? If so, you need to keep the assignment, but add a few spaces to get the line away from the far left side.

 

Anytime a variable is all the way to the left, it is considered a declaration. If you have a fmt statement and a declaration for the same variable, an error will be generated.

Link to comment
Share on other sites

Well do what I did for posts years ago.

 

pwcs		    #G54+ coordinate setting at toolchange
  if workofs$ <> prv_workofs$ | (force_wcs & toolchng > zero),
    [
    if workofs$ >= 0, workofs$ = 54
    if workofs$ = 49, if mprint(swcserror4953, 2) = 2, exitpost$
    if workofs$ = 50, if mprint(swcserror4953, 2) = 2, exitpost$
    if workofs$ = 51, if mprint(swcserror4953, 2) = 2, exitpost$
    if workofs$ = 52, if mprint(swcserror4953, 2) = 2, exitpost$
    if workofs$ = 53, if mprint(swcserror4953, 2) = 2, exitpost$	   
    if workofs$ > 59, if mprint(swcserror60, 2) = 2, exitpost$
    if workofs$ > 53, #G54 ~ G59 output
	  [
	  g_wcs = workofs$
	  *g_wcs
	  ]
    else, #Extended work offset output
	  [
	  p_wcs = workofs$ #P1 ~ P48 output
	  "G54.1", *p_wcs
	  ]
    ]
  !workofs$
swcserror4953   : "ERROR-WORK OFFSET NUMBER SET 49-53 SET TO 54-59 OR 1-48"
swcserror60   : "ERROR-WORK OFFSET NUMBER OUT OF RANGE HIGHER THAN 59 SET TO 54-59 OR 1-48"

 

With this method you set 54 as G54 and 1 and G54.1 P1 and such. If the person makes an error setting something wrong then they will get a warning to set it correctly.

 

HTH

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