Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: DaOne on September 01, 2011, 02:31:46 PM

Title: This is driving me nuts! *simple script check*
Post by: DaOne on September 01, 2011, 02:31:46 PM
I am trying to auto regen the cycle screen when its selected because mach wont update the g-code nor the tool display. The issue is it isnt smart enough not to do it if its already running a program and really screws things up. To fix this I figured I would check the run, tool change and feed hold LEDS to see if they are active and if so bypass the regen. Well I can get everything but the run LED to work reliably. I am stumped because it works just fine if I test it with "edit button script" Maybe there is a better way? Here is my code... the commented out stuff I have tried as well.


Code: [Select]
'Change to page 6
DoOEMButton (6)

'Tool change LED
If GetLED (6) Then
Exit Sub
End If

'Check if its moving
'While IsMoving()
'Exit Sub
'Wend

'Old Run LED
'If GetLED (4) Then
'Exit Sub
'End If

'Run LED
If GetLED (804) Then
Exit Sub
End If

'Feed Hold LED
If GetOEMLED (111) Then
Exit Sub
End If

DoOEMButton (160)
Title: Re: This is driving me nuts! *simple script check*
Post by: BR549 on September 01, 2011, 03:02:44 PM
I think the RUn Led is an OemLED   Try

If GetOEMLED (804) Then

(;-) TP