Hello Guest it is April 19, 2019, 01:04:23 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 - vandal968

Pages: 1 2 »
1
Got it all figured out, thanks for the help.

Here's a video of the whole thing working:
http://www.youtube.com/watch?v=8xvxwUqdcWg

cheers,
c

2
Stirling,
I didn't know about the script editor, it helped a great deal, thank you.  I was making a couple of dumb mistakes.  I've got the changer operating properly and changing tools in both directions.  I've tried to add logic to deal with the initial tool not being set and skipping the change if the correct tool is already installed.  Those two parts are not working correctly.  I need to know the correct syntax to do an If/Then that exits from the Macro.  Here is what I've got, the first two chunks under Sub Main() do not work, the script editor doesn't complain, but if they're in there it doesn't work.  Without them everything works great, but those two conditions would blow up.  That "Exit Sub" seems to not be the way to do it, have also tried "End Sub" and "Exit".  What's the correct way to exit from a Macro when a condition is met?

cheers,
c

'*************************************
'M6Start.m1a  v.1 by Corey Renner

'Variables:

CurrentTool=GetCurrentTool()
NewTool=GetSelectedTool()

'*************************************

Sub Main()
 
'This stuff is wrong**************
If CurrentTool=0 Then 'Exit with error ATC not homed
MsgBox ("ERROR: ATC Not Homed")
Beep
Code "M00"
Exit Sub 'This Line is a problem, what should be here to exit the Macro?***************
End If
  
If CurrentTool=NewTool Then 'Exit if correct tool is already loaded
MsgBox ("No Toolchange Required")
Exit Sub  'This Line is a problem, what should be here to exit the Macro?***************
End If  
'Up to here.  Everything below is fine.*************      

ActivateSignal(Output12) 'Deploy Changer Cylinder
  While Not IsActive(OEMTRIG3) 'Changer Deployed Switch
  sleep(100)
  Wend
  
ActivateSignal(Output13) 'Slide In Cylinder
While Not IsActive(OEMTRIG5) 'Slide In Switch
  sleep(100)
  Wend
  
ActivateSignal(Output14) 'Drawbar Release and Proprod
While Not IsActive(OEMTRIG6) 'Drawbar Released
  sleep(100)
  Wend
  
ActivateSignal(Output15) 'Toolout Cylinder
While Not IsActive(OEMTRIG8) 'Tool out from Spindle
  sleep(100)
  Wend
  
'************************************************
'carousel rotation stuff
FwdIndex=CurrentTool
FwdStep=0
While FwdIndex<>NewTool
 FwdStep=FwdStep+1
 FwdIndex=FwdIndex+1
 If FwdIndex>12 Then
 FwdIndex=1
 End If
 
Wend

RevStep=12-FwdStep

If FwdStep<=6 Then
CarouselFWD (FwdStep)
Else
CarouselREV (RevStep)
End If

'************************************************

DeActivateSignal(Output15) 'Tool back into spindle
'ActivateSignal(Output16) 'Airblast on
While Not IsActive(OEMTRIG7) 'Tool back in spindle
  sleep(100)
  Wend
  
'DeActivateSignal(Output16) 'Airblast off
DeActivateSignal(Output14) 'Drawbar Grabs
While Not IsActive(OEMTRIG6) 'Drawbar has grabbed
  sleep(100)
  Wend
  
DeActivateSignal(Output13) 'Slide Out
While Not IsActive(OEMTRIG4) 'Slide is Out
  sleep(100)
  Wend
  
DeActivateSignal(Output12) 'ATC Retract
While Not IsActive(OEMTRIG2) 'ATC Retracted
  sleep(100)
  Wend
  
DoButton(24)'Home Z-axis to release prop-rod and correct error

SetCurrentTool (NewTool)
End Sub
 
'///Functions///

Function CarouselFWD(ByVal FwdStep As Integer) As Integer
ActivateSignal(Output17) 'Start Motor in FWD Direction
For X=1 To FwdStep
  While IsActive(OEMTRIG9)
  sleep(100)
  Wend
  While Not IsActive(OEMTRIG9)
  sleep(100)
  Wend
Next X
DeActivateSignal(Output17)
End Function

Function CarouselREV(ByVal RevStep As Integer) As Integer
ActivateSignal(Output18) 'Start Motor in REV Direction
For X=1 to RevStep
  While IsActive(OEMTRIG9)
  sleep(100)
  Wend
  While Not IsActive(OEMTRIG9)
  sleep(100)
  Wend
Next X
DeActivateSignal(Output18)
End Function
            

3
VB and the development of wizards / ATC built, need some macro help
« on: June 21, 2013, 12:32:12 AM »
I've finished building an ATC for my Denford Easimill 3, there are some pictures and info here:
http://coreyrenner.tumblr.com/

The macro is where I'm struggling.  I was hoping that I could use some of the macro commands in the MDI window to make it go, I discovered that you can't.  So, I made a quick fake macro that is intended to just run the changer through all of its movements, but it doesn't seem to do anything.  I replaced the M6start.m1a file with the stuff below.  I typed M6T1 into the MDI window and hit enter.  I was hoping that it would cycle itself.  Instead, I got the "Change tool and press cycle start" message.  Ok, need to tell Mach it's got an ATC, so in the general config, I changed it from "Stop Spindle and prompt for toolchange" to ATC.  Tried again, same message.  Just in-case I made a program like this:

N10 M6T1

and ran that.  Nada.  What am I missing?  Here's my crappo macro, the in/out pins are programmed correctly.  I'd appreciate any guidance.


ActivateSignal(Output12) 'Deploy Changer Cylinder
  While Not IsActive(OEMTRIG3) 'Changer Deployed Switch
  sleep(100)
  Wend
ActivateSignal(Output13) 'Slide In Cylinder
While Not IsActive(OEMTRIG5) 'Slide In Switch
  sleep(100)
  Wend
ActivateSignal(Output14) 'Drawbar Release and Proprod
While Not IsActive(OEMTRIG6) 'Drawbar Released
  sleep(100)
  Wend
ActivateSignal(Output15) 'Toolout Cylinder
While Not IsActive(OEMTRIG8) 'Tool out from Spindle
  sleep(100)
  Wend
'************************************************
'carousel rotation stuff goes here
sleep(5000)
'************************************************
DeActivateSignal(Output15) 'Tool back into spindle
While Not IsActive(OEMTRIG7) 'Tool back in spindle
  sleep(100)
  Wend
DeActivateSignal(Output14) 'Drawbar Grabs
While Not IsActive(OEMTRIG6) 'Drawbar has grabbed
  sleep(100)
  Wend
DeActivateSignal(Output13) 'Slide Out
While Not IsActive(OEMTRIG4) 'Slide is Out
  sleep(100)
  Wend
DeActivateSignal(Output12) 'ATC Retract
While Not IsActive(OEMTRIG2) 'ATC Retracted
  sleep(100)
  Wend

'///Subroutines///
'Sub ATCready
 'If IsActive(OEMTRIG2) And IsActive(OEMTRIG4) And Not IsActive(OEMTRIG6) And IsActive(OEMTRIG7) And IsActive(OEMTRIG9) Then
'End Sub
'MsgBox ("ATC NOT

4
VB and the development of wizards / Re: Macro to rehome Z?
« on: June 06, 2013, 05:05:25 PM »
Aha!  Thanks ger21.

I found more info on syntax here:
http://www.machsupport.com/forum/index.php?topic=19565.0

cheers,
c

5
VB and the development of wizards / Macro to rehome Z?
« on: June 06, 2013, 02:59:21 PM »
I've been building an automatic toolchanger for my mill.  Mechanically, it's now finished, I just need to add some sensors (waiting for UPS) and program it under Mach.  One issue is that my Z-axis shifts slightly as the power drawbar fires.  Since the toolchange happens right next to the home switch for the Z-axis, my plan is to rehome Z as the final step in the toolchange macro.  Can anyone tell me the actual lines of code needed to do this?

Here's info about conversion, there is a video of the ATC operating under manual-control part way down the page.

http://coreyrenner.tumblr.com/

Thanks for the help.

cheers,
c

6
SmoothStepper USB / Re: Smooth Stepper: Versions? Where to buy?
« on: March 08, 2011, 05:32:57 PM »
Thanks for the help guys.  I also emailed Warp9 to find out their shipping cost, heard back today.

Three days later.

Kind of confirms my initial impression that this is a great product with poor factory support.  In any event, I was impressed enough with the responsiveness of Homann & Soigeneris that I'm going to take a chance anyway.

Peter, I've heard nothing but rave reviews of your service, but you're kind of distant from me (AZ, USA) so I'm going to see how well Jeff does.

Thanks again for the help, it's appreciated.

cheers,
c

7
SmoothStepper USB / Smooth Stepper: Versions? Where to buy?
« on: March 04, 2011, 03:58:30 PM »
I've been curious about the Smooth Stepper for a while now.  I'm thinking about getting one.  I notice that it's sold by:

Warp9td.com (r1.2) $155
cnc4pc.com (ss1) $165
homanndesigns.com (ss-01) $165

Are all three places selling the same version of the same board, or are there differences?  What's the best place to get one?

thanks,
v

8
General Mach Discussion / Re: Wiring of 2 wire proximity switch
« on: June 01, 2010, 05:50:24 PM »
Sweep,
I don't know if this is related or not, but....  See that blue component above and to the right of the transistors in the picture I posted?  When I first hooked up this circuit, that thing got hot, real hot, singed the pc board hot.  A friend of mine who's an EE took a look and said that he didn't see a need for that component, so I snipped it off and problem solved.  I don't know if that component was related to what you're talking about, but I thought I'd mention it.

cheers,
c

9
I just finished looking at all the various M6 macros on my machine.  I thought that maybe the new version of Mach uses a different directory structure or something and my macro wasn't loading properly.  The directory structure is the same and my macro is where it belongs and has the same stuff in it that it had years ago (I have a duplicate archived on my main pc).  While looking at the default M6 macros, I noticed that they all included this line:

SetCurrentTool( tool )

Which my macro does not (and never did) have.  Based on the name, it seemed like it might update that "Tool Information" window, so I added it to the bottom of my macro.  So I now have this:

GotoSafeZ()
DoSpinStop()
tool = GetSelectedTool()
Code "G43H"&tool
Message( "Press Cycle Start to Continue" )
SetCurrentTool( tool )

I ran a program that I had laying around, and it DID update the "Tool Information" window this time.  So, I think that my problem is solved although I need to confirm that the tool offsets are still working properly.

So, the question becomes why did this always work properly in previous versions of Mach WITHOUT that line?  Keep in mind that the macro I was running that didn't have the line was written by Art, not me.  So, confidence is high that it was a good macro.  Was this just a bug in Mach that was recently corrected?  Very strange.

cheers,
c

10
I've been running Mach3 v 2_45 for a long time, two years or so.  Everything worked well, so I hadn't upgraded in a while.  I recently upgraded to 3_042.040

On the old version, a tool change would update the "Tool Information" box on the Program Run screen to reflect the current tool in-use.  Since the upgrade, the "Tool Information" box does not update after a tool change.  So, if for example it was showing Tool 0 when I started running a program it will always show Tool 0 regardless of which tool it is actually using.  Tool offsets are still applied correctly, I just can't look at the screen to see which tool is in-use.  What happened?  How can I fix this?

I am running the same toolchange macro that I got from Art a long time ago that simply applies the offsets ( I do not have a working ATC yet.)  Here is the macro I run.

M6Start.m1s

GotoSafeZ()
DoSpinStop()
tool = GetSelectedTool()
Code "G43H"&tool
Message( "Press Cycle Start to Continue" )

Any guidance is appreciated.

thanks,
c

Pages: 1 2 »