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:

Parameter code usage question


Recommended Posts

Am I allowed to use parameter codes twice or (or multiple times) to initiate different variables?

I am working on some custom drill cycles and would like to use "top of stock" and "feed plane" (prmcode$ 10024 and prmcode$ 10027) as different variables depending on the custom drill cycle called (I've got 6 drill cycles all together).

This is really just for clarity in the post as (obviously) it will not appear in the code.

Link to comment
Share on other sites

It is better in my opinion to divide them up and name them for their specific purpose. I have used some 7 or 8 times, but each time they are declared to a new unique variable when I used it again. I hate the defining variable letters done by some post people in a post. I realize they are doing it to make it harder to figure out what the post is doing, but it is sloppy and un-organized in my opinion. That said what ever make you happy and gets the job done is the goal.

  • Like 1
Link to comment
Share on other sites

 

3 hours ago, C^Millman said:

I hate the defining variable letters done by some post people in a post. I realize they are doing it to make it harder to figure out what the post is doing, but it is sloppy and un-organized in my opinion.

Thanks Ron.

And I agree with your sentiments. Make it clear in the post, for your own sake if nothing else.

Trying to make it hard for others only lasts 5 mins. in the debugger.

Link to comment
Share on other sites

Are you enabling the Custom Drill Parameters as well? For each Drill Cycle available, you have a potential of:

- 6 "regular" cycle variables (peck1$, peck2$, ect.)

-10 "custom" variables

- a few other variables that can be renamed/repurposed in the dialog (feed plane, top of stock, depth, clearance, feedrate, plunge rate). With these, feel free to use them for your needs, but reset the Prefix and Format Assignment when you are done. (Also, use the Control Definition to change the Label String in the dialog box.)

  • Like 1
Link to comment
Share on other sites
11 hours ago, Colin Gilchrist said:

Are you enabling the Custom Drill Parameters as well?

Yes, I am using the custom drill parameters for controlling spindle speed changes and Z values not available on the parameter page.

But I wanted to keep it to minimum and use other available options where I could, just in case I need the custom parameters  somewhere else.

I try and view these as I do the mi and mr values. If you use them to freely eventually you run out just when you need them, like a 200 tool carousel.....

As I have you on the "phone", my remaining problem is shutting off the coolant at the correct position on my deep hole drilling cycle.


 

N1 T7 M06 (0.0748 CARB. TC DRILL)
G90 G54 X.11 Y-.2964 S200 M03
G43 H1 Z2.
M08
G94
G00 Z.24
G01 Z.0495 F5.
M88
G04 X2.0
S10214
Z-.11 F16.
Z-.2595 F8.
Z.0495 F50.
M88
G04 X2.0
G00 Z2.
M08
M05
G91 G28 Z0.
A0. G28 Y0.
M30

What I did was select the "before" option as it is the one I wouldn't use for coolant control, and bypassed the pcan call using:


 

 if drillcyc$ <> 12 & coolantx <> 8, #skip before call for deep hole drill
	  [
	   pcan 
	  ]

Watching it through the debugger I saw that it was changing the canned text variables to the coolant "off" condition before it read the "Custom Drill Cycle 12"

I got round this by sending it straight to the Custom drill cycle here at end of psof

ptlchg_com
sof = 0
if drillcyc$ = 12, pdrlcst$

This gave me the coolant "on" where I wanted it.

Now I am trying to figure out how to trip the canned text variables to the "off" condition without passing through the pdrill block, is there something going on in the background when entering the drill cycle part of the post?

My suspicion is that the solution lies here:

      local_int = zero
          coolantx = zero
          while local_int < 20,
            [
            result2 = and(2^local_int, coolant_on)
            local_int = local_int + one
            if result2 = coolant_bin, suppress = one
            ]

But this is a little arcane for my level of experience. I get that it is checking through all 20 coolant options, but why the binary values, and 2^local_int...??

If this is where I need to trip the coolant "off" condtion can I "prime the pump" to make it happen by resetting variables, could you parse this for me, or am I barking up the wrong tree?

I know I could do it with string literals , or some other variables, but I would like to keep it in the canned text system if possible and use the "built in" post mechanism. (I can feel Ron smiling and shaking his head as I type this.....whistling emogi on its way....?).

I think once I get this solved the rest should be plain sailing.....or famous last words.

Link to comment
Share on other sites
  • 5 months later...

I don't know if this will help but you can use the same canned text variable to do different things.

          if machine = 800 & t$ = 4,
            [
            if cantext$ = 52,
              [
              "G04 P8000", e$ <<<<<<< Adding dwell to give probe time to turn on
              "M117", e$
              ]
            else, "M117", e$ #<<<<<<<<< turn probe on without dwell (tool change)
            ]

      if machine <> 60,
        [
        if (t$ = 4 & (cantext$ = 52 | mi2count = 1))| t$ <> 4,
         stool_detect_test, e$ # <<<<<<<<<<<< BK Micro checking for broken tool
        ]

        if cantext$ <> 52, "M98P5502", e$ #<<<<<<<<<< resets needed work offsets 

[canned text]
1. "Stop - M00"
2. "Op Stop - M01"
3. "Bld on"
4. "Bld off"
5. ""
6. ""
7. ""
8. ""
9. ""
10. ""
11. "M00 (LUBRICATE HOLES FOR TAPPING)"
12. "Align boring head for fixture clearance [M19]"
26. "IF[#625EQ1]THEN#627=1" (615-969) #added 11-03-2008"
51. "Extra Fixture offset"
52. "Reprobe using current offsets" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
53. "B axis clearing on/off switch" added 01-06-2011"
54. "Force Fixture offset"
55. "Force 2nd Fixture offset"
98. "Set HX800iLTGA acceleration rate" #added 2017-04-24
99. "Create seperate toolpath file" (M198 -- 633-101-364) added 06-16-2009"
100. "Empty"

Edit: I don't use canned text in the traditional way. It's too cumbersome and I've turned off or removed most of the Pcan calls greater than 10.

  • Like 1
Link to comment
Share on other sites
1 hour ago, Tim Johnson said:

I don't know if this will help but you can use the same canned text variable to do different things.

Looks interesting I will dig in when I get a minute. I really want to try and use the pcantout mechanism with the X coolant just as a matter of principle, or should I say stubbornness.....I think I've nearly got it, but I haven't had much time to play with posts for a while......

Thanks for the input!!

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