Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: giannis121 on December 29, 2009, 03:04:30 AM

Title: Wrong move when executing macro.
Post by: giannis121 on December 29, 2009, 03:04:30 AM
Maybe the subject does not describe my problem correctly.
The problem is the following.
I have a program which includes a macro.
Is named M1001 and placed after the first G00, is to wait a few seconds and after that energize an output.
The macro is executed correctly.

This is the M1001:
code ("G0 Z0.00")
While ismoving()
wend
ActivateSignal(Output1)
SetUserLed (1001,1)
wait = GetUserDRO(1041)
code ("G4P" & wait)
While ismoving()
wend
SetUserLed (1001,0)
code ("G4 P0.2")
While ismoving()
wend


Now if under ActivateSignal(output1)
i place ActivateSignal(output2)
to have 2 separate outputs,although the screen shows the right path,
the machine does not follow the path.
Usually, if lets say we have rectangular, the shape is left open about 20mm before ending.
Or other times only one dimension (usually at Y axis) is not correct (10-30mm shorter).

Then, by removing the second activation from the macro,
it comes back to the proper path.

Have you seen this problem again?
Any ideas-comments would be helpful...
Title: Re: Wrong move when executing macro.
Post by: zealous on December 29, 2009, 04:20:56 AM
Try using
Code: [Select]
Sleep(wait) and see if that has anything to do with it for example:

Code: [Select]
code ("G0 Z0.00")

While ismoving()
Sleep(250)
wend

ActivateSignal(Output1)

SetUserLed (1001,1)

wait = GetUserDRO(1041)

Sleep(wait)

While ismoving()
Sleep(250)
wend

SetUserLed (1001,0)

Sleep(250)

While ismoving()
Sleep(250)
wend