Hello Guest it is April 18, 2024, 03:45:41 AM

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 - Cncman2nv

Pages: 1 2 3 4 5 6 7 8 9
1
VB and the development of wizards / 4 Way Lathe ATC Macro
« on: August 13, 2018, 03:44:47 PM »
I'm in the process of needing to make some changes to my M6ATC start macro. the changes that are needed are when the G-code program calls for a new tool my automatic tool changer once in a while skips the tool change (unknown why) then tool no longer matches the programmed tool. I need the macro to trigger the Mach3's reset button to keep the tool change from completing or the machine from continuing with the wrong tool.
Below are some of my attempted edits. It works but Mach's reset button is always triggered even when the tool changer changed tools correctly
the tool changer is controlled through a ADC click PLC using serial modbus and brains. I have created two dro's on a screen to compare the tool that the PLC/ATC is on and the tool that the G-code called

Here is a youtube video of the lathe with tool changer https://www.youtube.com/watch?v=xyirJ8cPgQo
I will post a screen shot of the tool change page later

**********I make no clime to have any knowledge about VB scripting or syntax so please accept my apologies before reading on.**********

Sub main()

Const maxtoolnum = 4

Dim newtoolNumber As Integer
Dim oldtoolNumber As Integer
Dim NewtoolDro As Integer
Dim TurretTool As Integer
Dim XTCpos As Double
Dim ZTCpos As Double
Dim BTCpos As Double
Dim Input4 As Integer

XTCpos = GetoemDRO (1817)
ZTCpos = GetOemDRO (1819)
BTCpos = GetOemDRO (2017)
newtoolnumber = (getselectedtool)
setOemdro(2000,newtoolnumber)
oldtoolNumber = getoemdro(824)
TurretTool = getoemdro(2001)



If newtoolNumber > maxtoolnum Then
MsgBox "Tool number Range is 1-4 Check tool number "

Exit Sub
main
End If
If newtoolNumber = TurretTool Then
Exit Sub
main
End If
Code "G53 G90 G40 G00 B" & BTCpos
Code "g53 g90 G40 G00 X" & XTCpos
Code "G53 G90 G40 G00 Z" & ZTCpos

While IsMoving()
Sleep 50
Wend
Sleep 5000



If newtoolNumber <> TurretTool Then
DoOEMButton( MachResetOEMBtn )

Exit Sub
Main


'MsgBox ("newtool = " & GetSelectedTool)
'MsgBox ("oldtool = " & oldtool )
'MsgBox ("dro 2000 = " & getoemdro (2000) )
'End If
End Sub
Main

2
Promote and discuss your product / Re: 5c Spindle Cartridge Pre Production
« on: December 25, 2015, 10:42:41 PM »
Very interesting Adam.
I purchased several of the Dunham units with their air operated closer for custom applications in the past.

I modified the overall length to better accommodate the specific job but other than that they worked very well.

I found very little to compete with them so yours would be much welcomed to consider as an alternative.

Would you offer customizable options for the overall length, spacing between the bearings and the rear tube configuration at or very near the same price ?


Quite interested.
Thanks,
Russ


 Russ, 
Thank for your interest and  yes, there is lot of room for flexibility in length there is a 4.740 bearing spacer used so that is the max length that can be deducted off the overall length.
 I'm pretty open to suggestions for the rear tube configurations I know if there is 1.375" diameter spindle bore just about any manual or pneumatic collect closer will fit.

Thanks Adam
   

3
Promote and discuss your product / 5c Spindle Cartridge Pre Production
« on: December 24, 2015, 11:58:00 PM »
I'm looking for market feedback to see if there any interest for a Cartridge style 5C Lathe spindle for any DIY Lathe projects or any project that requires 5c collects use. The suggested retail will be $799
specifications are
7009 Abec 7 Duplex bearings
Hardened and ground bearing seats
Front and rear Labyrinth seals
1.375 rear spindle bore for Collect closer tubes
5000 RPM
And any other customer preferred specifications


4
Thanks Chrisjh...  I couldn't have done it with out your great document on using the G52 Offsets so thank you! and Keep up the good work   


5
Modbus / Re: Macros Triggered after Part program is regenerated
« on: December 07, 2015, 09:04:18 PM »
Problem Solved There is a Tick Box under general config "Ignore M-code when loading"

6
Thanks Tweakie...  It Has been four years in the making lots of trial and error there is more work to be done but at least I'm at the 90% marker

7
VB and the development of wizards / Re: M6ATC Macro Help
« on: December 07, 2015, 08:55:31 PM »
How exactly is the PLC notify Mach3 ?  Is it activating Input3 ?? DO you see the LED activate on the diagnostic page ??  You will also need an escape plan for IF the loop gets stuck in an endless loop. I use a timed loop that will end at a specifc point to allow you to escape the loop and stop the program CLEANLY.

(;-) TP
Right now the PLC is communicating through modbus and Brains but there is no reason why I cant use a physical input. I'm using smooth stepper with the third port expiation card
so the IsActive(4) will wait for the the input signal 9 to go true then continue running the script.
   

8
Nearing Completion is a dual 5c spindle lathe. The main frame of the lathe was bought a cabin fever '09 from Ajax CNC in Pennsylvania. The rear spindle was created using a Allen Bradley servo motor and a 5C collect closer from grizzly tool you tube channel is cncadam




https://www.youtube.com/watch?v=xyirJ8cPgQo

thanks 

9
Modbus / Macros Triggered after Part program is regenerated
« on: December 06, 2015, 10:44:22 PM »
I'm having trouble finding a solution or a reason why a part program is regenerated in the G code window all the User macros get triggered or ran during the regen process. Ex. An M110 that runs a collect closer M143,M144,M145 that run the Rear spindle. I think it is a serial mod bus issue but not sure looking to see if any one else has had the same issue

10
VB and the development of wizards / M6ATC Macro Help
« on: November 18, 2015, 11:16:05 PM »
Here is the script for a tool change macro on a lathe with a rear mounted spindle "B axis"  and the actual ATC unit is controlled from a PLC communicating through modbus Serial plugin and brains logic.
The trouble I'm having is that Mach3 needs to wait for the PLC to send that the tool change is complete and the input/bit is true. I have seen where other people have used SystemWaitFor() but I don't know how to get the syntax right.
I was using G4 P4 but when the rapids were slowed down the tool changer would start before it was at the tool change location.





Sub main()        
              
        Const maxtoolnum = 4
     Dim newtoolNumber As Integer
     Dim oldtoolNumber As Integer
     Dim NewtoolDro As Integer
     Dim XTCpos As Double
   Dim ZTCpos As Double
     Dim BTCpos As Double
        Dim Input3 As Integer
  
     XTCpos = GetoemDRO (1817)
   ZTCpos = GetOemDRO (1819)
   BTCpos = GetOemDRO (2017)
   newtoolnumber = (getselectedtool)
   setOemdro(2000,newtoolnumber)
 
  
  
  If newtoolNumber > maxtoolnum Then
     MsgBox  "Tool number Range is 1-4 Check tool number "
    
     Exit Sub
     main
   End If     
       Code "G53 G90 G40 G00 B" & BTCpos
       Code "g53 g90 G40 G00 X" & XTCpos  
       Code "G53 G90 G40 G00 Z" & ZTCpos
      
      
       While ISmoving()
       Sleep 50
      
      
       Wend
      
      
      
      
      
      
        SystemWaitFor(input3)
      
      End Sub        
        
        
        
  'MsgBox ("newtool = " & GetSelectedTool)
 'MsgBox ("oldtool = " & oldtool )
  'MsgBox ("dro 2000 = " & getoemdro (2000) )
  
  
  Exit Sub

                              

Pages: 1 2 3 4 5 6 7 8 9