Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: poppabear on June 17, 2007, 10:07:03 PM

Title: Brian or Graham or ?......Need some SystemWaitFor() help
Post by: poppabear on June 17, 2007, 10:07:03 PM
Can you give me a example of a working systemwaitfor()???
It just blows past it, when doing step through, it doesnt wait for the signal.
I want to stay away from other While loops, but there doesnt appear to be a choice.
Any way to see if there is a bug in the VB interpreter?
What was that work around that, some guy posted about doing "Sleep..something" that made the interpreter run faster?
Currently, the VB will hang, and hang, and hang I have to reboot.


ActivateSignal(OUTPUT1)
Code "G4 p5"
While IsMoving()
Wend
DeActivateSignal(OUTPUT1)

ActivateSignal(OUTPUT3)          'starts a latched timer in a PLC (times out in 5 seconds)
While  SystemWaitFor(INPUT3)   'When the 5 second timer in the PLC times out, it sends a signal to INPUT3 in mach
WEnd
DeActivateSignal(OUTPUT3)       'Therorectcally, after the systemwaitfor drops out, it will deactivate output three

ActivateSignal(OUTPUT1)
Code "G4 p2"
While IsMoving()
Wend
DeActivateSignal(OUTPUT1)

Scott
Title: Re: Brian or Graham or ?......Need some SystemWaitFor() help
Post by: Graham Waterworth on June 19, 2007, 10:49:54 AM
Hi Poppabear,

Is this the command you are wanting

Graham.


Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
Title: Re: Brian or Graham or ?......Need some SystemWaitFor() help
Post by: poppabear on June 19, 2007, 09:44:50 PM
Yes that is the one!!!!!

Also, any chance you could give me an example of a "Working"  SystemWaitFor()??  When ever I step through the VB, scripter, it just blows
past it, weather the bit is true or not ???
Hope you trip back home went well, It really was a priveledge to meet you..............and........., abuse you  :o.............hehehehe :-*

Scott
Title: Re: Brian or Graham or ?......Need some SystemWaitFor() help
Post by: CNC-Steuerung on June 20, 2007, 03:34:24 PM
Hi Scott,

Systemwaitfor doesnt work while debugging in the VB-Script editor!

Ive inserted the code into a M~ macro and use it in my code.
That works very fine...

Good luck,


Wolfram
Title: Re: Brian or Graham or ?......Need some SystemWaitFor() help
Post by: poppabear on June 20, 2007, 08:11:23 PM
Would you mind posting an example of a working macro with the systemwaitfor?

It doesnt have to be complex, Just an example of waiting for INPUT1 or something,
I will trigger it from a PLC.

Scott
Title: Re: Brian or Graham or ?......Need some SystemWaitFor() help
Post by: CNC-Steuerung on June 21, 2007, 03:49:17 AM
Hi Scott,

your code is working well, but Ive attached the macro for you.

Best regards from Germany,

Wolfram

PS.. its not possible to upload *.m1s fils, please rename ist before using...
Title: Re: Brian or Graham or ?......Need some SystemWaitFor() help
Post by: poppabear on June 21, 2007, 07:53:42 PM
Wolfman,

only this was in the file:  DeactivateSignal(Output1)SystemWaitFor(I

But if you say my original code worked fine, then I will have to look else where to see if I forgot some stupid setting.

Scott