Hello Guest it is March 29, 2024, 04:18:53 AM

Author Topic: Machine setup help - urgent if possible :)  (Read 12351 times)

0 Members and 1 Guest are viewing this topic.

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Machine setup help - urgent if possible :)
« Reply #30 on: July 26, 2016, 06:07:45 AM »
OK, this works better in simulation on my laptop at least.

Code: [Select]
rpm = GetRPM() 'requested RPM
pulley = GetOEMDRO(56) 'current pulley

Select Case rpm
case 0 To 126
  If pulley <> 1 then
    DoOemButton (1001) 'feed-hold
    Call SetOEMDRO(56,1) 'set the new pulley
    if pulley = 2 then
      Msgbox "Change Speed Dial To 700rpm"
    else
      Code "M05"
      Msgbox "Change Back-Gear To Low Range And 700rpm"
    end if
  End If
Case 127 To 366
  If pulley <> 2 Then
    DoOemButton (1001) 'feed-hold
    Call SetOEMDRO(56,2)
    if pulley = 1 then
      Msgbox "Change Speed Dial To 2200rpm"
    else
      Code "M05"
      Msgbox "Change Back-Gear To Low Range And 2200rpm"
    end if
  End If
Case 367 To 1031
  If pulley <> 3 Then
    DoOemButton (1001) 'feed-hold
    Call SetOEMDRO(56,3)
    if pulley = 4 Then
      Msgbox "Change Speed Dial To 700rpm"
    else
      Code "M05"
      Msgbox "Change Back-Gear To High Range And 700rpm"
    end if
  End If
Case 1032 To 3000
  If pulley <> 4 Then
    DoOemButton (1001) 'feed-hold
    Call SetOEMDRO(56,4)
    if pulley = 3 Then
      Msgbox "Change Speed Dial To 2200rpm"
    else
      Code "M05"
      Msgbox "Change Back-Gear To High Range And 2200rpm"
    end if
  End If
Case 3001 To 99999
  DoOemButton (1003) 'stop
  Msgbox "Speed Requested Out Of Machine Range, Code Stopped"
End Select

SetSpinSpeed( rpm )

Now, is the msgbox function modal - does it suspend code until acknowledged as i would want to put an M03 after the message in some cases but this will only work if the message halts further code.

Also, something is upsetting the "Spindle Override" DRO for some reason - this makes a real mess of speeds as the code sets one speed but S/O changes it to something else !!

Any ideas of do i have to add a spindle override reset call as well??

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Machine setup help - urgent if possible :)
« Reply #31 on: July 26, 2016, 02:06:37 PM »
Mach wont run the G Code whilst a macro is running (excepting the macropump) so with a message box Mach will sit there waiting for the OK to be clicked.

Hood

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Machine setup help - urgent if possible :)
« Reply #32 on: July 26, 2016, 02:15:05 PM »
Ah, so i don't really need the feedhold lines?

How about the odd behaviour with the spindle override DRO ?  Something is upsetting it, its in this macro and does it in both the 2010 set plus the std 1024 set.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Machine setup help - urgent if possible :)
« Reply #33 on: July 26, 2016, 02:42:08 PM »
Dont see anything in the macro for spindle override so not sure what is going on.
Do you have an override pot on your panel/pendant?
How have you got the plugin options set for spindle override?
Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Machine setup help - urgent if possible :)
« Reply #34 on: July 26, 2016, 02:43:02 PM »
Oh and that is correct, no need for feedhold it just wanting it to wait until you ok the message box.
Hood

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Machine setup help - urgent if possible :)
« Reply #35 on: July 26, 2016, 02:46:55 PM »
Dont see anything in the macro for spindle override so not sure what is going on.
Do you have an override pot on your panel/pendant?
How have you got the plugin options set for spindle override?
Hood

At present this is on my laptop so no machine or controller at all, no pot etc.

Maybe that is the issue, will have to test it on the mill.

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Machine setup help - urgent if possible :)
« Reply #36 on: July 26, 2016, 02:48:28 PM »
Oh and that is correct, no need for feedhold it just wanting it to wait until you ok the message box.
Hood

I guess I will need to add in a [ Code "M03" ] line wherever I stopped the spindle else it will zoom off after ok'ing the message without the spindle running ?

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Machine setup help - urgent if possible :)
« Reply #37 on: July 26, 2016, 05:17:34 PM »
Yes, wouldn't do any favours to your cutters if you didn't :D


Hood

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Machine setup help - urgent if possible :)
« Reply #38 on: July 27, 2016, 03:03:50 PM »
Ok, played with the code tonight - it's really not that bad, simple, clear instruction and does what it needs.

The only bug seems to be that it messes up the spindle speed override for some reason - this would really mess things up so i need to get it sorted.

No idea where to start on this one though

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Machine setup help - urgent if possible :)
« Reply #39 on: July 27, 2016, 05:55:11 PM »
I am not sure why you get that problem as I don't see anything in the macro that could possibly do it. Could there be something in the M3 macro that is doing it or could you have a brain or macropump or something else looking at the I/O and messing with the Spindle Override?

Hood