Hello Guest it is April 18, 2024, 03:16:33 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 - BR549

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
161
General Mach Discussion / Plasma , new macro code
« on: June 20, 2010, 12:53:23 AM »
I loaded up a new macro program in the MACH TOOL BOX that allows the machine to travel the PART extents to see if the part can be cut from your material on the table.

Load you program, then move to a position that you think will do for the X0Y0 (origin). Then run the code. The macro will ASK you if your Z position is safe for travel. If yes then it will reset the XY axis to zero, retreive the xy minmax extents and then travel the far corners of those values.

IF not then it ends and asks you to correct the problem then restart.

If the part BOX will fit on your material then you are good to go.

Good for routers GREAT for plasma.

162
Enclosed is a macro to allow the operator to LOAD a part program then the machine will travel the part extents to allow the operator to SEE if the material is large enough to cut the profile. Good for Routing GREAT for plasma users.

Load Program, then move to a position on the material that looks good for the 0,0 origin. Then run the code. IT WILL ASK you if your Z is in postion to TRAVEL safely, if not it will advise you to correct and then it ends. Correct the z height then restart.
The macro will reset the XY axis to zero, then REGEN the toolpath to correct the extents, retreive the extents values, go to the extents of each corner and wait 3 secs then go to the next, it will end back up at the first corner then move back to 0,0.
IF the spindle/Torch centerline stays on the material then you are good to go AND ready to start the cut.

****************************************************************************8

'Macro To AUTOEXTENTS
Sub main()
 FR = 30      'Sets FeedRate
 DT = 3         'Sets Dwell Time
 Msg="Is Your Z HEIGHT Safe To Travel?"
SetVar(120,FR)
SetVar(121,DT)
Response = MsgBox(Msg, 4 )
If Response = 7 Then
GoTo N3:
Else
GoTo N2:
End If
N2:
DoButton(8)      'ZeroX
Sleep(1000)      
DoButton(9)      'ZeroY
Sleep(1000)
DoOemButton(160)   'Regen ToolPath
Sleep(1000)
SetVar(100,Getoemdro(4))
Sleep(100)
SetVar(101,Getoemdro(10))
Sleep(100)
Setvar(110,Getoemdro(5))
Sleep(100)
Setvar(111,Getoemdro(11))
Sleep(100)
Code"G1 X#100 Y#110 F#120"
While Ismoving()
Sleep(100)
Wend
Code"G4 P#121"
Code"G1 X#100 Y#111 F#120"
While Ismoving()
Sleep(100)
Wend
Code"G4 P#121"
Code"G1 X#101 Y#111 F#120"
While Ismoving()
Sleep(100)
Wend
Code"G4 P#121"
Code"G1 X#101 Y#110 F#120"
While Ismoving()
Sleep(100)
Wend
Code"G4 P#121"
Code"G1 X#100 Y#110 F#120"
While Ismoving()
Sleep(100)
Wend
Code"G4 P#121"
Code"G1 X0.000 Y0.000 F#120"
While Ismoving()
Sleep(100)
Wend
DoButton(1)
DoButton(3)
Goto N4:
N3:
MsgBox("Move Z To A Safe Position And Restart")
GoTo N4:
N4:
End Sub
End

    

163
This is another handy function we run on plasma machines. It is a 2 button system. One to stop and 1 to restart.

If you find the torch cutting a bit raggy and want to check it. Push the stop button. Mach will then do a feedhold and turn off the torch, record all the import info it needs to restart, then notify you on the message bar when it is done.

Then you can move anywhere to check or clean or change out parts as needed. DON't forget to reset your plasma machine(;-) if you take the head apart.

Now when you are ready to return to work press the restart button. The machine will pop up a window letting you know how is it going to proceed back to the spot .IF you agree with it press ok.

Then the machine will rapid back to the last cut position and reset the TOM(top of material) refire the torch and restart the program run.

You may need to modify the TOM routine to suite your style.


***********************************************************************
'Stop Button     Feedhold/stop to check torch
DoButton(1)                 'Feedhold
While IsMoving      'Wait for movement to stop
Sleep(100)
Wend
DoSpinStop                                 ' Turn OFF torch
Sleep(1000)
DoButton(286)            ' Set positions
Sleep(1000)
DoButton(3)      'Set Stop
Sleep(1000)
SetVar(604,GetDro(18))   'SetVar to Feedrate
SetVar(605,GetDro(16))   'SetVar to CurrentLine#
Code"G0 Z1.000"      'Move to a SafeZ
While IsMoving()     
Sleep(1000)
Wend
Code"(Stop Routine Complete)"
End     

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

'Restart Button to return to work
Code"G1 Z1.000 F#604"             'Go To a SafeZ
While IsMoving()
Sleep(1000)
Wend
SetDro(16,Getvar(605))   'Reset SET NEXT LINE #
Sleep(100)
SetDro(18,GetVar(604))   'Reset Feedrate
Sleep(100)
'************************* Setup TOM to suite machine
Code"G28.1 Z0.500"    'ReREF Head  to TOM
While Ismoving()
Sleep(100)
Wend
Code"G92 Z0.000"                    'Reset Dro
Code"G1 Z0.150"
Code"G92 Z0.000"
sleep(100)
'*************************************************
DoOemButton(285)             'Return to stop position
While IsMoving()
Sleep(1000)
Wend
Code"G1 Z#601 F#604"      'Return Z to stop Point
While IsMoving()
Sleep(1000)
Wend
DOSPINCW()      'Refire Torch
Sleep(100)
DoButton(0)       'Resume Program Run from Stop Point
Code"(You are now back ONLINE cutting )"
End         


164
MACH TOOL BOX / AutoPark Function for Plasma users
« on: June 05, 2010, 09:39:06 PM »
This Is a simple function that has proven very handy for plasma users. Its purpose is to park the torch at a handy spot to be able to pick the parts out AND be in a good position to start the next cut. This code bases the Park position to be at the left edge of the part  and at the top LH side +.250". It uses the Min Xextents AND the Max yextents.

This code runs at teh end of your Gcode file and does not involve the actual Gocde file. It will park the head based on the PART extents so it does not care if it is a small part or large part. It parks in the same spot in relation to the part.

You can set a button and led on the run screen to turn the function on or off as needed, set the led as UserLed(1199),

OR you can call the function as a VAR call from the mdi line.  #450=999 will turn it on   #450=0 will turn it off

This code runs from inside of the M1030 macro. The M1030 is called automatically from the Mach M30 call used at the end of file to reset mach.

Add this code to your M1030 macro, IF you do not have one you will have to save as M1030 in the macro directory

USE the correct section of code depending on how you wish to turn it on/off. Button or Var call from the MDI line.
HOPE it Helps

***********************************************************
,M1030 Auto Park WITH SCREEN BUTTON/LED setting on/off

If GetUserLed(1199)<>0 Then
SetVar(401,GetOemDro(4))
SetVar(402,GetOemDro(11))
Code" G0 Z1.00"
While IsMoving()
Wend
Code"X#401 Y[#402+0.250]"
While IsMoving()
Wend
End If
End
************************************
'M1030 macro For AutoPark with MDI setting on/off

If GetVar(450)=999 Then
SetVar(401,GetOemDro(4))
SetVar(402,GetOemDro(11))
Code" G0 Z1.00"
While IsMoving()
Wend
Code"X#401 Y[#402+0.250]"
While IsMoving()
Wend
End If
End

165
General Mach Discussion / NEW Mach forum subject
« on: May 27, 2010, 01:16:58 PM »
WOuld it be possible to have a MACH PLASMA section added.

There are many people using mach and plasma these days AND this would be a good spot to draw them to.

Plasma IS a different Dawg than most cnc applications so their processes tend to be different and their requests and NEEDS  may get lost in the normal CNC traffic.


Thanks if it is possible,

166
Screen designer tips and tutorials / Screen Designer TIP
« on: May 09, 2010, 01:57:27 PM »
When creating new sceensets it would be nice IF you encluded a very small set of buttons on the main screen to be used as function buttons.

I set up a set of 12 small buttons hardly visable. Then asign a HOTKEY = to ALT&F1-12. That means to use press ALT & say F1. That will gives you 12 functions at the press of the button.

I personally have 24 function keys F1-F24 so with the addition of ALT&F  and Ctrl&F and Ctrl&Alt&F   I have 72 functions available at teh press of a buttonSet

ALSO set the buttons to use VB script. Then program each button to call a macro   Code"M2000"   Use say M2000 - M2012 macros.

Now when the USER needs a function they just create a macro say M1201(for use with alt&F1) and it will call the macro assigned to that button.

This saves the user from having to figure OUT how to use Scream4 and adds function buttons to your screens for extra functions.

You could also go ahead and Create the macroset M2000-2012. Insidethe macro just put include the code:

Message" This Funtion Is Unused, You may add code to M2000 to create a FUNCTION BUTTON"

Now when they press the button the message will appear in the MACH status Message Bar

AND it adds value to your screenset

Hope it helps

167
' Macro to send Program Extents (SIZE) to the message Bar
Message" X: " & (GetOemDro(10) - GetOemDro(4)) & " Y: " & (GetOemDro(11) - GetOemDro(5))
END

168
MACH TOOL BOX / MACRO, New WorkLog with tool change output
« on: May 09, 2010, 12:38:33 PM »
First create a new button on the main screen OR use an existing EMPTY button. I used the AutoToolZero button as it is NOT used. This button is used to START any program that you want logged. Just load your program and if you want it logged then Push the Button to start the program. It will turn ON the  LOG function and start the log. IF there is NO worklog.txt file  IT will create the file for you.

Next add in the M6start code to the M6start macro

NOW  create an M1030 macro. It will automatically be called by the M30 in the program. You must enclude an M30 and your program end for this to work.

Once you have started the program with the LOGFILE button you do not use it again until the next program start. To restart after the tool changes you do the standard cyclestart as you normally do.

IF you do not want to log the file then just use the Cycle start button. The M1030 will sense that you did not use the LogFile button and wil NOT add any info to the file.

******************************************************

'Macro ProgramRun use for start worklog code
Open"C:/Mach3/worklog.txt" For Append As #1
Write #1,"" & Date &"....." & Filename &"," &"StartTime " & Time()
Close#1
SetVar(499,0)
DoButton(0)
End

*******************************************
'M6Start Macro

  tool = GetSelectedTool()
  SetCurrentTool( tool )


Open "C:/Mach3/Worklog.txt" For Append As #1
Write #1,"__________ToolChange "  &  "T# " & GetSelectedTool() & "," & Time()
Close #1
End
 

*******************************************

'Macro M1030 use to build the M1030 macro that the M30 calls at program end

Sub main()
If GETvar(499) <> 0 Then End
If GetVar(499) =0 Then

Open "C:/mach3/worklog.txt" For Append As #1
Write #1,"          " &Filename &"..........EndingTime" & Time()
Close #1

setVar(499,1)
End If
End Sub 
 
*******************************************
WorkLog Sample Output

"5/9/2010.....C:\Mach3\GCode\TestWorkLog.txt,StartTime 12:01:42 PM"
"__________ToolChange T# 1,12:01:43 PM"
"__________ToolChange T# 2,12:01:55 PM"
"__________ToolChange T# 3,12:02:00 PM"
"__________ToolChange T# 4,12:02:05 PM"
"          C:\Mach3\GCode\TestWorkLog.txt..........EndingTime12:02:10 PM"

Hope that helps

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17