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:

Leaderboard

Popular Content

Showing content with the highest reputation on 01/15/2021 in all areas

  1. Another development tip for you: You should learn to use the Mastercam Code Expert File Editor, for developing Posts. The reason is that MCE has "code auto-complete" built in for the MP Language. As you begin typing, the MCE will display a list of Post Blocks, Variables, Strings, Operators, and Functions, which start with the 'letter that you begin typing'. When that 'list' pops-up, you can hover your cursor over each 'displayed name', and a little help-tip will pop-up, describing the item, and potentially showing a sample of usage. For example, look up the Operator 'drs_str' in this auto-complete list, and it will give you a brief description of how it is used. All pre-defined variables should have a Dollar Sign as the terminator for the variable name. When you type in a correctly-spelled variable name in MCE, the variable will turn 'blue', indicating that MP has recognized it a pre-defined. User-defined variables should never include the Dollar Sign character. All String names in MP must begin with the character 'S'. Numeric Variables can begin with any Alpha Character. (No variable may begin with a number.) Variable names can contain both alpha and numeric characters, and the Underscore character, but those are the only valid characters allowed. MP is a "column dependent" language. This means there is special significance if a variable name or post block "begins in the 1st column". Whenever something starts in Column 1, that thing is a "definition". No other use of that variable or Post Block Name, may start in the 1st column. This ensures that things are defined in only one spot, within the PST script file. You'll notice that all other "Post Lines", will be indented in the PST file. Standard indentation is 6 space characters.
    1 point
  2. Honestly, I gave up on using the Debugger long ago. It is ok, when debugging 3-Axis and 4-Axis posts. It becomes more cumbersome than it is worth, when attempting to debug a 5-Axis Post. Are you aware of the Command Variable 'bug4$'? This variable controls the formatting of Debug Output. What is 'Debug Output', you may then ask? The MP Post Language has a Variable Modifier, called the "debug modifier", which allows you to output any variable, without changing the value or modality of the variable. This modifier is the Tilde Character (~). Speaking of Modality, you may or may not be aware of how MP controls the Modality of Numeric Variables. When a variable is created (initialized), in the MP Language, MP automatically creates 2 variables in Memory. These are the Initial and Previous value of the variable. On initialization, MP takes whatever your variable name is, and it appends the characters "prv_", to the front of your variable, thus creating the 'previous value slot' in Memory. At initialization, MP loads the Initialization Value (number), into both the current and previous variable slots. When a numeric variable is encountered on an 'output line', MP compares the current value to the previous value. If the variable values are different, MP forces output of the 'current' value, and then updates the previous value to whatever was output. You might notice there is a 'Update Modifier' in the MP Language as well. The exclamation point (!) Is the Update Modifier. This updates the previous value to the current, without outputting to the NC Output Stream. With the 'bug4$' Command Variable, set the value to '-1', so you can get the "Raw" value (unformatted value), of the variable when using the Debug Modifier. Example: "Debug my_var:", ~my_var, e$ "Debug prv_my_var:", ~prv_my_var, e$
    1 point
  3. I just started forcing output of variables during development to see what they are. I have given up on watch lists in the debugger. Also another very experienced and helpful user in another forum subject suggested using mprint to output messages on variables during posting, and I have used that lately in addition to the forced output.
    1 point
  4. Here's the version of ppost$ that ended up working for my purposes in case it helps anyone out there. ppost$ #entire postblock added,ev121120_0644 #saves NC file as a buffer in order to put order of operations/filename list in proper places #"ime" is "initial manual entry", "oofn" is "order of operations/filename list" sncfile = spathnc$ + snamenc$ + sextnc$ #store path for nc file sauxfile = spathnc$ + snamenc$ + sextaux$ #store path for aux file sbufname5$ = spathnc$ + snamenc$ + sextnc$ #make path for buf5 same as nc file spathaux$ = spathnc$ #set path for aux file snameaux$ = snamenc$ #set filename for aux file auxprg$ = 1 #access aux and wipe it newaux$ #open aux for output subout$ = 2 #direct output to aux file size5 = rbuf(5, 0) #open buf5, read size rc5 = one #set read variable to start at record1 while rc5 <= size5, #be sure reading of buffer stops when last record is reached [ string5 = rbuf(5, rc5) #read current record in buffer,set string5 if string5 <> s_init_loc & string5 <> s_oofn_loc, *string5, e$ #output string5 as is unless it is an ime or oofn flag else, [ if string5 = s_init_loc, #output initial manual entry from sub stream if string5 is ime flag [ subprg$ = 2 newsub$ mergesub$, e$ ] if string5 = s_oofn_loc, #output oofn list from lcc stream if string5 is oofn flag [ lccprg$ = 2 newlcc$ mergelcc$, e$ ] ] ] ret_b6 = fclose(5) #close buf5 return = fclose(sauxfile) #close aux return = remove(sncfile) #delete existing nc file return = rename(sauxfile, sncfile) #rename aux as the nc clearsub$ #clear sub file to prevent duplication @ next posting clearlcc$ #clear lcc file to prev dup @ nxt postg
    1 point
  5. Yes You will use all 3 techniques and the biggest help will be for you to get some training
    1 point
  6. To expand upon the use and results of the Optimize command- Optimize will never work itself down to zero, and by running it multiple times and seeing it bounce between different optimization numbers, you're basically trading the same two results sets back and forth in the background. If you use Optimize, running it once should net you basically all the benefits you will get. Good question!
    1 point
  7. i have had this happen with many different versions, never found out what causes it. i always keep back up copies
    1 point
  8. This software is really old and likely pirated.
    1 point
  9. I keep copies of my workspace files on my backup drive and have copies of them named different extensions I can rename if needed.
    1 point
  10. Make sure you are modifying a copy of the original part on a new level. That way you always have the original solid within your file.
    1 point
  11. I agree. I enjoy digging into stuff like that quite a bit, and I would do it a lot more often if I had more time around the shop floor's programming needs. It's a miracle that I've been able to spend as much time as I have on this post. I had not thought about using mprint like that so I very much appreciate the advice. I'll surely be playing around with that as I continue/complete building this post! No, sir, I have not, but I will definitely check them out. I need to get more into the habit of proactively improving my understanding of MP (you know, before I'm super-frustrated because I can't get something work like I want it to). Again, Colin, I am grateful for your time here, and I see that you are constantly helping folks out so I can only hope to begin to repay the favor one day soon.
    1 point
  12. I've never found Silhouette Boundary to be accurate enough for finish geometry. I only use it for rough and rough boundaries Sounds like in your use, Create >> Curve > Slice would be a better option
    1 point
  13. No, for creating geometry. For example, if you want to create a point a certain distance from another point I would create a point there then translate it. If you shift-click you can type in X,Y,Z coords to put the point where you want it from the one click. Try it with drawing lines or anything I've tried so far has worked.
    1 point
  14. example no longer needed...see save NC file as a buffer, then read that buffer ... except it won't read the buffer for resolution of the issue I was having
    0 points

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