Hello Guest it is July 08, 2020, 01:01:17 AM

Author Topic: Subroutine reps DRO?  (Read 3798 times)

0 Members and 1 Guest are viewing this topic.

Subroutine reps DRO?
« on: January 11, 2010, 12:46:36 AM »
I posted a question to a thread which I now realize is over in the VB subboard.  I just want a DRO that shows which iteration a gcode subroutine is on.

If you don't normally read the VB subboard, could you please take a look at http://www.machsupport.com/forum/index.php/topic,7030.msg90039.html#msg90039 ?

Thanks,

Randy

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Subroutine reps DRO?
« Reply #1 on: January 11, 2010, 10:43:42 AM »
Hi

try dro 222 (as you have done). Then try it in single block mode. It'll count DOWN from L? to zero. How to run it out of single block mode? - stick a G4 P1 in the loop somewhere. Why? - I haven't the faintest idea - but it seems to work.

Cheers

Ian
Re: Subroutine reps DRO?
« Reply #2 on: January 11, 2010, 02:57:30 PM »
Hi

try dro 222 (as you have done). Then try it in single block mode. It'll count DOWN from L? to zero. How to run it out of single block mode? - stick a G4 P1 in the loop somewhere. Why? - I haven't the faintest idea - but it seems to work.

Cheers

Ian

DROs only get updated about 10X/second.  So, if you want to make sure you have the latest value, you have to wait long enough to ensure the most recent update has occurrect before reading the DRO.  I'm hoping this will be fixed in v4....

Regards,
Ray L.
Regards,
Ray L.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Subroutine reps DRO?
« Reply #3 on: January 11, 2010, 05:14:12 PM »
hmmmm - don't think this is the reason for this though ray. I tried this with a sub that took several seconds per iteration and the dro registered nothing. Yet with a dwell of just 1 ms all worked fine.

Cheers

Ian
Re: Subroutine reps DRO?
« Reply #4 on: January 11, 2010, 05:52:58 PM »
Ian and Ray, thank you very much for your answers.  Adding a G04 P.1 did the trick.  My dwell is in seconds, and there seems to be a "floor" for dwell time, that specifying a smaller value doesn't decrease the dwell.  I did try G04 P.001, and setting dwell to ms and trying G04 P1, but that didn't shorten the dwell time any.

And even my little test program takes at least a second to run, so if the dwell wasn't necessary to trigger the DRO it should have had plenty of time for the DRO to update (that's what I didn't understand in the first place...)

I did notice that the counter decrements on the dwell, so placing the dwell at the beginning of the subroutine immediately decremented the counter and the final iteration was on cycle "0", but placing the dwell just before the M99 caused the last iteration to report cycle "1", decrementing to 0 when the program ended.

Randy
« Last Edit: January 11, 2010, 05:54:54 PM by zephyr9900 »
Re: Subroutine reps DRO?
« Reply #5 on: January 12, 2010, 12:21:03 AM »
hmmmm - don't think this is the reason for this though ray. I tried this with a sub that took several seconds per iteration and the dro registered nothing. Yet with a dwell of just 1 ms all worked fine.

Cheers

Ian

That suggests it has something to do with the threading, and inserting a Sleep 1 would probably also work just as well.  All you need is something that forces a context switch, however briefly, back to the Mach foreground task to get the DROs updated.

Regards,
Ray L.
Regards,
Ray L.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Subroutine reps DRO?
« Reply #6 on: January 12, 2010, 05:13:38 AM »
maybe... but all the other dros update no problem.

Offline ger21

*
  • *
  •  6,282 6,282
    • View Profile
    • The CNC Woodworker
Re: Subroutine reps DRO?
« Reply #7 on: January 12, 2010, 07:15:32 AM »
hmmmm - don't think this is the reason for this though ray. I tried this with a sub that took several seconds per iteration and the dro registered nothing. Yet with a dwell of just 1 ms all worked fine.

Cheers

Ian


Could this be due to the lookahead? Same way that comment in the g-code are displayed well before that line is current?
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html