CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > AjaxCNC Control Products


AjaxCNC Control Products Discuss Ajax Control systems and project here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 12-22-2004, 11:17 PM
MILLMANM's Avatar  
Join Date: Jul 2004
Location: United States
Posts: 93
MILLMANM is on a distinguished road
Anybody useing MasterCam post

I have been setting up a BP knee mill manual tool change,
and need some Ideas on modifying the post to M0 for the high / low speed switch
__________________
IF ITS NOT BROKE YOUR NOT TRYING HARD ENOUGH

Ashes to ashes , dust to dust , If it wasnt for Harleys the fast lane would rust.

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #2  
Old 12-23-2004, 12:06 AM
Rekd's Avatar
Community Moderator
 
Join Date: Apr 2003
Location: teh Debug Window
Posts: 1,877
Rekd is on a distinguished road

You could set a switch to test for certain speed limits, and if it changes between the two, have it output the M00 codes.

Another way would be to use Misc Values, if you know what operations you'll be changing gears in.

You could also use Manual Entry toolpaths, with the 1005 setting to output code, then type in the code you want, (or select a text file that contains it).

Lot's of options. It depends on preference and necessity.
__________________
Matt
San Diego, Ca

___ o o o_
[l_,[_____],
l---L - □lllllll□-
( )_) ( )_)--)_)

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 12-23-2004, 09:11 AM
MILLMANM's Avatar  
Join Date: Jul 2004
Location: United States
Posts: 93
MILLMANM is on a distinguished road

Rekd
Thanks for the info , what i would like to do is, set up a statement that reads the upcoming s value and then write an statement in the code that states M0 (CHANGE TO HIGH OR LOW GEAR) depending on the up coming s value, but do not know how to do it.
thanks Brad
__________________
IF ITS NOT BROKE YOUR NOT TRYING HARD ENOUGH

Ashes to ashes , dust to dust , If it wasnt for Harleys the fast lane would rust.

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #4  
Old 12-23-2004, 03:07 PM
Rekd's Avatar
Community Moderator
 
Join Date: Apr 2003
Location: teh Debug Window
Posts: 1,877
Rekd is on a distinguished road

It will be real easy to do it without testing for the previous value. In other words, it will read each RPM, and output an M00 with the proper gear setting. Problem with this is that it will repeat even if the values haven't changed.

For example, in your post, look for

Code:
ptlchg_com      #Tool change common blocks ()
and add these lines to the function, before the coolant or Z move down to the part.

Code:
	
         if speed <= 2000, n, "M00 (Low Gear)", E
         if speed >= 2001, n, "M00 (High Gear)", E
This will give you:

Code:
...
N23 ( OPERATION: 2   DRILL )
N24 ( OP 3 90 )
N25 ( DRILL 6-32 )
N26 T5 M06
N27(T5:  1/8 DRILL)
N28(MAX-DEPTH | Z-.5376)
N29(OP ID: 2)
N30 M03 S6500
N31 M00 (HIGH GEAR) <-------------------------------------------
N32 G00 G56 X-1.08 Y-1.2463
N33 G43 H5 Z1.
/ N34 M08
N35 Z.1
N36 G98 G83 X-1.08 Y-1.2463 Z-.5376 R.1 I.25 J.0625 K.0625 F12.
N37 X-.17 Y-.164
N38 G80
N39 Z1.
N40 M09
N41 G90
N42 M01
N43 ( OPERATION: 3   DRILL )
N44 ( OP 3 90 )
N45 ( TAP 6-32 )
N46 T6 M06
N47(T6: #6-32 ROLL TAP H3 BOTTOM)
N48(MAX-DEPTH | Z-.35)
N49(OP ID: 3)
N50 M03 S500
N51 M00 (LOW GEAR) <-------------------------------------------
N52 G00 G56 X-1.08 Y-1.2463
N53 G43 H6 Z1.
/ N54 M08
N55 Z.1
N56 G98 G84 X-1.08 Y-1.2463 Z-.35 R.1 F15.63
N57 X-.17 Y-.164
(This is for a HAAS post, so it may look different.)

In order to only post the M00 when the gear needs to be changed, you'd need to create some logic to:

a. store current speed of the first operation in newly declared variable
b. test for a different speed. If different speed, is it also a different gear? Which gear?
c. post M00 codes if gear is > or < than previous gear
__________________
Matt
San Diego, Ca

___ o o o_
[l_,[_____],
l---L - □lllllll□-
( )_) ( )_)--)_)

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

Last edited by Rekd; 12-23-2004 at 03:27 PM.
Tweet this Post!Share on Facebook
Reply With Quote

  #5  
Old 12-23-2004, 03:11 PM
Rekd's Avatar
Community Moderator
 
Join Date: Apr 2003
Location: teh Debug Window
Posts: 1,877
Rekd is on a distinguished road

BTW, if you don't mind editing your posts, AFTER you back it up, you can modify this portion to tell you in the posted NC file WHERE in the post that particular line was generated..

Code:
# --------------------------------------------------------------------------
# Debugging and Factory Set Program Switches
# --------------------------------------------------------------------------
fastmode    : 1   #Posting speed optimizition
bug1        : 2     #0=No display, 1=Generic list box, 2=Editor
bug2        : 40     #Append postline labels, non-zero is column position?
bug3        : 0     #Append whatline no. to each NC line? 0
bug4        : 0     #Append NCI line no. to each NC line? 0
whatno      : yes   #Do not perform whatline branches? leave as yes
For example, when setting fastmode to 0, you'll get:

Code:
N2 M01                                  psof ptlchg_com
N3 ( OPERATION: 1   DRILL )             psof popnumber
N4 ( OP 3 90 )                          psof pcomment
N5 ( SPOT 6-32 )                        psof pcomment
N6 T2 M06                               psof p__8:1113
N7(T2: 1/4 CHAMFER MILL)                psof ptoolcomm
N8(MAX-DEPTH | Z-.07)                   psof ptlchg_com
N9(OP ID: 1)                            psof pstock
N10 M03 S7000                           psof ptlchg_com
N11 M00 (HIGH GEAR)                     psof ptlchg_com
N12 G00 G56 X-1.08 Y-1.2463             psof ptlchg_com
N13 G43 H2 Z1.                          psof ptlchg_com
/ N14 M08                               psof ptlchg_com
N15 Z.1                                 pzrapid prapidout
N16 G98 G82 X-1.08 Y-1.2463 Z-.07 R.1 P.3 F50.  pdrill
N17 X-.17 Y-.164 P.3                    pdrill_2
N18 G80                                 pcanceldc
N19 Z1.                                 pzrapid prapidout
N20 M09                                 ptlchg1002 pretract
N21 G90                                 ptlchg1002 pretract
N22 M01                                 ptlchg ptlchg_com
N23 ( OPERATION: 2   DRILL )            ptlchg popnumber
HTH
__________________
Matt
San Diego, Ca

___ o o o_
[l_,[_____],
l---L - □lllllll□-
( )_) ( )_)--)_)

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6  
Old 12-23-2004, 04:17 PM
Rekd's Avatar
Community Moderator
 
Join Date: Apr 2003
Location: teh Debug Window
Posts: 1,877
Rekd is on a distinguished road

Almost forgot; formatting in the .pst file is important. In the example in my previous post, put the "if speed" lines AWAY from the left margin. If it's against the left margin, you'll get an undeclared variable error.

In the following code, I created 2 new functions that are triggered either automatically or by setting a switch in the Misc Value's Misc Integer section.

Note that the function name is all the way against the left margin, and the function itself is away from the margin.

Code:
popnumber	#Count Operations, add op type ()
	op_number = op_number + 1
	# = op_number
      n, "(", stopno, op_number, " ", stoper, ")", e

pcorner_round	#corner rounding ()
      if mi5 = 1 & mr5 > 0 & flg_mi5 = 0,
      	[
      	sav_mr5 = mr5,
      	pbld, n, "G187", *sav_mr5, e
      	flg_mi5 = 1
      	]
      if mi5 = 1 & mr5 = 0,
      	[
      	"( WARNING!! CORNER ROUNDING CONTROL HAS )", e
      	"( BEEN ENABLED WITHOUT A VALUE SET! USE )", e
      	"( MISC VALUES-MISC REALS TO SET A VALUE )", e
      	"( CORNER ROUNDING CONTROL IS DISABLED   )", e
      	]
      if mi5 = 0 & flg_mi5 = 1,
      	[
      	n, "G187", e
      	flg_mi5 = 0
	]
Now, any time I want to call the pcorner_round function, I call it like this:

Code:
ptlchg0         #Call from NCI null tool change (tool number repeats) 
      pcorner_round <----------call this function
      pcuttype<----------------then call this one
      toolcount = toolcount + 1<------do some stuff here
      if toolcountn <= tooltotal, nexttool = rbuf(4,toolcountn)<-----do some if then statements here
        else, nexttool = first_tool
      if mi10=one & op_id<>last_op_id, pstop <---- test an if then statement and call another function if true
Hope I'm not confusing you..
__________________
Matt
San Diego, Ca

___ o o o_
[l_,[_____],
l---L - □lllllll□-
( )_) ( )_)--)_)

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #7   Ban this user!
Old 12-23-2004, 06:07 PM
MILLMANM's Avatar  
Join Date: Jul 2004
Location: United States
Posts: 93
MILLMANM is on a distinguished road

Rekd
thanks that works great, will work on some logic can you give me any advice ,were how, but I can not figure out how to remove op comment see below

here is what i have so far
% pheader
O0100 pheader
(PROGRAM NAME - LONGHORN2 ) pheader
(DATE=DD-MM-YY - 23-12-04 TIME=HH:MM - 16:55 ) pheader
N100 ; TOOL - 01 DIA. - .2500 pwrtt
N102 ; TOOL - 02 DIA. - .0625 pwrtt
( rough profile ) pcomment want to remove comment
N104 G17 G40 ; Setup for XY plane, no cutter comp, psof
N106 G20 ; inch measurements psof
N108 G80 ; cancel canned cycles, psof
N110 G90 ; absolute positioning, psof
N112 M25 G49 ; Goto Z home, cancel tool length offset psof
N114 G91 G28 X0. Y0. psof
N116 T1 (CHANGE TOOL) psof
N118 S3000 psof
N120 M00 (High Gear) psof
N122 ( 1/4 FLAT ENDMILL TOOL - 01 ) psof ptoolcomment
N124 ( ) psof pcomment
N126 S3000 M3 psof
N128 G00 G90 G54 X-.2955 Y1.5862 psof
N130 G43 H1 Z.25 psof
N132 M07 ;Mist on psof
N134 Z.1 pzrapid


source________________________________________

psof0 # Start of file for tool zero
psof

psof # Start of file for non-zero tool number
pinit
!opcode
n, "G17 G40 ; Setup for XY plane, no cutter comp,"
n, "G20 ; inch measurements"
n, "G80 ; cancel canned cycles,"
n, "G90 ; absolute positioning,"
n, "M25 G49 ; Goto Z home, cancel tool length offset"
n, pinc , *sg28ref, "X0.", "Y0.", e
n, *t, "(CHANGE TOOL)"
n, speed
if speed <= 2000, n, "M00 (Low Gear)", E
if speed >= 2001, n, "M00 (High Gear)", E
n, ptoolcomment
n, pcomment
n, *speed, *spdlon
pcan
pcan1, n, "G00", pabs, pwcs, *xr, *yr, strcantext
pcan2
n, ptllncomp, *zr
pcoolon
__________________
IF ITS NOT BROKE YOUR NOT TRYING HARD ENOUGH

Ashes to ashes , dust to dust , If it wasnt for Harleys the fast lane would rust.

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 12-23-2004, 06:15 PM
MILLMANM's Avatar  
Join Date: Jul 2004
Location: United States
Posts: 93
MILLMANM is on a distinguished road

its a little confusing ,but will try to modify what u sent and see what happens , got to learn some how!
Brad
__________________
IF ITS NOT BROKE YOUR NOT TRYING HARD ENOUGH

Ashes to ashes , dust to dust , If it wasnt for Harleys the fast lane would rust.

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #9  
Old 12-23-2004, 06:50 PM
Rekd's Avatar
Community Moderator
 
Join Date: Apr 2003
Location: teh Debug Window
Posts: 1,877
Rekd is on a distinguished road

Like I said, make a copy of your original post before you go too far.

The comment is comming from the "pcomment" function

Change this line:

Code:
n, pcomment
to this:

Code:
#n, pcomment
The "#" prevents MP from reading that line during posting. It's for comments or skipping blocks that you dont want to delete from the post.

Are you familiar with any other types of programming/coding? Like Visual Basic, C, C++, Java, PHP, batch, etc? If not, that's gonna be your roughest learning curve.

The MP (Mastercam Post) language is just that; a complete programming language for post processors in Mastercam. (Like html is to web pages.) The possibilities are literally unlimited.

Also, I just guessed at what RPM your machine shifts gears at, so you'll want to change that to the real values.

__________________
Matt
San Diego, Ca

___ o o o_
[l_,[_____],
l---L - □lllllll□-
( )_) ( )_)--)_)

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #10   Ban this user!
Old 12-23-2004, 07:45 PM
MILLMANM's Avatar  
Join Date: Jul 2004
Location: United States
Posts: 93
MILLMANM is on a distinguished road
look like i have it

Rekd
thanks for you help.
the post looks pretty much like i need it,
really dont need any logic ,sence I have to M0 between tools any how

I just remove pcomment from the source, being that i am limited to 9999 in a post to the control and wasted info is bad for me.
Again thanks
Brad
__________________
IF ITS NOT BROKE YOUR NOT TRYING HARD ENOUGH

Ashes to ashes , dust to dust , If it wasnt for Harleys the fast lane would rust.

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Emco Compact 5 PC...have ???? Double G Mini Lathe 42 08-22-2010 07:26 PM
Upgrading control hardware - Emco eDudlik General CNC (Mill and Lathe) Control Software (NC) 21 12-08-2009 01:52 AM
BOSS 5 Post processor for Mastercam bbuonomo Post Processor Files 6 09-03-2006 01:11 PM
Modify Mastercam MPFAN post COPO427 Mastercam 15 05-26-2004 12:59 PM
Mastercam post to Kellyware Kcam?? gcamlibel Mastercam 0 03-09-2004 11:04 AM




All times are GMT -5. The time now is 11:45 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353