Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: Frostyybeer on January 16, 2018, 06:02:22 AM

Title: SystemWaitFor(1005) ignored
Post by: Frostyybeer on January 16, 2018, 06:02:22 AM
Regarding this post https://www.machsupport.com/forum/index.php/topic,2630.0.html I am
trying to do something similar where in the beginning of my VB-script it will
1. Get current positions
2. Wait for Resume button to be pressed, once finished manual jog
3. Record NEW current positions
4. Resume the rest of code

Example
Code: [Select]
  'Get current positions
  X1 = Round (GetDRO (0), 4)
  Y1 = Round (GetDRO (1), 4)
  Z1 = Round (GetDRO (2), 4)
 
  'Wait for user to press Resume button once finished manual jog
  SystemWaitFor(1005)
  While IsMoving
  Wend

  'Get new current positions
  X2 = Round (GetDRO (0), 4)
  Y2 = Round (GetDRO (1), 4)
  Z2 = Round (GetDRO (2), 4)

  'The rest of code
   .......
   .......

However, when running this code seem to ignor the SystemWaitFor(1005).
I have created two buttons on my custom wizard screen
Button 1. Start my Script
Button 2. Is assigned to OEM 1005 (for resume)

Could it be that I am using SystemWaitFor() incorrectly?


Thank you,
Nate
Title: Re: SystemWaitFor(1005) ignored
Post by: Frostyybeer on January 17, 2018, 01:04:44 AM
Fixed it!

Code: [Select]
DoOEMButton(1005)
SystemWaitFor(1005)
While ismoving()
Wend


Cheers,
Nate