586,032 active members*
2,931 visitors online*
Register for free
Login
IndustryArena Forum > CAM Software > Mastercam > Configuring canned text string with embeded variable for speed for mastercam post
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2016
    Posts
    36

    Configuring canned text string with embeded variable for speed for mastercam post

    Iam utilizing the cantext feature in MP to allow output of a canned text stringwithin the toolpath editor and I have the string for my canned text built andget the output I want (which is to change the spindle speed at a certain pointin the tool path) I am coupling a Misc. Int (mi9$) to my cantext string so theoutput of the new spindle speed can be variable when I choose to implement thisoption when needed.

    My issue is that when I use the toolpath editor to place this cantext at a givenlocation or section in the toolpath I would like to have the spindle speedto revert back to the initial speed following the edited zone of the toolpaththat I edited within the toolpath editor.

    I have tried several things and you can see I have remed out (#) some things Ihave tried but still cannot the initial spindle speed to output.
    This is in the pcant_out post block <build text string section> I amusing the number 5 cantext$ register. It would be nice ifspindle speed was an available option in the tool path editor whereas currentlyfederate is only option along with several others but not spindle speed. Thecanned text looked like my only avenue to do this. I looked into thechange at point for the chained geometry but it’s greyed out and not selectablemaybe because it is an open chain or this is only available for WIRE and notmill IDK.



    pcant_out #Canned text - build the string for output
    #Assign string select type outputs
    if cant_pos < three, #cant_pos indicates canned text output
    [
    ifcantext$= three, bld = one
    ifcantext$= four, bld = zero
    #Build the cantext string
    ifcantext$= one, strcantext = strcantext + sm00
    ifcantext$= two, strcantext = strcantext + sm01
    ifcantext$= five, #strcantext= strcantext + strs + ss$ dpdppdpdpdppdpdppdpp
    [
    #prv_speed = ss$
    #ss$ = mi9$
    strtextno = no2str(mi9$)
    strcantext = strcantext + strs+ strtextno
    #if speed <>prv_speed, speed = prv_speed
    #speed = prv_speed
    #!speed #, *speed
    ]
    else,
    ifcantext$> 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 usinglookup table
    iffrac(cantext$/two), # coolant off
    [
    if all_cool_off,
    [
    if coolant_on, pbld, n$, sall_cool_off, e$
    coolant_on = zero
    ]
    else,
    [
    if coolant_on > 0,
    [
    coolant_on = coolant_on -coolant_bin/2 #Odd= off command, subtract appropriate binary value.
    coolantx = cantext$ - 50 #Create a coolantx value for string select
    pbld, n$, *scoolantx, e$
    ]
    ]
    ]
    else, #Even = on command
    [ #Determine if this coolant is already on
    local_int = zero
    coolantx = zero
    suppress = zero
    while local_int < 20 & coolant_on > 0,
    [
    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 thatis already on
    [
    coolant_on = coolant_on +coolant_bin #Maintainbinary sum of all coolants currently on
    coolantx = cantext$ - 50 #Create a coolantx value for string select
    if cant_pos = four, *scoolantx #Coolant "With"
    else, pbld, n$, *scoolantx, e$#Coolant "Before" or "After"
    ]
    ]
    ]

  2. #2
    Join Date
    Dec 2008
    Posts
    3109

    Re: Configuring canned text string with embeded variable for speed for mastercam post

    You've lost your formatting, makes it a bit harder to follow
    - suggest using the :"Go Advanced", to place the formatted text in the (CODE) #

    Looking at it .....ss$ is an old speed string

    I'd use something new ie cant_speed etc. to hold any speed changing
    - and not overwrite the prv_speed string

    Duplicate / declare all formatting requirements as with speed
    this would allow you to force the original RPM output at the end with *speed

  3. #3
    Join Date
    May 2016
    Posts
    36

    Re: Configuring canned text string with embeded variable for speed for mastercam post

    Quote Originally Posted by Superman View Post
    You've lost your formatting, makes it a bit harder to follow
    - suggest using the :"Go Advanced", to place the formatted text in the (CODE) #

    Looking at it .....ss$ is an old speed string

    I'd use something new ie cant_speed etc. to hold any speed changing
    - and not overwrite the prv_speed string

    Duplicate / declare all formatting requirements as with speed
    this would allow you to force the original RPM output at the end with *speed
    Ok, thanks Superman for the tip on both the go advanced and the use of a new user var to handle the speed. yesterday was first time to actually dig in and post something instead of just read forums. Thank you for patience in that regard. About to head to work and ill give it a shot and let you know how t works.

  4. #4
    Join Date
    May 2016
    Posts
    36

    Re: Configuring canned text string with embeded variable for speed for mastercam post

    here is where I ended up with, it appears I don't know what to do regarding the formatting yet working on that.






    pcant_out #Canned text - build the string for output
    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,
    [
    cant_spindle = mi9$
    strtextno = no2str(cant_spindle)
    strcantext = strcantext + strs + strtextno + strspc
    ]
    else,
    if cantext$ = six,
    [
    cant_spindle = speed
    strtextno = no2str(cant_spindle)
    strcantext = strcantext + strs + strtextno + strspc
    ]
    else,
    if cantext$ = seven & mr1$ > zero,
    [
    cant_dwell = Mr1$
    strtextno = no2str(cant_dwell)
    strcantext = strcantext + sg04 + strdw + strtextno
    ]
    else,
    if cantext$ > seven,
    [
    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), # coolant off
    [
    if all_cool_off,
    [
    if coolant_on, pbld, n$, sall_cool_off, e$
    coolant_on = zero
    ]
    else,
    [
    if coolant_on > 0,
    [
    coolant_on = coolant_on - coolant_bin/2 #Odd = off command, subtract appropriate binary value.
    coolantx = cantext$ - 50 #Create a coolantx value for string select
    pbld, n$, *scoolantx, e$
    ]
    ]
    ]
    else, #Even = on command
    [ #Determine if this coolant is already on
    local_int = zero
    coolantx = zero
    suppress = zero
    while local_int < 20 & coolant_on > 0,
    [
    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
    [
    coolant_on = coolant_on + coolant_bin #Maintain binary sum of all coolants currently on
    coolantx = cantext$ - 50 #Create a coolantx value for string select
    if cant_pos = four, *scoolantx #Coolant "With"
    else, pbld, n$, *scoolantx, e$ #Coolant "Before" or "After"
    ]
    ]
    ]

Similar Threads

  1. Canned Text M00 Troubles
    By Zuni in forum Mastercam
    Replies: 4
    Last Post: 12-05-2014, 12:08 AM
  2. Mastercam Post variable question
    By CimUser2000 in forum Mastercam
    Replies: 3
    Last Post: 03-10-2014, 01:58 AM
  3. X6 post setup questions (sub program and canned text)
    By Matt@RFR in forum Post Processors for MC
    Replies: 8
    Last Post: 04-27-2012, 10:52 PM
  4. Okuma canned cycle for text??
    By medman in forum Okuma
    Replies: 2
    Last Post: 04-30-2010, 12:02 AM
  5. Customizing Canned Text?
    By Donkey Hotey in forum Mastercam
    Replies: 6
    Last Post: 11-15-2008, 09:35 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •