Hello Guest it is April 24, 2024, 08:56:45 PM

Author Topic: M23 transmission speed change  (Read 2090 times)

0 Members and 1 Guest are viewing this topic.

Offline mark4

*
  •  167 167
    • View Profile
M23 transmission speed change
« on: February 09, 2016, 03:14:07 PM »
hello i am retrofitting an okuma and howa act 5l there have been some real eye openers will post more as we go first i need to change from high gear to low gear with a m23 and a m25 macro i have writen the m23 but it doesnt work quite as expected can anybody help.

rem spindle low speed range (30-900)
DoSpinStop
If IsActive(OEMTRIG5) Then
Message "Head Already In Low Gear"
End If
If Not(GetOEMLED(164)) And Not(GetOEMLED(165)) And(GetOEMDRO(39)=0) Then
Do
setoutbit(90,8)
If IsActive(OEMTRIG5) Then Exit Do
Loop
End If
resetoutbit(90,8)
SetPulley(1)
SystemWaitFor(OEMTRIG5)

oem trigger 5 transmission low speed switch
i am using a csmio/ip-a controller
(90,8) is the selenoid
one question i have is the caps/lower case and spaces i never know which to do so can anybody tell me the proper coding to do and what will make no difference at all thank you
mark

Offline mark4

*
  •  167 167
    • View Profile
Re: M23 transmission speed change
« Reply #1 on: February 10, 2016, 08:29:54 PM »
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

Offline mark4

*
  •  167 167
    • View Profile
Re: M23 transmission speed change
« Reply #2 on: February 11, 2016, 11:52:14 AM »
hello this is getting better both buttons run for high and low gear they are basically the same as m23 and m25 however the last problem i seem to have is they are one trick poneys i start mach and run from the MDI line the one i ruin first runs the the second one wont run i think there might be some part of the program not finishing that is what all the end commands are about thank you for any help

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"
End
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
sleep(15000)
If num=20 Then Goto Sub1
Loop
ResetOutBit(90,9)
DoSpinStop
SetPulley(2)
End
Sub1
resetoutbit(90,9)
DoOEMBUTTON(1021)
Message "Time Exceeded Head Not Changed"
Stop
End if
End

m23.m1s
rem transmission low speed range
DoSpinStop
If IsActive(OEMTRIG5) Then
Message "Head Already In Low Gear"
end
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
sleep(15000)
if num=50 then goto sub1
Loop
ResetOutBit(90,8)
dospinstop
SetPulley(1)
end
sub1
resetoutbit(90,8)
Message "Time Exceeded Head Not Changed"
DoOemButton(1021)
stop
end if
End

thank you
mark