Hello Guest it is March 28, 2024, 05:42:45 PM

Author Topic: how to test the time since the start?  (Read 2591 times)

0 Members and 1 Guest are viewing this topic.

Offline v tec

*
  •  31 31
    • View Profile
how to test the time since the start?
« 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

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: how to test the time since the start?
« Reply #1 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