Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: v tec on February 14, 2015, 03:53:02 AM

Title: how to test the time since the start?
Post by: v tec on February 14, 2015, 03:53:02 AM
hi i use a gcode mixed with macro vb


my is code is for exemple

g00x1y1
m51
g00x10y10
m52
g000x0y0
m47
m30



m51 is for exemple
sub main()
if "time after start button" < 10sec then
activatesignal(ouput1)
exit sub
end if
end sub

and m52 is for exemple
sub main()
if "time after start button" > 10sec then
activatesignal(ouput1)
exit sub
end if
end sub




i try to test the led statut to the start button, but after m47 , it flash


the only solution is the the time dro, but i don t know the oem code

thanks


and sorry for my english
Title: Re: how to test the time since the start?
Post by: BR549 on February 14, 2015, 03:12:51 PM
Try this , SetTimer() starts a timer running when called, getTimer() gets the timer value.

M51
SetTimer(10)
end

M52
EndTime = GetTimer(10)
msgBox(""&EndTime)

(;-) TP