Hello Guest it is June 20, 2021, 09:53: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.


Topics - Cncman2nv

Pages: 1 2 3 4 »
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 / 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


3
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 

4
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

5
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

                              

6
VB and the development of wizards / Param1 Function
« on: July 22, 2015, 11:34:06 PM »
Hi Mach users,
I'm having troubles under standing how the Param1 -3 work, and how the VB/CB Script layout should be to make it function properly   
Here's what I'm tiring to accomplish I have a macro named M143.m1s and I want to return a P value for a second spindle RPM  sent to  OemDRO 2005

Macro Name in is M143.m1s the code I use in the MDI line is M143 P1500, and a 0 is returned

Dim Paarm1 As Double
Dim S2RPM As Double
 
S2RPM = Param1()   

SetOemDRO(2005,S2RPM)

End   


Thanks Adam

7
Mach4 General Discussion / Mach 4 Turn
« on: December 05, 2014, 12:09:47 AM »
Can anyone tell me if the new release of Mach4 includes Mach4 turn 


thanks Adam

8
Galil / Galil And Lathe
« on: March 08, 2014, 11:47:08 PM »
I have a Lathe project and I was wondering how well Galil would work for a lathe motion controller


thanks Adam

9
Hello,
I am having trouble getting a LED that I have Added to the MSM User Extense Page. What I am trying to accomplish is for the M10/M11 Call  will change the state of the LED
M10 LED ON M11 LED OFF so that I can Make a Brain to communicate with a plc that will operate a pneumatic solenoid.
Steps I have Taken

Created a UserLed (2000) added to MSM User Exts Page

Modified the   M10.m1s

Dim FrontCloser As Integer
FrontCloser=(2000)
 
 SetUserLED(Frontcloser,1)

Modified the   M11.m1s

Dim FrontCloser As Integer
FrontCloser=(2000)
 
 SetUserLED(Frontcloser,0)
 
Thank You for your valuable help.

10
Modbus / Modbus vb functions and and automatic turret tool changer
« on: February 20, 2013, 08:29:04 AM »
I am wanting to know what modbus  vb function call to use inside the m6 macro to send to plc controlling the 4 position front tool turret

thanks

Pages: 1 2 3 4 »