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:

canned text


Recommended Posts


pcant_out #Canned text - build the string for output

if cantext$ = one, [

pbld, n$, sm00, e$

pbld, n$, "(CLEAN CHIPS)", e$

]

 

if cantext$ = two, [

pbld, n$, sg00, "Z6.0", sm09, e$

pbld, n$, sg91, "G28", "Y0.", e$

pbld, n$, sm00, e$

pbld, n$, "(CHANGE CLAMPS)", e$

pbld, n$, sg00, *g_wcs, sg90, pfxout, pfyout,

*speed, sm03, e$

pbld, n$, sm08, e$

]

if cantext$ = three, [

pbld, n$, "M201", e$

]

 

if cantext$ = four, [

pbld, n$, "M200", e$

]

 

if cantext$ = five, [

pbld, n$, sm00, e$

pbld, n$, "(ROTATE TO DEGREES)", e$

]

if cantext$ = 6, [

pbld, n$, sg91, "G28", "Y0.", e$

pbld, n$, sg90, *g_wcs, "X0.", e$

pbld, n$, sm00, e$

pbld, n$, "(LOOSEN AND RETIGHT VISE)", e$

pbld, n$, "( DO NOT OVERTIGHTEN)", e$

]

if cantext$ = 7, [

pbld, n$, sm51, e$

pbld, n$, "(AIR BLAST ON)", e$

]

if cantext$ = 8, [

pbld, n$, sm59, e$

pbld, n$, "(AIR BLAST OFF)", e$

 

]

#if cantext$ = eleven, [

# pbld, n$, "(OH xxxx)", e$

# ]


[canned text]

1. "CLEAN CHIPS - M00"

2. "CHANGE CLAMPS - M00"

3. "AUGER ON"

4. "AUGER OFF"

5. "ROTATE TO DEGREES"

6. "HOME MOVE - RETIGHTEN"

7. "AIR BLAST ON"

8. "AIR BLAST OFF"

9. ""

10. ""

11. ""

Link to comment
Share on other sites

Ok I have added these 3 codes but my program adds the mcode m50 and m11 and m07 and m12 and m08 and m13

See program example below.

 

 if cantext$ =11, [
                                     pbld, n$, "M50", e$
                                   ]
         if cantext$ =12, [
                                     pbld, n$, "M07", e$
                                   ]                           
        if cantext$ =13, [
                                     pbld, n$, "M08", e$
                                   ]                          

 

 

1. "Stop - M00"
2. "Op Stop - M01"
3. "Bld on"
4. "Bld off"
5. "Dwell - G04 P1"
6. "Chip Conveyor On"
7. "Chip Conveyor Off"
8.
9. ""
10. ""
11. "Bottom Wash - M50"
12. "Thru Coolant - M07"
13. "Flood Coolant - M08"

 

 

 

O0001 (FBM TEST)
(KITAMURA2)
(MACHINE GROUP-1)
(MCX FILE  - \\JPBFS01\COMPANY\COMMONAREA\MIKE STAPLETON\FBM TEST.MCX-7)
(DATE      - APR-02-2015)
(TIME      - 9:23 AM)
(T7   - 10. SPOT DRILL       - H0   - D0   - D0.3937")
N100 G00 G17 G20 G40 G80 G90
N110 G91 G28 Z0.
N120 M50
N130 M11
N140 G90 G53 X0. Y0.
N150 T7 M06 (10. SPOT DRILL)
N160 (MAX - Z1.)
N170 (MIN - Z-.128)
N180 G00 G17 G54 X-7.375 Y-1.5 S329 M03
N190 G43 H0 Z1.
N200 G94
N210 G98 G81 X-7.375 Y-1.5 Z-.128 R.1 F.49
N220 X-4.125 Y-2.
N230 X-.625 Y-1.
N240 G80
N250 M07
N260 M12
N270 X-6.125 Y-2.
N280 G43 H0 Z1.
N290 G98 G81 X-6.125 Y-2. Z-.1181 R.1 F.49
N300 X-2.875 Y-2.
N310 G80
N320 M08
N330 M13
N340 X-5.375
N350 G43 H0 Z1.
N360 G98 G81 X-5.375 Y-2. Z-.1009 R.1 F.49
N370 X-2.125 Y-2.
N380 G80
N390 M05
N400 G91 G28 Z0.
N410 G90 G53 X0. Y0.
N420 G90
N430 M30

Link to comment
Share on other sites

It might depend

 

The canned text section has been slightly reworked since I coded that example, and depending on which post you are using

 

This is a section out of the new MPMaster

pcant_out       #Canned text - build the string for output
      #Assign string select type outputs
      if cant_pos < three, #cant_pos indicates canned text output
        [
        if cantext$ = three, bld = one
        if cantext$ = four, bld = zero
        #Build the cantext string
        if cantext$ = one, strcantext = strcantext + sm00
        if cantext$ = two, strcantext = strcantext + sm01
        if cantext$ = five, strcantext = strcantext + scant5
        if cantext$ > five,
          [
          strtextno = no2str(cantext$)
          strcantext = strcantext + strm + strtextno
          ]
        ]
      else, #cant_pos indicates coolant output
        [
        coolant_bin = flook (two, cantext$) #Create binary value for each coolant using lookup table
        if frac(cantext$/two),
          [
          if all_cool_off,
            [
            if coolant_on, pbld, n$, *sall_cool_off, e$
            coolant_on = zero
            suppress = 1               #WBT added this for null toolchange with "First command shuts all off" 
                                       #and turn off selected in the second op, post outputs M9 twice             
            ]
          else, coolant_on = coolant_on - coolant_bin/2 #Odd = off command, subtract appropriate binary value.
          ]
        else,                                         #Even = on command
          [   #Determine if this coolant is already on
          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
            ]
          ]
        if suppress <> 1, #Don't output an on code for a coolant that is already on
          [
          if not(frac(cantext$/two)), coolant_on = coolant_on + coolant_bin #Maintain binary sum of all coolants currently on
          coolantx = cantext$ - 50                                          #Create a coolantx value for string select
          pbld, n$, *scoolantx, e$
          ]
        suppress = zero
        ]

You would need to go in here

pcant_out       #Canned text - build the string for output
      #Assign string select type outputs
      if cant_pos < three, #cant_pos indicates canned text output
        [
        if cantext$ = three, bld = one
        if cantext$ = four, bld = zero
        #Build the cantext string
        if cantext$ = one, strcantext = strcantext + sm00
        if cantext$ = two, strcantext = strcantext + sm01
        if cantext$ = five, strcantext = strcantext + scant5
        if cantext$ > five & < 11 | cantext$ > 13,            <------------------Modified this line as well
          [
          strtextno = no2str(cantext$)
          strcantext = strcantext + strm + strtextno
          ]
        if cantext$ = 11,    <-----------------------
           [
            Your text
           ]                          Here through here is new code added
        if cantext$ = 12,
           [
            Your text
           ]
        if cantext$ = 13,
           [
            Your text
           ]                   <--------------------------------------
        ]
      else, #cant_pos indicates coolant output
        [
        coolant_bin = flook (two, cantext$) #Create binary value for each coolant using lookup table
        if frac(cantext$/two),
          [
          if all_cool_off,
            [
            if coolant_on, pbld, n$, *sall_cool_off, e$
            coolant_on = zero
            suppress = 1               #WBT added this for null toolchange with "First command shuts all off" 
                                       #and turn off selected in the second op, post outputs M9 twice             
            ]
          else, coolant_on = coolant_on - coolant_bin/2 #Odd = off command, subtract appropriate binary value.
          ]
        else,                                         #Even = on command
          [   #Determine if this coolant is already on
          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
            ]
          ]
        if suppress <> 1, #Don't output an on code for a coolant that is already on
          [
          if not(frac(cantext$/two)), coolant_on = coolant_on + coolant_bin #Maintain binary sum of all coolants currently on
          coolantx = cantext$ - 50                                          #Create a coolantx value for string select
          pbld, n$, *scoolantx, e$
          ]
        suppress = zero
        ]

I haven't tested it but it should  be close

Link to comment
Share on other sites

If you compare both sections I posted, you'll see the differences....

 

Let me go back and point them out.....

 

Which post are you using?  is it new or what vintage is it because canned text has been changed a bit over the years

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