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:

String select table


Recommended Posts

2 hours ago, Colin Gilchrist said:

First, do this: get rid of the 'toollength' variable in your string select table.

Initialize a new numeric variable called 'tcpmode', and set the value to '-1'. Redo your 'fstrsel' line:


fstrsel sg49 tcpmode stcp 4 -1

Now, set the value of 'tcpmode' at the tool change:.


ptlchg$
      if mi1$ = 2 | mill5$, tcpmode = 2
      else, tcpmode = map_mode

You could also just use 'tcpmode = map_mode', if you are making sure 'map_mode' is set to 0, 1, or 2.

Then, at 'pretract' set 'tcpmode' to '0'.

That worked (except the item count).

I get the correct output for all operations; All 3+2 ops output G43 & all 5X ops output G43.4.

But if a 5X op follows a 3+2 op, MC hangs & I have to kill it with task manager.

Hmmm, I guess I'm going swimmin' in the deep end some more.

Link to comment
Share on other sites
22 minutes ago, Colin Gilchrist said:

Nope, I was wrong. 6 strings in the Gcode list. You should have "3" in yours. We don't count the target string.

Sorry, I tore my calf muscle last night, and am kinda loopy from the pain killers.

Ouch, that's gotta hurt like he||!

Cool beans on the count though, that was drivin me nuts.

I hope you heal quickly

  • Like 1
Link to comment
Share on other sites
16 hours ago, So not a Guru said:

That worked (except the item count).

I get the correct output for all operations; All 3+2 ops output G43 & all 5X ops output G43.4.

But if a 5X op follows a 3+2 op, MC hangs & I have to kill it with task manager.

Hmmm, I guess I'm going swimmin' in the deep end some more.

I just whipped up that bit of test logic. I'd guess that the 'map_mode' variable is being manipulated by MP, inside the encrypted portion of the post, and is probably being set internally to either a negative number (-1 or -2), or a number greater that 2. (Most likely, minus one)

This is causing the String Select table to underflow (or overflow, can't remember which term is the correct one here.)

It is for this reason that I recommended removing "toollength" as the variable as well. Any time you start using 'stock' variables from the 5X Post, you risk causing errors because you don't really know if the PSB is manipulating that variable value or not. You can setup "test" blocks to "print" some debugging info to the NC Code. I much prefer this method of debugging, since trying to use the debugger with a 5X Post can be like pulling teeth. I find it better to just force output using the Tilde (~) debugging character. (Typically with 'bug4$' set to '-1', so you get the "raw" variable values, not the formatted value...)

You could simply use the 'mill5$' variable as the "trigger" to get 5X output, and that would be the easiest to rely on, since it will always be '0' for a 3X operation, and '1' for a 5X operation.

ptlchg$
      if mill5$ = zero, tcpmode = 1
      else, tcpmode = 2

      #Let mi1$ "force" mode, if not zero
      #Note: This will override the logic above, if used.
      if mi1$, tcpmode = mi1$
        

 

Link to comment
Share on other sites
1 hour ago, Colin Gilchrist said:

It is for this reason that I recommended removing "toollength" as the variable as well. Any time you start using 'stock' variables from the 5X Post, you risk causing errors because you don't really know if the PSB is manipulating that variable value or not.

That was definitely giving me errors in the encrypted section before I changed the variable name.

1 hour ago, Colin Gilchrist said:

ptlchg$
      if mill5$ = zero, tcpmode = 1
      else, tcpmode = 2

      #Let mi1$ "force" mode, if not zero
      #Note: This will override the logic above, if used.
      if mi1$, tcpmode = mi1$
        

 

Both of these made no change to my output, or the hanging up behavior. So I'm staying with the

if mi1$ = 2 | mill5$, tcpmode =two

else, tcpmode = one

It still hangs MC. The weird thing is it will post just fine if I have a 5x op 1st followed by a tilted planes op, everything is hunky dory. But anytime a 5x op follows a tilted planes op, it's hang city. I can't debug it because it locks up.

Link to comment
Share on other sites

It seems I can use the debugger on this, but I am thoroughly confused by the results. the NCI file generates all the way to the end of all of the ops, but the NC output stops at the end of the tilted plane op.

56 minutes ago, 5th Axis CGI said:

PSB fun yes I don't miss those days

Makes you wish you had a dadgum key, don't it?:D

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