Hello Guest it is March 28, 2024, 07:10:01 AM

Author Topic: Brian or Graham or ?......Need some SystemWaitFor() help  (Read 5817 times)

0 Members and 1 Guest are viewing this topic.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Brian or Graham or ?......Need some SystemWaitFor() help
« 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
fun times

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Brian or Graham or ?......Need some SystemWaitFor() help
« Reply #1 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)
Without engineers the world stops

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Brian or Graham or ?......Need some SystemWaitFor() help
« Reply #2 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
fun times
Re: Brian or Graham or ?......Need some SystemWaitFor() help
« Reply #3 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

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Brian or Graham or ?......Need some SystemWaitFor() help
« Reply #4 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
fun times
Re: Brian or Graham or ?......Need some SystemWaitFor() help
« Reply #5 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...

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Brian or Graham or ?......Need some SystemWaitFor() help
« Reply #6 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
fun times