Hello Guest it is April 19, 2024, 03:35:33 PM

Author Topic: phantom code  (Read 5394 times)

0 Members and 1 Guest are viewing this topic.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
phantom code
« on: October 12, 2007, 12:46:54 PM »
Hi

Has anyone come accross Mach not actually executing a 'code' statement but "thinking" it has?

i.e. in my code this fragment works fine most of the time but every now and then there's no movement.

code "G01 X.."
while ismoving()
wend

... rest of code

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: phantom code
« Reply #1 on: October 14, 2007, 04:51:16 AM »
slight update: It seems I was wrong in thinking Mach 'thought' it had moved. After more checking it knows it hasn't. Here's what happens:

DRO for Xpos says 5

My macro then executes a G01 X-5 in incremental mode. X should of course now be 0 but it's still 5 and there is definitely no movement. BUT the while isMoving() wend loop still goes through several hundred iterations. So it seems that the macro thread is sending the request to the Mach thread and Mach is taking some time to do something before sending the signal back to the macro that it's finished. It's just that whatever else Mach was doing during that time, it certainly wasn't executing the G01.

So, when we send off "code statement" requests to the Mach thread and for whatever reason it fails to honour the request, does anyone know if Mach sets an error condition and/or reason block that can be read by the macro thread?

Offline Graham Waterworth

*
  • *
  •  2,672 2,672
  • Yorkshire Dales, England
    • View Profile
Re: phantom code
« Reply #2 on: October 21, 2007, 04:01:36 PM »
Have you tried it with a feed rate in the line "G91 G01 X-5. F10."

Graham.
Without engineers the world stops

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: phantom code
« Reply #3 on: October 22, 2007, 03:43:02 AM »
Hi Graham - thanks for your reply

No I haven't specifically put a feedrate in-line - but I do have a feedrate set previously. However I'd re-state that most of the time - lets say 99 times out of a 100, all works fine, but every now and then I get the failure. Having conversed with Art he thinks it may be something to do with the G31 screwing up Mach's timing somewhere. (see http://www.machsupport.com/forum/index.php/topic,4352.10.html reply #17.

Soon as I can get hold of Art's fix I'll try again and see where I get.

Thanks

Ian