Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: inioxos on September 02, 2010, 02:23:22 AM

Title: Cant get VB script to work
Post by: inioxos on September 02, 2010, 02:23:22 AM
Hello there,

I just want to energize a output and change pulley.

I am new to this and i have tried several scripts but nothing.
The following is giving a '' Scriper Compile Error. In SpindleSpeed.mis''


rpm = GetRPM()
If
RPM > 2501
Then
SetPulley(2)
ActivateSignal(OUTPUT5)
End If

If
RPM < 2501
Then
SetPulley(1)
DeActivateSignal(OUTPUT5)

End If
SetSpinSpeed( rpm ) 


What is going on????
Title: Re: Cant get VB script to work
Post by: stirling on September 02, 2010, 05:41:58 AM
Don't split your "if expression then" constructs accross lines.

If
RPM > 2501
Then

If RPM > 2501 Then

Cheers
Ian
Title: Re: Cant get VB script to work
Post by: inioxos on September 02, 2010, 08:47:18 PM
Thank Ian 

Simple issues are most difficult.


Title: Re: Cant get VB script to work
Post by: stirling on September 03, 2010, 03:55:41 AM
 :)