Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Bodini on January 12, 2008, 10:18:46 PM

Title: V3.0 crash with Sleep
Post by: Bodini on January 12, 2008, 10:18:46 PM
After upgrading to v3.0, this portion of a macro code below crashed mach:

systemwaitfor (start)
While IsMoving()
Sleep 100
   Wend
g55x = getuserdro(1079) + getoemdro (800)


VB Editor opened and said the error was on the Sleep 100 line (this was part of a much longer macro).  Then VB Editor froze up and I had to reset with the button on the pc.  This happened 3 times and I re-installed v2.60... and then the problem was gone.

Yes, the macro starts off with Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long).  Yes, I have used this macro 100's of times before with no problems in versions up to and including v2.60.

Full macro available to admin/mods.

-Nick
Title: Re: V3.0 crash with Sleep
Post by: Hood on January 13, 2008, 06:23:25 AM
Brian always discouraged me from using the Declare Sub Sleep.....   Dont think he  actually said why but just it was not a good way to do it. I am terrible at VB but I think I just use G4 P*** now.
Hood
Title: Re: V3.0 crash with Sleep
Post by: zealous on January 13, 2008, 08:08:01 AM
Looks like Mario had the same issue:

Yahoo forum:
http://groups.yahoo.com/group/mach1mach2cnc/message/84954
Mario
From Mach3 R3 I had the same issue. I removed the Declare sub Sleep
line from my code and it works fine. I think Art add support in R3 so
you can call Sleep without the declare.

Graham
Title: Re: V3.0 crash with Sleep
Post by: Bodini on January 13, 2008, 10:28:08 AM
Aha, I see.  Ok, when I get a chance I will try it again with v3 and no sleep or sans the declare.  I HAD to add the sleep because Mach was blowing past the "g55x = getuserdro(1079) + getoemdro (800)" command without it.

Thanks.

-Nick
Title: Re: V3.0 crash with Sleep
Post by: Bodini on January 13, 2008, 10:30:30 AM
Looks like Mario had the same issue:

Yahoo forum:
http://groups.yahoo.com/group/mach1mach2cnc/message/84954
Mario
From Mach3 R3 I had the same issue. I removed the Declare sub Sleep
line from my code and it works fine. I think Art add support in R3 so
you can call Sleep without the declare.

Graham


Wow, that is nearly the SAME message I posted, isn't it.  I always forget about that Yahoo message area. ;-)
Title: Re: V3.0 crash with Sleep
Post by: zealous on January 13, 2008, 01:12:05 PM
Yeah it would be great if we could all merge to one forum and have one central location. It would make thing easer to keep up with updates and changes.
Title: Re: V3.0 crash with Sleep
Post by: Hood on January 13, 2008, 01:52:26 PM
Ha ha, Jason that is never going to happen. Personally I cant see the attraction of the Yahoo style groups, in fact I think they are really awkward and this style of forum is brilliant.  BUT I know there are lots of people that say exacty the opposite.
Hood
Title: Re: V3.0 crash with Sleep
Post by: Bodini on January 14, 2008, 02:46:24 PM
Ha ha, Jason that is never going to happen. Personally I cant see the attraction of the Yahoo style groups, in fact I think they are really awkward and this style of forum is brilliant. BUT I know there are lots of people that say exacty the opposite.
Hood

Agreed 100%... and those other people are wrong. LOL. :-p
Title: Re: V3.0 crash with Sleep
Post by: Hood on January 14, 2008, 03:01:24 PM
Agreed 100%... and those other people are wrong. LOL. :-p


Hush now, you cant say that Art is one of the ones that prefers Yahoo :)

Hood