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:

POSTING RANDOM NUMBERS INPUT USING MR6$=


Recommended Posts

In my post I want it to post the number I put in the misc without having to manually go in and put all the possible numbers in the post. Like if I want it to post 13.002. I don't want to give a line in the post that reads  if mR6$= 13.002, pbld, "(HEAD SPACING 13.002)", e$

How do I get to post the head spacing line without needing to type every possible number?

I want the 14.125 to vary in the post as i change numbers, but I also want it to say (HEAD SPACING       )

    if mR6$= 14.125, pbld, "(HEAD SPACING 14.125)", e$
    if mR6$= 13.813, pbld, "(HEAD SPACING 13.813)", e$
    if mR6$= 13.125, pbld, "(HEAD SPACING 13.125)", e$
    if mR6$= 12.813, pbld, "(HEAD SPACING 12.813)", e$
    if mR6$= 11.813, pbld, "(HEAD SPACING 11.813)", e$
    if mR6$= 15.75, pbld, "(HEAD SPACING 15.75)", e$
    if mR6$= 15.75, pbld, "(HEAD SPACING 14.125)", e$
    if mR6$= 13.75, pbld, "(HEAD SPACING 13.75)", e$
    if mR6$= 12.75, pbld, "(HEAD SPACING 12.75)", e$
    if mR6$= 12.125, pbld, "(HEAD SPACING 12.125)", e$
    if mR6$= 11.75, pbld, "(HEAD SPACING 11.75)", e$
    if mR6$= 10.125, pbld, "(HEAD SPACING 10.125)", e$
    if mR6$= 10.813, pbld, "(HEAD SPACING 10.813)", e$

post questions.PNG

Link to comment
Share on other sites

Should be all lower case in the mr6$ you have a capital R in there.

You could make the output from the mr6$ be the output value verses using the condition statements to equal that value. The current method to get output has you do all that extra work that can be avoided.

I thinking something like this should work. You will need to format mr6$ output with the following:

fmt     4    mr6$         #Head Spacing out when mr6$ is used in the program.

Then need to change the logic to output the value when used like so:

if mr6$ > 0 , pbld, "(HEAD SPACING", *mr6&, ")", e$

Now no matter value you put in mr6$ you will get that output when you use anything other than Zero.

Use at your own risk.

 

  • Thanks 1
Link to comment
Share on other sites

Yeah. That's it. neat. Still don't understand completely, This gets me in the right direction. Thanks!

What I have now does work ok.  i just have to match the number exactly. Your technique will be more of what i need.

The mR6 being upper and lowercase didn't matter, but yeah for the script it usually does matter. lowercase is better.

Link to comment
Share on other sites

Here's how I put different manual process codes in my post. It should work for you also.

If mi7$ = 14 the post will output "M00", "(REMOVE CENTER SCREWS THEN ADD CLAMP)", e$

 

sav_mi7    : 0     # Saved mi7 value

       if mi7$ <> 0, pstopcomment #<<<<<<<< insert where you want the numbers to show up.

      You can change pstopcomment to whatever you want. Just change both to the same name.

     For you...     if mR6$= 14.125, pbld, "(HEAD SPACING 14.125)", e$ # if you don't need the pbld you can remove it.

pstopcomment     #pallet rotation macro
      if mi7$ = 1, "M00", "(ADD CAP SCREWS THEN REMOVE CLAMP)", e$
      if mi7$ = 2, "M00", "(REMOVE WASTE MATERIAL)", e$
      if mi7$ = 3, "M00", "(RESET PART TO POSITION 2)", e$
      if mi7$ = 4, "M00", "(MOVE CLAMP TO BOTTOM POSITION)", e$
      if mi7$ = 5, "M00", "(ADD CENTER CLAMPS TO PALLET A)", e$
      if mi7$ = 6, "M00", "(UNCLAMP AND RECLAMP PARTS)", e$
      if mi7$ = 7, "M00", "(ADD CLAMP)", e$
      if mi7$ = 8, "M00", "(ADD CAP SCREWS)", e$
      if mi7$ = 9, "M00", "(ADD CLAMPS)", e$
      if mi7$ = 10, "M00", "(INVERT PARTS PER SETUP SHEET)", e$
      if mi7$ = 11, "M00", "(ADD CLAMP THEN REMOVE CAP SCREWS)", e$
      if mi7$ = 12, "M00", "(ADD OP1-2 CLAMPS THEN REMOVE OP1-1 CLAMPS)", e$
      if mi7$ = 13, "M00", "(REMOVE ANTI-VIBRATION BLOCKS)", e$
      if mi7$ = 14, "M00", "(REMOVE CENTER SCREWS THEN ADD CLAMP)", e$
      if mi7$ = 15, "M00",
        "(ADJUST CASTED SLEEVE WITH 1.97 DIA SHAFT THEN REMOVE)", e$
      if mi7$ = 16, "M00", "(ADD THEN REMOVE CLAMPS PER S/U SHEET)", e$
      if mi7$ = 17, "M00", "(ADD CAP SCREWS THEN REMOVE Y STOP BLOCKS)", e$
      if mi7$ = 18, "M00", "(CLEAN AND DEBURR PART BEFORE PROBING)", e$
      if mi7$ = 19, "M00", "(REMOVE CLAMP)", e$
      if mi7$ = 20, "M00", "(REMOVE CLAMPS)", e$
      if mi7$ = 21, "M00", "(REMOVE ANTI-VIBRATION BLOCK)", e$
      if mi7$ = 22, "M00", "(DEBURR HOLES AND EDGES BEFORE FINISH CUT)", e$
      if mi7$ = 23, "M00", "(CLEAN OUT HOLES WITH DRILLS)", e$
      if mi7$ = 24, "M00", "(ADD CAP SCREWS AND INSPECT Z LOCATION)", e$
      if mi7$ = 25, "M00", "(ADD CAP SCREWS AND INSPECT FOR FULL CLEANUP)", e$
      if mi7$ = 26, "M00", "(ADD CAP SCREWS THEN REMOVE ALL CLAMPS)", e$
      if mi7$ = 27, "M00", "(ADD CLAMPS THEN REMOVE CAP SCREWS)", e$
      if mi7$ = 28, "M00", "(ROTATE PART PER SETUP SHEET)", e$
      " ", e$

*******************************************************

       if mr6$ <> 0, pheadspacing = 1 #<<<<<<<< insert where you want the code to show up.

pheadspacing     # head spacing list

    if mR6$= 14.125, "(HEAD SPACING 14.125)", e$
    if mR6$= 13.813, "(HEAD SPACING 13.813)", e$
    if mR6$= 13.125, "(HEAD SPACING 13.125)", e$
    if mR6$= 12.813, "(HEAD SPACING 12.813)", e$
    if mR6$= 11.813, "(HEAD SPACING 11.813)", e$
    if mR6$= 15.75, "(HEAD SPACING 15.75)", e$
    if mR6$= 15.75, "(HEAD SPACING 14.125)", e$ # note: you need to change 15.75 to 14.125
    if mR6$= 13.75, "(HEAD SPACING 13.75)", e$
    if mR6$= 12.75, "(HEAD SPACING 12.75)", e$
    if mR6$= 12.125, "(HEAD SPACING 12.125)", e$
    if mR6$= 11.75, "(HEAD SPACING 11.75)", e$
    if mR6$= 10.125, "(HEAD SPACING 10.125)", e$
    if mR6$= 10.813, "(HEAD SPACING 10.813)", e$
 

If mr6$ =15.75 you would type 15.75 in the mr6$ box.

  • Thanks 1
  • Like 1
Link to comment
Share on other sites

Format head space in the format section in the post, and when you want it to output just put the following.

fmt  ""  2  head_space  #Head Space

      head_space = mr6$     # This line says put the value of mr6$ on head_space variable. 
      if mr6$, pbld, "(HEAD SPACING ", *head_space, ")", e$     # This line says if there is a value on mr6$ then output.

  • Like 1
Link to comment
Share on other sites

*******************************************************

I saw a reply and noticed an error on my part. Sorry

       if mr6$ <> 0, pheadspacing = 1 #<<<<<<<< insert where you want the code to show up. 

       if mr6$ <> 0, pheadspacing  #<<<<<<<< insert where you want the code to show up.

pheadspacing     # head spacing list 

    if mR6$= 14.125, "(HEAD SPACING 14.125)", e$
    if mR6$= 13.813, "(HEAD SPACING 13.813)", e$
    if mR6$= 13.125, "(HEAD SPACING 13.125)", e$
    if mR6$= 12.813, "(HEAD SPACING 12.813)", e$
    if mR6$= 11.813, "(HEAD SPACING 11.813)", e$
    if mR6$= 15.75, "(HEAD SPACING 15.75)", e$
    if mR6$= 15.75, "(HEAD SPACING 14.125)", e$ # note: you need to change 15.75 to 14.125
    if mR6$= 13.75, "(HEAD SPACING 13.75)", e$
    if mR6$= 12.75, "(HEAD SPACING 12.75)", e$
    if mR6$= 12.125, "(HEAD SPACING 12.125)", e$
    if mR6$= 11.75, "(HEAD SPACING 11.75)", e$
    if mR6$= 10.125, "(HEAD SPACING 10.125)", e$
    if mR6$= 10.813, "(HEAD SPACING 10.813)", e$
 

If mr6$ =15.75 you would type 15.75 in the mr6$ box.

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