Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: omegasea21 on July 21, 2010, 06:46:54 PM

Title: Simple If Then Script Not workng, please help
Post by: omegasea21 on July 21, 2010, 06:46:54 PM
I would just like the script to end if the condition is met and it is not stopping. I see the Torch Up LED (OEMLED 37) lit up in the diagnostics screen, yet the script just wont stop running. Please help.

Code "m7" 'mist on
Code "G4 P4" 'Wait 4 seconds
Code "M9" 'mist off
Code "M8" 'flood on
Code "G4 P4" 'wait for seconds
Code "M9" 'Flood Off
If GetOemLED(37)=1 then 'if torch up Led active end script
End
Else 'if not
Code "m7" 'mist on
Code "G4 P4" 'Wait 4 seconds
Code "M9" 'mist off
Code "M8" 'flood on
Code "G4 P4" 'wait for seconds
Code "M9" 'Flood Off


Title: Re: Simple If Then Script Not workng, please help
Post by: ger21 on July 21, 2010, 07:22:37 PM
Try:

Code "m7" 'mist on
Code "G4 P4" 'Wait 4 seconds
Code "M9" 'mist off
Code "M8" 'flood on
Code "G4 P4" 'wait for seconds
Code "M9" 'Flood Off
If  not GetOemLED(37) then

Code "m7" 'mist on
Code "G4 P4" 'Wait 4 seconds
Code "M9" 'mist off
Code "M8" 'flood on
Code "G4 P4" 'wait for seconds
Code "M9" 'Flood Off

end if