Hello Guest it is December 07, 2019, 02:25:47 PM

Author Topic: Mach4 cnc program min/max values  (Read 611 times)

0 Members and 1 Guest are viewing this topic.

Offline Bob49

*
  •  57 57
    • View Profile
Re: Mach4 cnc program min/max values
« Reply #10 on: April 13, 2019, 05:14:30 PM »
Yeah, I see it now.  Maybe I'm just not understanding the Z values in the min/max dro's.  My thinking I should be able to apply a bit of math like I did on X and Y and match that up with the extremes of my particular program the dro's are analyzing.  In one case my Z travel extreme would have been right at 3.9".  See the attached pic for what I got as a readout.
Re: Mach4 cnc program min/max values
« Reply #11 on: April 13, 2019, 05:24:23 PM »
There is a G43 Z20 there,
And the z extents are just over 20 .
Re: Mach4 cnc program min/max values
« Reply #12 on: April 13, 2019, 05:28:18 PM »
also, I found that if the program coords overlap the machine coords, the Z pos will show above the home on the Z. If it is homed at z0.00 and all z moves are -.

Offline Bob49

*
  •  57 57
    • View Profile
Re: Mach4 cnc program min/max values
« Reply #13 on: April 13, 2019, 05:30:57 PM »
Dang, good catch.  I bet I read that line 10 times and read it as 2.0 every time.  2.0 is what it should be so I guess I just expected that when I read it.  That's one of the few lines I have to edit on most programs so I fat fingered it.

Thanks for the help, I'll fix that and see what I get.

Regards
Bob
Re: Mach4 cnc program min/max values
« Reply #14 on: April 13, 2019, 05:50:19 PM »
Hi,
if you really want DROs to read in work coordinates, and it seems its only the Z axis which is giving you grief
there is room in the existing DRO block/container for two new DROs, Z_MAX and Z_MIN.

I fiddled around with the screen editor and ended up with these DRO's. Have yet to write the code to drive it....
but first step.

Craig
My wife left with my best friend...
     and I miss him!

Offline Bob49

*
  •  57 57
    • View Profile
Re: Mach4 cnc program min/max values
« Reply #15 on: April 13, 2019, 06:23:07 PM »
I corrected the Z20. for H2 in the program.  Found my extreme +Z in the program is 3.0, extreme -Z is -.9127.  Total of 3.9127 in my pea brain.  Of course that changed the DRO readings and I did the math between the two readings for Z and got exactly 1.5" more than the 3.9127".  So I guess I'm still not quite getting it right.  I looked for a - or + value in the programmed don't find any other than those I mentioned.  The Z3.0 moves are in prep for a tool change, all the g43's then set the new tool at Z2.0.  I'll drop the program in this response along with another screen shot fo the dro's. 

That might be something worth exploring, getting them to read in work coordinates.  The - Z values that are displayed in machine coordinates are a bit confusing.
« Last Edit: April 13, 2019, 06:32:11 PM by Bob49 »

Offline Bob49

*
  •  57 57
    • View Profile
Re: Mach4 cnc program min/max values
« Reply #16 on: April 13, 2019, 06:30:32 PM »
Code: [Select]
%
O1000
N1 G49 G54 G80 G40 G90 G94 G17 G98
N2 G20
( TOOL: T2 SPOT DRILL D 0.500 )
N3 T2 M6
( OPERATION: SPOT DRILLING.1 )
N4 G0 X.8125 Y.4375
N5 G43 Z2.0 H2
N6 G1 Z.6 F20.
N7 Z.1 F10.
N8 G81 X.8125 Y.4375 Z-.03 R.1 F6.4
N9 G80
N10 G0 Z1.1
N11 Z3.
N12 X0 Y0
( TOOL: T8 3/16" DRILL )
N13 T8 M6
( OPERATION: DRILLING DEEP HOLE.1 )
N14 X.8125 Y.4375
N15 G43 Z2.0 H8
N16 G1 Z.35 F20.
N17 M07
N18 Z.1 F10.
N19 G83 X.8125 Y.4375 Z-.8563 R.1 Q.1 F3.84
N20 G80
N21 G0 Z3.
N22 X0 Y0
( TOOL: T11 3/8" DRILL )
N23 T11 M6
( OPERATION: DRILLING.1 )
N24 X.8125 Y.4375
N25 G43 Z2.0 H11
N26 G1 Z.6 F20.
N27 M07
N28 Z.1 F10.
N29 G81 X.8125 Y.4375 Z-.9127 R.1 F7.68
N30 G80
N31 G0 Z1.1
N32 M09
N33 Z3.
N34 X0 Y0
( TOOL: 1/4" LONG END MILL )
N35 T17 M6
( OPERATION: PROFILE CONTOURING.1 )
N36 X1.825 Y.1625
N37 G43 Z2.0 H17
N38 M07
N39 G1 Z-.1275 F10.
N40 X1.725 F19.2
N41 X1.625
N42 Y-.0375
N43 Y-.2875
N44 Z.3725 F60.
N45 G0 X1.825 Y.1625
N46 Z.245
N47 G1 Z-.255 F10.
N48 X1.725 F19.2
N49 X1.625
N50 Y-.0375
N51 Y-.2875
N52 Z.245 F60.
N53 G0 X1.825 Y.1625
N54 Z.1175
N55 G1 Z-.3825 F10.
N56 X1.725 F19.2
N57 X1.625
N58 Y-.0375
N59 Y-.2875
N60 Z.1175 F60.
N61 G0 X1.825 Y.1625
N62 G1 Z-.01 F10.
N63 Z-.51
N64 X1.725 F19.2
N65 X1.625
N66 Y-.0375
N67 Y-.2875
N68 Z-.01 F60.
N69 G0 Z.3725
N70 X1.825 Y.225
N71 G1 Z-.1275 F10.
N72 X1.725 F19.2
N73 X1.5625
N74 Y-.0375
N75 Y-.2875
N76 Z.3725 F60.
N77 G0 X1.825 Y.225
N78 Z.245
N79 G1 Z-.255 F10.
N80 X1.725 F19.2
N81 X1.5625
N82 Y-.0375
N83 Y-.2875
N84 Z.245 F60.
N85 G0 X1.825 Y.225
N86 Z.1175
N87 G1 Z-.3825 F10.
N88 X1.725 F19.2
N89 X1.5625
N90 Y-.0375
N91 Y-.2875
N92 Z.1175 F60.
N93 G0 X1.825 Y.225
N94 G1 Z-.01 F10.
N95 Z-.51
N96 X1.725 F19.2
N97 X1.5625
N98 Y-.0375
N99 Y-.2875
N100 Z-.01 F60.
N101 G0 Z.3725
N102 X1.825 Y.2875
N103 G1 Z-.1275 F10.
N104 X1.725 F19.2
N105 X1.5
N106 Y-.0375
N107 Y-.2875
N108 Z.3725 F60.
N109 G0 X1.825 Y.2875
N110 Z.245
N111 G1 Z-.255 F10.
N112 X1.725 F19.2
N113 X1.5
N114 Y-.0375
N115 Y-.2875
N116 Z.245 F60.
N117 G0 X1.825 Y.2875
N118 Z.1175
N119 G1 Z-.3825 F10.
N120 X1.725 F19.2
N121 X1.5
N122 Y-.0375
N123 Y-.2875
N124 Z.1175 F60.
N125 G0 X1.825 Y.2875
N126 G1 Z-.01 F10.
N127 Z-.51
N128 X1.725 F19.2
N129 X1.5
N130 Y-.0375
N131 Y-.2875
N132 Z-.01 F60.
N133 G0 Z.3725
N134 X1.825 Y.35
N135 G1 Z-.1275 F10.
N136 X1.725 F19.2
N137 X1.4375
N138 Y-.0375
N139 Y-.2875
N140 Z.3725 F60.
N141 G0 X1.825 Y.35
N142 Z.245
N143 G1 Z-.255 F10.
N144 X1.725 F19.2
N145 X1.4375
N146 Y-.0375
N147 Y-.2875
N148 Z.245 F60.
N149 G0 X1.825 Y.35
N150 Z.1175
N151 G1 Z-.3825 F10.
N152 X1.725 F19.2
N153 X1.4375
N154 Y-.0375
N155 Y-.2875
N156 Z.1175 F60.
N157 G0 X1.825 Y.35
N158 G1 Z-.01 F10.
N159 Z-.51
N160 X1.725 F19.2
N161 X1.4375
N162 Y-.0375
N163 Y-.2875
N164 Z-.01 F60.
N165 G0 Z.3725
N166 X1.825 Y.4125
N167 G1 Z-.1275 F10.
N168 X1.725 F19.2
N169 X1.375
N170 Y-.0375
N171 Y-.2875
N172 Z.3725 F60.
N173 G0 X1.825 Y.4125
N174 Z.245
N175 G1 Z-.255 F10.
N176 X1.725 F19.2
N177 X1.375
N178 Y-.0375
N179 Y-.2875
N180 Z.245 F60.
N181 G0 X1.825 Y.4125
N182 Z.1175
N183 G1 Z-.3825 F10.
N184 X1.725 F19.2
N185 X1.375
N186 Y-.0375
N187 Y-.2875
N188 Z.1175 F60.
N189 G0 X1.825 Y.4125
N190 G1 Z-.01 F10.
N191 Z-.51
N192 X1.725 F19.2
N193 X1.375
N194 Y-.0375
N195 Y-.2875
N196 Z-.01 F60.
N197 G0 Z.3725
N198 X1.825 Y.475
N199 G1 Z-.1275 F10.
N200 X1.725 F19.2
N201 X1.3125
N202 Y-.0375
N203 Y-.2875
N204 Z.3725 F60.
N205 G0 X1.825 Y.475
N206 Z.245
N207 G1 Z-.255 F10.
N208 X1.725 F19.2
N209 X1.3125
N210 Y-.0375
N211 Y-.2875
N212 Z.245 F60.
N213 G0 X1.825 Y.475
N214 Z.1175
N215 G1 Z-.3825 F10.
N216 X1.725 F19.2
N217 X1.3125
N218 Y-.0375
N219 Y-.2875
N220 Z.1175 F60.
N221 G0 X1.825 Y.475
N222 G1 Z-.01 F10.
N223 Z-.51
N224 X1.725 F19.2
N225 X1.3125
N226 Y-.0375
N227 Y-.2875
N228 Z.49 F60.
( OPERATION: PROFILE CONTOURING.2 )
N229 G0 X0
N230 Z.3725
N231 M07
N232 G1 Z-.1275 F10.
N233 Y-.0375 F19.2
N234 Y.1625
N235 X-.1
N236 X-.125
N237 Z.3725 F60.
N238 G0 X0 Y-.2875
N239 Z.245
N240 G1 Z-.255 F10.
N241 Y-.0375 F19.2
N242 Y.1625
N243 X-.1
N244 X-.125
N245 Z.245 F60.
N246 G0 X0 Y-.2875
N247 Z.1175
N248 G1 Z-.3825 F10.
N249 Y-.0375 F19.2
N250 Y.1625
N251 X-.1
N252 X-.125
N253 Z.1175 F60.
N254 G0 X0 Y-.2875
N255 G1 Z-.01 F10.
N256 Z-.51
N257 Y-.0375 F19.2
N258 Y.1625
N259 X-.1
N260 X-.125
N261 Z-.01 F60.
N262 G0 Z.3725
N263 X.0625 Y-.2875
N264 G1 Z-.1275 F10.
N265 Y-.0375 F19.2
N266 Y.225
N267 X-.1
N268 X-.125
N269 Z.3725 F60.
N270 G0 X.0625 Y-.2875
N271 Z.245
N272 G1 Z-.255 F10.
N273 Y-.0375 F19.2
N274 Y.225
N275 X-.1
N276 X-.125
N277 Z.245 F60.
N278 G0 X.0625 Y-.2875
N279 Z.1175
N280 G1 Z-.3825 F10.
N281 Y-.0375 F19.2
N282 Y.225
N283 X-.1
N284 X-.125
N285 Z.1175 F60.
N286 G0 X.0625 Y-.2875
N287 G1 Z-.01 F10.
N288 Z-.51
N289 Y-.0375 F19.2
N290 Y.225
N291 X-.1
N292 X-.125
N293 Z-.01 F60.
N294 G0 Z.3725
N295 X.125 Y-.2875
N296 G1 Z-.1275 F10.
N297 Y-.0375 F19.2
N298 Y.2875
N299 X-.1
N300 X-.125
N301 Z.3725 F60.
N302 G0 X.125 Y-.2875
N303 Z.245
N304 G1 Z-.255 F10.
N305 Y-.0375 F19.2
N306 Y.2875
N307 X-.1
N308 X-.125
N309 Z.245 F60.
N310 G0 X.125 Y-.2875
N311 Z.1175
N312 G1 Z-.3825 F10.
N313 Y-.0375 F19.2
N314 Y.2875
N315 X-.1
N316 X-.125
N317 Z.1175 F60.
N318 G0 X.125 Y-.2875
N319 G1 Z-.01 F10.
N320 Z-.51
N321 Y-.0375 F19.2
N322 Y.2875
N323 X-.1
N324 X-.125
N325 Z-.01 F60.
N326 G0 Z.3725
N327 X.1875 Y-.2875
N328 G1 Z-.1275 F10.
N329 Y-.0375 F19.2
N330 Y.35
N331 X-.1
N332 X-.125
N333 Z.3725 F60.
N334 G0 X.1875 Y-.2875
N335 Z.245
N336 G1 Z-.255 F10.
N337 Y-.0375 F19.2
N338 Y.35
N339 X-.1
N340 X-.125
N341 Z.245 F60.
N342 G0 X.1875 Y-.2875
N343 Z.1175
N344 G1 Z-.3825 F10.
N345 Y-.0375 F19.2
N346 Y.35
N347 X-.1
N348 X-.125
N349 Z.1175 F60.
N350 G0 X.1875 Y-.2875
N351 G1 Z-.01 F10.
N352 Z-.51
N353 Y-.0375 F19.2
N354 Y.35
N355 X-.1
N356 X-.125
N357 Z-.01 F60.
N358 G0 Z.3725
N359 X.25 Y-.2875
N360 G1 Z-.1275 F10.
N361 Y-.0375 F19.2
N362 Y.4125
N363 X-.1
N364 X-.125
N365 Z.3725 F60.
N366 G0 X.25 Y-.2875
N367 Z.245
N368 G1 Z-.255 F10.
N369 Y-.0375 F19.2
N370 Y.4125
N371 X-.1
N372 X-.125
N373 Z.245 F60.
N374 G0 X.25 Y-.2875
N375 Z.1175
N376 G1 Z-.3825 F10.
N377 Y-.0375 F19.2
N378 Y.4125
N379 X-.1
N380 X-.125
N381 Z.1175 F60.
N382 G0 X.25 Y-.2875
N383 G1 Z-.01 F10.
N384 Z-.51
N385 Y-.0375 F19.2
N386 Y.4125
N387 X-.1
N388 X-.125
N389 Z-.01 F60.
N390 G0 Z.3725
N391 X.3125 Y-.2875
N392 G1 Z-.1275 F10.
N393 Y-.0375 F19.2
N394 Y.475
N395 X-.1
N396 X-.125
N397 Z.3725 F60.
N398 G0 X.3125 Y-.2875
N399 Z.245
N400 G1 Z-.255 F10.
N401 Y-.0375 F19.2
N402 Y.475
N403 X-.1
N404 X-.125
N405 Z.245 F60.
N406 G0 X.3125 Y-.2875
N407 Z.1175
N408 G1 Z-.3825 F10.
N409 Y-.0375 F19.2
N410 Y.475
N411 X-.1
N412 X-.125
N413 Z.1175 F60.
N414 G0 X.3125 Y-.2875
N415 G1 Z-.01 F10.
N416 Z-.51
N417 Y-.0375 F19.2
N418 Y.475
N419 X-.1
N420 X-.125
N421 Z.49 F60.
( OPERATION: PROFILE CONTOURING.3 )
N422 G0 X1.825 Y.465
N423 Z.3725
N424 M07
N425 G1 Z-.1275 F10.
N426 X1.725 F19.2
N427 X1.3225
N428 Y.4375
N429 G2 X.3025 Y.4375 I-.51 J0
N430 G1 Y.465
N431 X-.1
N432 X-.125
N433 Z.3725 F60.
N434 G0 X1.825
N435 Z.245
N436 G1 Z-.255 F10.
N437 X1.725 F19.2
N438 X1.3225
N439 Y.4375
N440 G2 X.3025 Y.4375 I-.51 J0
N441 G1 Y.465
N442 X-.1
N443 X-.125
N444 Z.245 F60.
N445 G0 X1.825
N446 Z.1175
N447 G1 Z-.3825 F10.
N448 X1.725 F19.2
N449 X1.3225
N450 Y.4375
N451 G2 X.3025 Y.4375 I-.51 J0
N452 G1 Y.465
N453 X-.1
N454 X-.125
N455 Z.1175 F60.
N456 G0 X1.825
N457 G1 Z-.01 F10.
N458 Z-.51
N459 X1.725 F19.2
N460 X1.3225
N461 Y.4375
N462 G2 X.3025 Y.4375 I-.51 J0
N463 G1 Y.465
N464 X-.1
N465 X-.125
N466 Z-.01 F60.
N467 G0 Z.3725
N468 X1.825 Y.4963
N469 G1 Z-.1275 F10.
N470 X1.725 F19.2
N471 X1.2913
N472 Y.4375
N473 G2 X.3338 Y.4375 I-.4788 J0
N474 G1 Y.4963
N475 X-.1
N476 X-.125
N477 Z.3725 F60.
N478 G0 X1.825
N479 Z.245
N480 G1 Z-.255 F10.
N481 X1.725 F19.2
N482 X1.2913
N483 Y.4375
N484 G2 X.3338 Y.4375 I-.4788 J0
N485 G1 Y.4963
N486 X-.1
N487 X-.125
N488 Z.245 F60.
N489 G0 X1.825
N490 Z.1175
N491 G1 Z-.3825 F10.
N492 X1.725 F19.2
N493 X1.2913
N494 Y.4375
N495 G2 X.3338 Y.4375 I-.4788 J0
N496 G1 Y.4963
N497 X-.1
N498 X-.125
N499 Z.1175 F60.
N500 G0 X1.825
N501 G1 Z-.01 F10.
N502 Z-.51
N503 X1.725 F19.2
N504 X1.2913
N505 Y.4375
N506 G2 X.3338 Y.4375 I-.4788 J0
N507 G1 Y.4963
N508 X-.1
N509 X-.125
N510 Z-.01 F60.
N511 G0 Z.3725
N512 X1.825 Y.5275
N513 G1 Z-.1275 F10.
N514 X1.725 F19.2
N515 X1.275
N516 G3 X1.26 Y.5125 I0 J-.015
N517 G1 Y.4375
N518 G2 X.365 Y.4375 I-.4475 J0
N519 G1 Y.5125
N520 G3 X.35 Y.5275 I-.015 J0
N521 G1 X-.1
N522 X-.125
N523 Z.3725 F60.
N524 G0 X1.825
N525 Z.245
N526 G1 Z-.255 F10.
N527 X1.725 F19.2
N528 X1.275
N529 G3 X1.26 Y.5125 I0 J-.015
N530 G1 Y.4375
N531 G2 X.365 Y.4375 I-.4475 J0
N532 G1 Y.5125
N533 G3 X.35 Y.5275 I-.015 J0
N534 G1 X-.1
N535 X-.125
N536 Z.245 F60.
N537 G0 X1.825
N538 Z.1175
N539 G1 Z-.3825 F10.
N540 X1.725 F19.2
N541 X1.275
N542 G3 X1.26 Y.5125 I0 J-.015
N543 G1 Y.4375
N544 G2 X.365 Y.4375 I-.4475 J0
N545 G1 Y.5125
N546 G3 X.35 Y.5275 I-.015 J0
N547 G1 X-.1
N548 X-.125
N549 Z.1175 F60.
N550 G0 X1.825
N551 G1 Z-.01 F10.
N552 Z-.51
N553 X1.725 F19.2
N554 X1.275
N555 G3 X1.26 Y.5125 I0 J-.015
N556 G1 Y.4375
N557 G2 X.365 Y.4375 I-.4475 J0
N558 G1 Y.5125
N559 G3 X.35 Y.5275 I-.015 J0
N560 G1 X-.1
N561 X-.125
N562 Z.49 F60.
( OPERATION: PROFILE CONTOURING.4 )
N563 G0 X1.825 Y.4875
N564 Z.3725
N565 M07
N566 G1 Z-.1275 F10.
N567 X1.725 F19.2
N568 X1.3
N569 Y.4375
N570 G2 X.325 Y.4375 I-.4875 J0
N571 G1 Y.4875
N572 X-.1
N573 X-.125
N574 Z.4725 F60.
N575 G0 X1.825
N576 Z.345
N577 G1 Z-.255 F10.
N578 X1.725 F19.2
N579 X1.3
N580 Y.4375
N581 G2 X.325 Y.4375 I-.4875 J0
N582 G1 Y.4875
N583 X-.1
N584 X-.125
N585 Z.345 F60.
N586 G0 X1.825
N587 Z.2175
N588 G1 Z-.3825 F10.
N589 X1.725 F19.2
N590 X1.3
N591 Y.4375
N592 G2 X.325 Y.4375 I-.4875 J0
N593 G1 Y.4875
N594 X-.1
N595 X-.125
N596 Z.2175 F60.
N597 G0 X1.825
N598 Z.09
N599 G1 Z-.51 F10.
N600 X1.725 F19.2
N601 X1.3
N602 Y.4375
N603 G2 X.325 Y.4375 I-.4875 J0
N604 G1 Y.4875
N605 X-.1
N606 X-.125
N607 Z.15 F60.
N608 G0 X1.825 Y.5375
N609 G1 Z-.51 F10.
N610 X1.725 F19.2
N611 X1.275
N612 G3 X1.25 Y.5125 I0 J-.025
N613 G1 Y.4375
N614 G2 X.375 Y.4375 I-.4375 J0
N615 G1 Y.5125
N616 G3 X.35 Y.5375 I-.025 J0
N617 G1 X-.1
N618 X-.125
N619 Z.49 F60.
( OPERATION: PROFILE CONTOURING.5 )
N620 G0 X-.1438 Y.4125
N621 Z.3725
N622 M07
N623 G1 Z-.1275 F10.
N624 Y.6625 F19.2
N625 Y.8125
N626 G2 X.0625 Y1.0188 I.2063 J0
N627 G1 X1.5625
N628 G2 X1.7688 Y.8125 I0 J-.2063
N629 G1 Y.6625
N630 Y.4125
N631 Z.4725 F60.
N632 G0 X-.1438
N633 Z.345
N634 G1 Z-.255 F10.
N635 Y.6625 F19.2
N636 Y.8125
N637 G2 X.0625 Y1.0188 I.2063 J0
N638 G1 X1.5625
N639 G2 X1.7688 Y.8125 I0 J-.2063
N640 G1 Y.6625
N641 Y.4125
N642 Z.345 F60.
N643 G0 X-.1438
N644 Z.2175
N645 G1 Z-.3825 F10.
N646 Y.6625 F19.2
N647 Y.8125
N648 G2 X.0625 Y1.0188 I.2063 J0
N649 G1 X1.5625
N650 G2 X1.7688 Y.8125 I0 J-.2063
N651 G1 Y.6625
N652 Y.4125
N653 Z.2175 F60.
N654 G0 X-.1438
N655 Z.09
N656 G1 Z-.51 F10.
N657 Y.6625 F19.2
N658 Y.8125
N659 G2 X.0625 Y1.0188 I.2063 J0
N660 G1 X1.5625
N661 G2 X1.7688 Y.8125 I0 J-.2063
N662 G1 Y.6625
N663 Y.4125
N664 Z.15 F60.
N665 G0 Z.4725
N666 X-.1125
N667 G1 Z-.1275 F10.
N668 Y.6625 F19.2
N669 Y.8125
N670 G2 X.0625 Y.9875 I.175 J0
N671 G1 X1.5625
N672 G2 X1.7375 Y.8125 I0 J-.175
N673 G1 Y.6625
N674 Y.4125
N675 Z.4725 F60.
N676 G0 X-.1125
N677 Z.345
N678 G1 Z-.255 F10.
N679 Y.6625 F19.2
N680 Y.8125
N681 G2 X.0625 Y.9875 I.175 J0
N682 G1 X1.5625
N683 G2 X1.7375 Y.8125 I0 J-.175
N684 G1 Y.6625
N685 Y.4125
N686 Z.345 F60.
N687 G0 X-.1125
N688 Z.2175
N689 G1 Z-.3825 F10.
N690 Y.6625 F19.2
N691 Y.8125
N692 G2 X.0625 Y.9875 I.175 J0
N693 G1 X1.5625
N694 G2 X1.7375 Y.8125 I0 J-.175
N695 G1 Y.6625
N696 Y.4125
N697 Z.2175 F60.
N698 G0 X-.1125
N699 Z.09
N700 G1 Z-.51 F10.
N701 Y.6625 F19.2
N702 Y.8125
N703 G2 X.0625 Y.9875 I.175 J0
N704 G1 X1.5625
N705 G2 X1.7375 Y.8125 I0 J-.175
N706 G1 Y.6625
N707 Y.4125
N708 Z.15 F60.
N709 G0 X-.0625
N710 G1 Z-.51 F10.
N711 Y.6625 F19.2
N712 Y.8125
N713 G2 X.0625 Y.9375 I.125 J0
N714 G1 X1.5625
N715 G2 X1.6875 Y.8125 I0 J-.125
N716 G1 Y.6625
N717 Y.4125
N718 Z3.0 F60.
N719 M09
N720 M30
%
Re: Mach4 cnc program min/max values
« Reply #17 on: April 13, 2019, 07:12:04 PM »
Hi,
OK, I have some code to drive the two new DROs in work coordinates.

First you need to make two new instance registers iRegs0/workZMax and iRegs0/workZMin, attached
The two DRO's need their driving register set in the DRO properties, I've shown Z_Min, attached

And then this code needs to go in the PLC script:

Code: [Select]
--*****************************************************************************
local zOffset=mc.mcCntlGetOffset(inst,mc.Z_AXIS,mc.MC_OFFSET_FIXTURE)
local workZMaxHandle=mc.mcRegGetHandle(inst,'core/inst/PathZmax')
local workZMax=mc.mcRegGetValue(workZMaxHandle)-zOffset
local workZMaxHandle=mc.mcRegGetHandle(inst,'iRegs0/workZMax')
mc.mcRegSetValue(workZMaxHandle,workZMax)
local workZMinHandle=mc.mcRegGetHandle(inst,'core/inst/PathZmin')
local workZMin=mc.mcRegGetValue(workZMinHandle)-zOffset
local workZMinHandle=mc.mcRegGetHandle(inst,'iRegs0/workZMin')
mc.mcRegSetValue(workZMinHandle,workZMin)
--**********************************************************************************

Pretty quick and dirty code but it seems to work.

Craig
« Last Edit: April 13, 2019, 07:13:39 PM by joeaverage »
My wife left with my best friend...
     and I miss him!

Offline Bob49

*
  •  57 57
    • View Profile
Re: Mach4 cnc program min/max values
« Reply #18 on: April 13, 2019, 07:29:38 PM »
That's awesome Craig, you're pretty quick with that code.  I barely understand that stuff.  Going to take your work there and give it a go on my system.  Been a a couple years since I messed with the code behind Mach, but I've been in it before for my console.   I'm recalling the PLC script being different than the screen script so not intimidated too much by it.

I was actually looking at the properties of the two Z dro's in the screen editor earlier and think I know exactly where those are there.

Thanks
Bob
Re: Mach4 cnc program min/max values
« Reply #19 on: April 13, 2019, 07:39:41 PM »
I corrected the Z20. for H2 in the program.  Found my extreme +Z in the program is 3.0, extreme -Z is -.9127.  Total of 3.9127 in my pea brain.  Of course that changed the DRO readings and I did the math between the two readings for Z and got exactly 1.5" more than the 3.9127".  So I guess I'm still not quite getting it right.  I looked for a - or + value in the programmed don't find any other than those I mentioned.  The Z3.0 moves are in prep for a tool change, all the g43's then set the new tool at Z2.0.  I'll drop the program in this response along with another screen shot fo the dro's. 

That might be something worth exploring, getting them to read in work coordinates.  The - Z values that are displayed in machine coordinates are a bit confusing.
Hi Bob, just curious as to how you are referencing your Z axis, and what your G54 Z offset is for this part prgm. Your file does go to +Z3, mach coords,which is strange. Are you homing somewhere other thant Z all the way up ? Typically, no mach coord Z should be positive. In my limited experience  :)