hi
i have been writing code and have had a few problems will copy first then describe the problems
this is the high speed push button
rem transmission high speed range (0-2000)
DoSpinStop
If IsActive(OEMTRIG6) Then trigger six is the high gear sw
Message "Head Already In High Gear"
stop is stop the way to stop i want to exit the program here if trigger 6 is on
End If
If Not(GetOEMLED(164)) and Not(GetOEMLED(165)) and(GetOEMDRO(39)=0) Then this part works
Do
num=num+1
SetOutBit(90,9) turn on selenoid
DoSpinCW()
SetSpinSpeed(1) spin slow
If IsActive(OEMTRIG6) Then Exit Do
If num=20 Then Goto Sub1 does this need to be reset
Loop
ResetOutBit(90,9) turn off selenoid
DoSpinStop
SetPulley(2) set pulley 2
End
rem Sub1 the sub is for stopping the selenoid before it burns up
rem resetoutbit(90,9) and triggering an estop didnt work triggered estop alot thats why it is remed out
rem Message "Time Exceeded Head Not Changed"
rem DoOEMBUTTON(1021)
Stop
End if
this is the low speed push button
rem transmission low speed range
DoSpinStop
If IsActive(OEMTRIG5) Then
Message "Head Already In Low Gear"
Stop
end if
If Not(GetOEMLED(164)) and Not(GetOEMLED(165)) and(GetOEMDRO(39)=0) Then
Do
num=num+1
SetOutBit(90,8)
DoSpinCW()
SetSpinSpeed(1)
If IsActive(OEMTRIG5) Then Exit Do
rem if num=50 then goto sub1
Loop
ResetOutBit(90,8)
dospinstop
SetPulley(1)
stop
rem sub1
rem resetoutbit(90,8)
rem Message "Time Exceeded Head Not Changed"
rem DoOemButton(1021)
stop
end if
this is m25.m1s
rem transmission high speed range (0-2000)
DoSpinStop
If IsActive(OEMTRIG6) Then trigger six is the high gear sw
Message "Head Already In High Gear"
stop
End If
If Not(GetOEMLED(164)) and Not(GetOEMLED(165)) and(GetOEMDRO(39)=0) Then
Do
num=num+1
SetOutBit(90,9)
DoSpinCW()
SetSpinSpeed(1)
If IsActive(OEMTRIG6) Then Exit Do
If num=20 Then Goto Sub1
Loop
ResetOutBit(90,9)
DoSpinStop
SetPulley(2)
End
Sub1
Message "Time Exceeded Head Not Changed"
Stop
End if
problems i am not sure if the count in the do loop needs to be reset or the proper def for sub there has to be a few problems so if anybody can help me or if anybody is a programmer and they dont break the bank i need help m25.m1s doesnt work i can step through it in vb but i cannot call it from the command line i put it into a simple program for auto didnt work or didnt work as expected. also when they were in there primitive stage setpulley(1 or 2) would set the pulley alright but the pulleys are different the ratios i set for speed controll work fine when reset however when i spin up after the macro changes the pulley i am off by 100 rpm if i estop and reset the speed goes right back to proper ratio has anybody seen this before and is there a fix.
thank you
mark