Hello Guest it is March 28, 2024, 04:18:06 PM

Author Topic: SystemWaitFor(1005) ignored  (Read 2798 times)

0 Members and 1 Guest are viewing this topic.

SystemWaitFor(1005) ignored
« 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
« Last Edit: January 16, 2018, 06:09:16 AM by phokingNATE »
Re: SystemWaitFor(1005) ignored
« Reply #1 on: January 17, 2018, 01:04:44 AM »
Fixed it!

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


Cheers,
Nate
« Last Edit: January 17, 2018, 01:07:58 AM by Frostyybeer »