Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: stirling 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
-
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?
-
Have you tried it with a feed rate in the line "G91 G01 X-5. F10."
Graham.
-
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