Hello Guest it is April 25, 2024, 03:17:48 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mark4

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 »
131
Mach4 General Discussion / Re: script and mach 4
« on: June 22, 2016, 09:03:31 PM »
hello
i have been working and learning screen load script have managed some things not others. i have determined the script for cycle start in gcode tab or mdi is already there you just have to call it this is what i have for cycle start and feed hold and it works so far.

[mc.ISIG_INPUT0] = function (state)
      if (state == 1) then
         mc.mcCntlFeedHold(0)
      end
end,

[mc.ISIG_INPUT1] = function (state)
      if (state == 1) then
         CycleStart()
      end
end,

i have a bread board setup with leds will try it on the machine tomorrow but it works so far

132
Mach4 General Discussion / Re: Re ESS and Mach 4
« on: June 18, 2016, 12:18:17 AM »
hi i am still using a charge pump on my setups but am planing in the future to not use one. that being said i set the charge pump to on in the smooth stepper config i believe if you cant find it i will post more but it is not in front of me right now. do you have a way to check if the output is on for the charge pump if you are using the beta plug in you can check in diag but you cant be in estop it will hang your computer anyway i am using the most recent version of the plug in might be beta but it has allot more function then the one before it
mark

133
Mach4 General Discussion / Re: script and mach 4
« on: June 12, 2016, 06:01:20 PM »
hello
i have been doing research and starting to program so correct me if i am wrong i started with screenset wx4 opened screen load script looks like this
---------------------------------------------------------------
-- Signal Library
---------------------------------------------------------------
SigLib = {
[mc.OSIG_MACHINE_ENABLED] = function (state)
    machEnabled = state;
    scr.SetProperty('btnRefAll', 'Enabled', tostring(state));
    scr.SetProperty('btnRefAll2', 'Enabled', tostring(state));
    scr.SetProperty('btnGotoZero', 'Enabled', tostring(state));
    scr.SetProperty('tabJogging', 'Enabled', tostring(state));
    if (state == 1) then
        AxisEnable();
    end
end,
[mc.ISIG_INPUT0] = function (state)
   
end,
[mc.ISIG_INPUT1] = function (state)
   -- if (state == 1) then   
--        CycleStart()
--    --else
--        --mc.mcCntlFeedHold (0)
--    end

end,

i am modifying it to look like this

---------------------------------------------------------------
-- Signal Library
---------------------------------------------------------------
SigLib = {
[mc.OSIG_MACHINE_ENABLED] = function (state)
    machEnabled = state;
    scr.SetProperty('btnRefAll', 'Enabled', tostring(state));
    scr.SetProperty('btnRefAll2', 'Enabled', tostring(state));
    scr.SetProperty('btnGotoZero', 'Enabled', tostring(state));
    scr.SetProperty('tabJogging', 'Enabled', tostring(state));
    if (state == 1) then
        AxisEnable();
    end
end,
[mc.ISIG_INPUT0] = function (state)
    if (state == 1) then
          FeedHold()
end,
[mc.ISIG_INPUT1] = function (state)
   if (state == 1) then   
        CycleStart()
    else
        mc.mcCntlFeedHold (0) -- i dont know if i need this
   end

end,

so why do we goto feed hold if cycle start is zero or off wouldnt the machine be in feed hold automatically the real question is after this machine i have one with a big controll pannel lots of switches so do i need to end an input with feed hold like under cycle start.
this takes care of regular cycle start. now onto mdi cycle start  Chaoticone wrote this scr.ExecMdi('mdi1') is this stand alone or does it need more where do i put it thank you
mark

134
Mach4 General Discussion / Re: script and mach 4
« on: June 09, 2016, 05:21:16 PM »
thank you for your replies i will program and post the final. i dont know the difference in the mach screen sets i used mxmach and created a new screen set from that. the reason i used that screen set is i am using an ethernet smooth stepper and i cant find it right now but i remember reading use that screen set as the other one has some kind of problem with the ess i will have to look for that. as far as only run gcode files but not in mdi correct me if i am wrong but in mdi you program a line and hit enter and the line is run so you dont really need a cycle start in mdi you only need it to run gcode. also i will check out the forum at pmdx
mark

135
Mach4 General Discussion / script and mach 4
« on: June 07, 2016, 09:02:22 PM »
i am a machine up-grader and i have a lathe and mill i am making mach 4 the first post will be about the mill. i have an Ethernet smooth stepper i have been setting up limits and motors this has been going well except last night i did something and the ess stopped talking to mach 4 i still don't know what i did but it is working again. question is there a work around for user account control or do i just turn it off. 2 i am starting with two external buttons cycle start and feed hold. so far i go into edit screen then wxmach click on the lightning bolt the scripts come up i have looked them over and determined i haven't the foggiest idea where to start IE should the added button script be in plc script or signal script please point me in the right direction or to where i can find an example i know something about vb not much lua structure is going to be a learning experience thank you for your help
mark

136
VB and the development of wizards / Re: atc for okuma and howa
« on: February 21, 2016, 09:34:30 PM »
hi i have been modifying the tool changer macro and think i have it right can somebody proof read it for me and see if i have made any errors thank you
    '------------------------------------------------------------------------------
' CS-Lab s.c. - Auto toolchanger for lathe (rotary type of ATC)
' (C) 2011
' v1.2 - 2011-11-05
'------------------------------------------------------------------------------

'------------------------------------------------------------------------------
' CONFIG
'------------------------------------------------------------------------------
Const OpenSensDelay      = 800   ' Time Delay [ms] after ATC unlock
Const TimeLock         = 1000    ' ATC locking time delay
Const TOOLCOUNT         = 12    ' max Tool #

' Actual ATC position inputs (CSMIO-IP/A-IO-0 inputs)
Const InT1 = 2
Const InT2 = 3
Const InT3 = 4
Const InT4 = 5
Const InT5 = 6
Const InT6 = 7
Const InT7 = 8
Const InT8 = 9
Const InT9 = 10
Const InT10 = 11
Const InT11 = 12
Const InT12 = 13

' ATC sensors inputs
Const InCloseSensor      = 0    ' turret locked or unlocked
Const InDex            = 1      ' hydraulic motor index switch
rem Const InCloseSensor      = 25   ' ATC locked - safe

' digital outputs for ATC control (CSMIO outputs)
Const Out            = 0   'unlock turret
Const RotateLeft         = 13   'rotate left
Const RotateRight         = 14   'rotate right
rem Const OutRun         = 4      ' unlock and rotate
rem Const OutLock         = 5      ' stop rotation and lock at current position
rem i think i did this area right

'------------------------------------------------------------------------------
' program variables - don't modify
'------------------------------------------------------------------------------
Dim ToolNew, ToolOld, ToolSlot As Integer
Dim ToolRdy As Boolean
Dim ATC_CloseRetry
Dim InToolSens(TOOLCOUNT)
rem this i left alone
'------------------------------------------------------------------------------
  ' MACRO START
'------------------------------------------------------------------------------
G53 X.5 Z.5 'move to safe tool change coordinates
   If(GetOEMLed(800)) Then
      Message("The System Is In ESTOP - Toolchange Interrupted")
      Sleep(150)
      WaitForMove
      End
   End If

     SetUserLED(1001, 1) ' User LED - toolchange in progress
     
     InToolSens(0) = InT1
     InToolSens(1) = InT2
     InToolSens(2) = InT3
     InToolSens(3) = InT4
     InToolSens(4) = InT5
     InToolSens(5) = InT6
     InToolSens(6) = InT7
     InToolSens(7) = InT8
     InToolSens(8) = InT9
     InToolSens(9) = InT10
     InToolSens(10) = InT11
     InToolSens(11) = InT12

   ' Get actual tool # and new tool #
   ToolOld = GetCurrentTool()
   ToolNew = GetSelectedTool()
   
   If(ToolNew >=12) Then
      ToolSlot = ToolNew
      Else "Out of Range"
   End If
   
   ' The same position - no need to move
   If (ToolSlot = ToolOld) Then
      SetCurrentTool( ToolNew )
      Message("ATC is on position "& ToolSlot & " and new tool is " & ToolNew)
      WaitForMove
      SetUserLED(1001, 0)
      End
   End If
   ' left alone
   If (ToolSlot > TOOLCOUNT) Then
      SetCurrentTool( ToolOld )
      SetUserLED(1001, 0)
      DoOEMButton(1003)   'stop
      DoOEMButton(1002)   'gcode rewind
      Sleep(150)
      Message("There is no tool T" & ToolNew & " in ATC")
      Sleep(150)
      End
   End If
   ' left alone
   
   ' T0 is a fake tool, no need to change
   If (ToolSlot = 0) Then
      ToolNew = 0
      SetCurrentTool( ToolNew )
      Message("Load a Tool Number: " & ToolNew)
      WaitForMove
      SetUserLED(1001, 0)
      End
   End If
   
   ' unlock and rotate ATC lost here
   RunATC
   Sleep( OpenSensDelay )
   ' check ATC close sensor set to 0
   If (GetCsmioIn(InCloseSensor)) Then
      LockATC
      SetCurrentTool( 0 )
      SetUserLED(1001, 0)
      DoOEMButton(1021)   'reset
      DoOEMButton(1002)   'gcode rewind
      Sleep(150)
      Message("ATC Locked - Toolchange Failed.")
      Sleep(150)
      End
   End If
   
   ' wait to ATC will be on the desired position also lost here
   ToolRdy = false
   While(Not ToolRdy)
      If(GetCsmioIn((InToolSens(ToolSlot - 1)))) and (GetCsmioIn(InDex)) Then
         ToolRdy = true
      End If
   Wend
   
   
   ' stop rotation and lock ATC lost here
   LockATC
   ATC_CloseRetry = 0
   ' Check lock sensor, retry lock if needed
   While(Not GetCsmioIn(InCloseSensor) And ATC_CloseRetry < 4)
      LockATC
      ATC_CloseRetry = ATC_CloseRetry + 1
   Wend
   
   ' double check for succesful ATC lock
   If (Not GetCsmioIn(InCloseSensor)) Then
         SetCurrentTool( 0 )
      SetUserLED(1001, 0)
      DoOEMButton(1021)   'reset
      DoOEMButton(1002)   'gcode rewind
      Sleep(150)
      Message("ATC Lock Alert. Check ATC.")
      Sleep(150)
      End
   End If
 
   SetCurrentTool( ToolNew )
   Message("Succesful Loaded Tool T" & ToolNew)
   Sleep(150)
   WaitForMove
   SetUserLED(1001, 0)
   End
' -----------------------------------------------------------------------------
Public Function GetCsmioIn (n As Integer) As Boolean
   Dim reg As Integer
   
   If(n < 14) Then 'inputs modbus
      reg = 100
   
   End If
   
   If(GetInBit(reg, n)) Then
      GetCsmioIn = true
   Else
      GetCsmioIn = false
   End If
   Exit Function
End Function
' i think i understand this and it doesent need to be adjusted anymore
' -----------------------------------------------------------------------------
Sub RunATC ()
   Call SetCsmioOut(Out, true) 'unlock the turret orriginal outrun
   Sleep(150)
   Call SetCsmioOut(rotateleft, true) 'rotate left original outlock
   Sleep(150)
End Sub
' -----------------------------------------------------------------------------
Sub LockATC ()
   Call SetCsmioOut(rotateleft, false) 'stop rotation
   Sleep(150)
   rem Call SetCsmioOut(OutLock, true)
   Sleep(TimeLock)
   Call SetCsmioOut(Out, false) 'lock the turret
   Sleep(150)
End Sub
' -----------------------------------------------------------------------------
Public Sub SetCsmioOut (ByVal n As Integer, ByVal state As Boolean)
   If(state) Then
      SetOutBit(90, n)
   Else
      ResetOutBit(90, n)
   End If
End Sub
' -----------------------------------------------------------------------------
Sub WaitForMove ()
   While IsMoving()
      Sleep(15)
   Wend
End Sub                                                     

137
VB and the development of wizards / atc for okuma and howa
« on: February 11, 2016, 01:20:38 PM »
this is a new post about the tool changer didnt want to get the two mixed up

i am setting up a tool changer for a turret lathe and i want to use the tool changer from cs-labs but am having problems figuring out the outputs i dont have it set up the way gthey do some of wich i could change some of wich not and my turret unlock sw is only closed or open not two switches if that isnt bad enough the tool changer is 12 position i will add what i have done so far and add notes and will add my inputs and outputs i am sure that sombody who has a better grasp on the inputs/outputs will have an easy time with this thank you for your help
mark cook
marks machine repair llc

'------------------------------------------------------------------------------
' CS-Lab s.c. - Auto toolchanger for lathe (rotary type of ATC)
' (C) 2011
' v1.2 - 2011-11-05
'------------------------------------------------------------------------------

'------------------------------------------------------------------------------
' CONFIG
'------------------------------------------------------------------------------
Const OpenSensDelay        = 800    ' Time Delay [ms] after ATC unlock
Const TimeLock            = 1000     ' ATC locking time delay
Const TOOLCOUNT            = 12     ' max Tool #

' Actual ATC position inputs (CSMIO-IP/A-IO-0 inputs)
Const InT1 = 2
Const InT2 = 3
Const InT3 = 4                                                                             these inputs were for the csmio/ip-a i need them to be for the csmio-io
Const InT4 = 5                                                                             100,2 ect i think i did it right see below
Const InT5 = 6
Const InT6 = 7
Const InT7 = 8
Const InT8 = 9
Const InT9 = 10
Const InT10 = 11
Const InT11 = 12
Const InT12 = 13

' ATC sensors inputs
rem Const InOpenSensor        = 0>0     ' ATC unlocked (rotating)          I dont know what to do with this my switch input is 100,1 modbus
rem Const InCloseSensor        = 0>1    ' ATC locked - safe                  this orriginally had two different outputs i only have one

' digital outputs for ATC control (CSMIO outputs)
rem Const OutRun            = 4        ' unlock and rotate                                               again dont know how to define this signal
rem Const OutLock            = 5        ' stop rotation and lock at current position            my outputs are index normal 90,13
                                                                                                                              index reverse 90,14 tool lift which is unlock 90,12
'------------------------------------------------------------------------------
' program variables - don't modify
'------------------------------------------------------------------------------
Dim ToolNew, ToolOld, ToolSlot As Integer
Dim ToolRdy As Boolean
Dim ATC_CloseRetry
Dim InToolSens(TOOLCOUNT)

'------------------------------------------------------------------------------
  ' MACRO START
'------------------------------------------------------------------------------
    If(GetOEMLed(800)) Then
        Message("The System Is In ESTOP - Toolchange Interrupted")
        Sleep(150)
        WaitForMove
        End
    End If

      SetUserLED(1001, 1) ' User LED - toolchange in progress
     
      InToolSens(0) = InT1
      InToolSens(1) = InT2
      InToolSens(2) = InT3
      InToolSens(3) = InT4
      InToolSens(4) = InT5
      InToolSens(5) = InT6
      InToolSens(6) = InT7
      InToolSens(7) = InT8
      InToolSens(8) = InT9                                    i changed this to 12 from 8
      InToolSens(9) = InT10
      InToolSens(10) = InT11
      InToolSens(11) = InT12
    ' Get actual tool # and new tool #
    ToolOld = GetCurrentTool()
    ToolNew = GetSelectedTool()

    ' little trick for double slots ATC
    If(ToolNew >= 12) Then
        ToolSlot = ToolNew - 12                             double slots i dont think i need and i dont understand at all
    Else
        ToolSlot = ToolNew
    End If
   
    If(ToolOld >= 12) Then
        ToolOld = ToolOld - 12
    End If
   
    ' The same position - no need to move
    If (ToolSlot = ToolOld) Then
        SetCurrentTool( ToolNew )
        Message("ATC is on position "& ToolSlot & " and new tool is " & ToolNew)
        WaitForMove
        SetUserLED(1001, 0)
        End
    End If
   
    If (ToolSlot > TOOLCOUNT) Then
        SetCurrentTool( ToolOld )
        SetUserLED(1001, 0)
        DoOEMButton(1003)
        DoOEMButton(1002)
        Sleep(150)
        Message("There is no tool T" & ToolNew & " in ATC")
        Sleep(150)
        End
    End If
   
   
    ' T0 is a fake tool, no need to change
    If (ToolSlot = 0) Then
        ToolNew = 0
        SetCurrentTool( ToolNew )
        Message("Load a Tool Number: " & ToolNew)
        WaitForMove
        SetUserLED(1001, 0)
        End
    End If
   

    ' unlock and rotate ATC
    RunATC
    Sleep( OpenSensDelay )
    ' check ATC open sensor set to 0
    If (Not GetCsmioIn(100,0)) Then
        LockATC
        SetCurrentTool( 0 )
        SetUserLED(1001, 0)
        DoOEMButton(1021)
        DoOEMButton(1002)
        Sleep(150)
        Message("ATC Locked - Toolchange Failed.")
        Sleep(150)
        End
    End If
   
    ' wait to ATC will be on the desired position
    ToolRdy = false
    While(Not ToolRdy)
        If(GetCsmioIn((InToolSens(ToolSlot - 1)))) Then
            ToolRdy = true
        End If
    Wend
   
   
    ' stop rotation and lock ATC
    LockATC
    ATC_CloseRetry = 0
    ' Check lock sensor, retry lock if needed
    While(Not GetCsmioIn(100,1) And ATC_CloseRetry < 4)
        LockATC
        ATC_CloseRetry = ATC_CloseRetry + 1
    Wend
   
    ' double check for succesful ATC lock
    If (Not GetCsmioIn(100,1)) Then                         changed this probably shouldnt have
        SetCurrentTool( 0 )
        SetUserLED(1001, 0)
        DoOEMButton(1021)
        DoOEMButton(1002)
        Sleep(150)
        Message("ATC Lock Alert. Check ATC.")
        Sleep(150)
        End
    End If
 
    SetCurrentTool( ToolNew )
    Message("Succesful Loaded Tool T" & ToolNew)
    Sleep(150)
    WaitForMove
    SetUserLED(1001, 0)
    End
' -----------------------------------------------------------------------------
Public Function GetCsmioIn (n As Integer) As Boolean
    Dim reg As Integer
   
    If(n < 15) Then
        reg = 100
    Else
        reg = 91
        n = n - 16
    End If
   
    If(GetInBit(reg, n)) Then
        GetCsmioIn = true
    Else
        GetCsmioIn = false
    End If
    Exit Function
End Function
' -----------------------------------------------------------------------------
Sub RunATC ()
    Call SetCsmioOut(OutLock, false)
    Sleep(150)
    Call SetCsmioOut(OutRun, true)
    Sleep(150)
End Sub
' -----------------------------------------------------------------------------
Sub LockATC ()
    Call SetCsmioOut(OutRun, false)
    Sleep(150)
    Call SetCsmioOut(OutLock, true)
    Sleep(TimeLock)
    Call SetCsmioOut(OutLock, false)
    Sleep(150)
End Sub
' -----------------------------------------------------------------------------
Public Sub SetCsmioOut (ByVal n As Integer, ByVal state As Boolean)
    If(state) Then
        SetOutBit(90, n)
    Else
        ResetOutBit(90, n)
    End If
End Sub
' -----------------------------------------------------------------------------
Sub WaitForMove ()
    While IsMoving()
        Sleep(15)
    Wend
End Sub

CSMIO/IP-A    12BR    SOL 8 TOOL LIFT    
   OUTPUT 12    TOOL LIFT PORT 10 PIN 12    90,12
CSMIO/IP-A    13BR    SOL 9 INDEX NORMAL    
   OUTPUT 13    INDEX NORMAL PORT 10 PIN 13    90,13
CSMIO/IP-A    14BR    SOL 10 INDEX REVERSE    
   OUTPUT 14    INDEX REVERSE PORT 10 PIN 14    90,14
USER LED    1010    TOOL POSITION 1    MOD100 D2    INPUT    LS11    MODBUS
USER LED    1011    TOOL POSITION 2    MOD100 D3    INPUT    LS12    MODBUS
USER LED    1012    TOOL POSITION 3    MOD100 D4    INPUT    LS13    MODBUS
USER LED    1013    TOOL POSITION 4    MOD100 D5    INPUT    LS14    MODBUS
USER LED    1014    TOOL POSITION 5    MOD100 D6    INPUT    LS15    MODBUS
USER LED    1015    TOOL POSITION 6    MOD100 D7    INPUT    LS16    MODBUS
USER LED    1016    TOOL POSITION 7    MOD100 D8    INPUT    LS17    MODBUS
USER LED    1017    TOOL POSITION 8    MOD100 D9    INPUT    LS18    MODBUS
USER LED    1018    TOOL POSITION 9    MOD100 D10    INPUT    LS19    MODBUS
USER LED    1019    TOOL POSITION 10    MOD100 D11    INPUT    LS20    MODBUS
USER LED    1020    TOOL POSITION 11    MOD100 D12    INPUT    LS21    MODBUS
USER LED    1021    TOOL POSITION 12    MOD100 D13    INPUT    LS22    MODBUS
USER LED    1022    TURRET INDEX    MOD100 D1    INPUT    LS9    MODBUS
USER LED    1023    TURRET UNLOCK    MOD100 D0    INPUT    LS10    MODBUS
USER LED    1024    TURRET LOCK    MOD100 D0    INPUT    LS10    MODBUS
   
thank you

138
VB and the development of wizards / Re: M23 transmission speed change
« 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

139
VB and the development of wizards / Re: M23 transmission speed change
« 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

140
VB and the development of wizards / 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

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 »