Author Topic: Help with MACRO I will compensate you for your time.  (Read 2400 times)

0 Members and 1 Guest are viewing this topic.

Offline uniquerc

  • Active Member
  • Posts: 8
    • View Profile
Help with MACRO I will compensate you for your time.
« on: November 02, 2015, 05:35:30 PM »
Hello all my name is Anna.  I would like someone with experience in VB to write a MACH 3 MACRO for me.   
I need my machine to perform the following  sequence on tool change.

step1 Z AXIS  HOME

step2 Z AXIS DOWN 100MM

step3 ACTIVATE OUTPUT 3(PNEUMATIC PISTON PUSHING TOOL CHANGER CAROUSEL)

step4 WAIT 1.5SECOND

step5 ACTIVATE OUTPUT 4(DRAW CLAMP RELEASE)

step6 Z AXIS HOME

step7 SELECT DIFFERENT TOOL (AXIS A) 8 TOOL CHANGER

step8 Z AXIS DOWN 100MM

step9 DEACTIVATE OUTPUT 4(LOCK CLAMP)

step10 DEACTIVATE OUTPUT 3(PNEUMATIC PISTON RELEAVED  CAROUSEL HOME)

END OF TOOL CHANGE.

if anyone is willing to help or charge for the service please contact me.

Best regards to all
Anna

« Last Edit: November 02, 2015, 05:50:05 PM by uniquerc »

Offline BR549

  • Mach4 Alpha
  • Posts: 6,855
    • View Profile
Re: Help with MACRO I will compensate you for your time.
« Reply #1 on: November 03, 2015, 05:19:57 PM »
(;-) There is normally a LOT more to a tool changer than you have listed. For instance are there any safety switches to deal with  and HOW do you create the motions and monitor  the carousel positions ??

What you have is the easy part.

(;-) TP

Offline uniquerc

  • Active Member
  • Posts: 8
    • View Profile
Re: Help with MACRO I will compensate you for your time.
« Reply #2 on: November 03, 2015, 05:54:02 PM »
 :D
thank you for your reply.   

I am trying to do something like what is on this video . 
https://www.youtube.com/watch?v=nev98v3PyXk

the carousel magazine would be actuated into position with a pneumatic piston (relay) , and the carousel tool tray would be revolved with a closed loop stepper.

where would you recommend the switches to be placed?   I have 2 parallel ports available just in case I need more inputs.

Offline uniquerc

  • Active Member
  • Posts: 8
    • View Profile
Re: Help with MACRO I will compensate you for your time.
« Reply #3 on: November 03, 2015, 06:06:39 PM »
I am getting a syntax error can you perhaps help me with this ?  


'Macro M6Start
Message""

If GetOEMLed(807) And GetOemLED(80 And GetOemLed(809) And GetOemled(811) Then
MsgBox" 1 or more axis are NOT REFERENCED cancel program and REF XYZB axis"
End
End If



Dim OldTool As Single
Dim NewTool As Single
Dim X As Double
Dim Y As Double
Dim Z As Double
'********************************
OldTool = GetCurrentTool()
NewTool = GetSelectedTool()

If NewTool = OldTool Then
MsgBox" Same Tool, NO ACTION"
End
End If


If NewTool > 10 Or NewTool < 1 Then
MsgBox" Tool # 1-10 ONLY "
End
End If


Code "M09" 'Coolant Off



Code "M05" 'Stop Spindle
Message" Coolant And Spindle Turned Off"




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

Code"G53 G0 X0,Y0,Z0"
While IsMoving()
Wend


ActivateSignal(Output1) 'Tool Turret In'




ActivateSignal(Output2) 'Release Tool'
Sleep 500

Code "G53 G1 Z40 F650 "

Call MovePos(NewTool) 'The ATC moves to the new tool.
While IsMoving()
Wend

Code "G53 G1 Z0 F650"
GetOEMDro (85)




DeactivateSignal (OutPut2) 'Clamp Tool'
Sleep 1000



DeactivateSignal (OutPut1) 'Tool Turret Away'
Sleep 1500


Do
DeactivateSignal(OutPut7)
Sleep 1000
Loop


GetCurrentTool

GetOEMDro (85,40)

Sub MovePos(ByVal ToolNumber As Integer)

Select Case ToolNumber 'Positions to each tool in B-axis


Case = 1
Code " G53 G0 A 360"
Case = 2
Code " G53 G0 A 36"
Case = 3
Code " G53 G0 A 72"
Case = 4
Code " G53 G0 A 108"
Case = 5
Code " G53 G0 A 144"
Case = 6
Code " G53 G0 A 180"
Case = 7
Code " G53 G0 A 216"
Case = 8
Code " G53 G0 A 252"
Case = 9
Code " G53 G0 A 288"
Case = 10
Code " G53 G0 A 324"
End Select

End Sub

Offline BR549

  • Mach4 Alpha
  • Posts: 6,855
    • View Profile
Re: Help with MACRO I will compensate you for your time.
« Reply #4 on: November 03, 2015, 06:37:54 PM »
4th line down this  "  GetOemLED(80  "  Is an incomplete statement  probably should be   GetOemLED(808)  ???

Switches are used to verify that the motions of the tool changer have completed and everything is where it is supposed to be at that time. For example when teh ATC extends there would be a switch to verify it got to the end of stroke . IF the switch is active THEN the routine can continue if NOT then it times out and stops before damage to the machine or part occurs

(;-) TP

Offline uniquerc

  • Active Member
  • Posts: 8
    • View Profile
Re: Help with MACRO I will compensate you for your time.
« Reply #5 on: November 03, 2015, 06:54:10 PM »
 ;)

you are correct!!!!!!
 error corrected. 

 I am new to this ATC stuff and trying to learn.

which components would you recommend to achieve  my goal. 
may I ask if you can provide the service and parts or do you know a company that can?

Best regards
Anna

Offline BluePinnacle

  • Active Member
  • Posts: 304
    • View Profile
Re: Help with MACRO I will compensate you for your time.
« Reply #6 on: November 05, 2015, 02:22:00 PM »
The parts will be easy, it'd just be microswitches or inductive proximity sensors or whatever suits from RS or Farnell or any of the others. The code will be the important part. You could use relay logic for some of it depending on construction, it's a good robust crash proof way of handling things. Got pictures of the ATC?

Offline BR549

  • Mach4 Alpha
  • Posts: 6,855
    • View Profile
Re: Help with MACRO I will compensate you for your time.
« Reply #7 on: November 05, 2015, 03:13:13 PM »
IF you can make it work mechanically we can help on the macro.

Offline uniquerc

  • Active Member
  • Posts: 8
    • View Profile
Re: Help with MACRO I will compensate you for your time.
« Reply #8 on: November 11, 2015, 07:58:53 AM »
great thank you very much.  I will post in a month or 2 once I am done with all the mechanical components.