Hello Guest it is April 24, 2024, 09:07:42 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 - TPS

2101
General Mach Discussion / Re: G49 on Mach3 Mill
« on: February 05, 2018, 05:57:11 AM »
ok here is my Little solution to run in a button script:

Code: [Select]
Sub Main()

Set objFiles = CreateObject("Excel.Application")
Dim Filename As String


'set default open file folder
ChDrive "C:"
ChDir   "C:\Mach3\GCode"

FileName = objFiles.Application.GetOpenFilename("GCodeFiles (*.TAP), *.tap")
 
If FileName = "False" Then Exit Sub

'find the last "\" in filename
For i = 1 To Len(FileName)
If Mid(FileName,i,1) = "\" Then
last = i
End If
Next i

'extract filename
myfilename = Mid(FileName,last+1,Len(FileName)-last)

'find the extension in filename
For i = 1 To Len(myfilename)
If Mid(myfilename,i,1) = "." Then
last = i
End If
Next i

'seperate filename and extension
blancfilename = Mid(myfilename,1,last-1)
extension = Mid(myfilename,last,Len(FileName)-last)

'open input file
FNumInput    = FreeFile 'Determine next file number.
Open FileName For Input As FNumInput

'open output file
FNumOutput = FreeFile 'Determine next file number.
Open "C:\Mach3\GCode\" + blancfilename + "_filtered" + extension For Output As FNumOutput

'go through To hole file
Do While Not EOF(FNumInput)
Line Input #FNumInput, FileData ' Read a line of data.
If InStr(FileData,"G43") = 0 Then
Print #FNumOutput, FileData
Else
Print #FNumOutput, "( " + FileData + " )"
End If
Loop


Close ' Close all open files.

End Sub




it will only work on a machine where Excel is present,
because all my known openfile dialogs (in VBScript) where
not working on a 64bit OS
 
Thomas

so if anybody has a working fileopen Dialog, would be nice to share it.

2102
General Mach Discussion / Re: Bridgeport Knee Mill Conversion?
« on: February 04, 2018, 06:57:39 AM »
here we go.
that is was Estlcam did, in two different strategy's.

Thomas

2103
General Mach Discussion / Re: G49 on Mach3 Mill
« on: February 03, 2018, 02:58:43 AM »
maybe a way to put a macro "behind" the LOAD FILE button,
witch elemenates the G43 ?
Thomas

2105
General Mach Discussion / Re: Mach3 Turn, can't jog, g-codes work normal
« on: February 02, 2018, 10:00:49 AM »
jog mode enebled ?

2106
General Mach Discussion / Re: Bridgeport Knee Mill Conversion?
« on: February 02, 2018, 09:53:41 AM »
can you Export this to stl ?
estlcam does not suppurt Fusion files.

2107
General Mach Discussion / Re: Bridgeport Knee Mill Conversion?
« on: February 02, 2018, 09:34:45 AM »
if you post your drawing,
i will put it through my estlcam and see what happens.

Thomas

2108
General Mach Discussion / Re: I Need a macro written will pay.
« on: February 02, 2018, 06:43:11 AM »
hello Tony,

attached a first (very raw) Version for the wizard.

please expand to your addon Folder.
then copy m400.m1s and m401.m1s to your Profile/macrofolder.

add this code:

Code: [Select]
'calculate the actual value from laser
'based on (rawvalue * multiplicator) - offset
actmm = GetUserDro(1000) * GetUserDro(1150)
SetUserDro(1151, actmm )
SetUserDro(1154, 1000.0 - actmm -GetUserDro(1153))

to your macropump.m1s and make sure macropump is enabled in General config.

restart Mach3.

then you should see the wizard witch is named "laser digitizise wizard"

open the wizard and test.

Thomas

2109
General Mach Discussion / Re: I Need a macro written will pay.
« on: February 02, 2018, 03:17:32 AM »
Hello Tony,

according to the Manuals i would connect the laser like this (if the UC300 has a external 5V supply)

il1000 Brown uc300 anaolg plug pin1 -> 12V
il1000 Blue uc300 anaolg plug pin2 -> 0V
il1000 orange uc300 anaolg plug pin3 -> analog Input1
il1000 shield uc300 anaolg plug pin5 -> gnd

(if the UC300 has no external 5V supply)

il1000 Brown external power supply -> 10-30VDC
il1000 Blue external power supply -> 0V
il1000 orange uc300 anaolg plug pin3 -> analog Input1
il1000 shield uc300 anaolg plug pin5 -> gnd

and if i understand UC300 Manual we should get a value in OEMDRO(1000)

but you have to do this from the il1000 Manual:

"3-1 Operation When the Power is Turned on for the First Time" (page 3-2)
"3-3 Initial Reset (Initialize)" (page 3-8)

as well.

Thomas








2110
Feature Requests / Re: Commission work, Macro needed please help!
« on: February 02, 2018, 02:57:50 AM »
here the code in code tag, to Keep the Smileys out

Code: [Select]

 
' ---------------------------------------------------------------------------------
' TPS 26.01.2018 
' ATC macro for 8 places
' V 1.0.0
' ---------------------------------------------------------------------------------

' Main routine for tool change -----------------------------------------------------
Sub Main()

' declare ten global variables ----------------------------------------------------
  Dim Pos_X_Tool(8) as double

' variables for the feedrate
F_slow = 400 'feedrate for slow moves
F_fast = 2000 'feedrate for fast moves


'remark all TC position are in machine coordinates !!!

'variables for the X positions
Pos_X_Tool(1) = 100.0000 'X position for tool 1
Pos_X_Tool(2) = 200.0000 'X position for tool 2
Pos_X_Tool(3) = 300.0000 'X position for tool 3
Pos_X_Tool(4) = 400.0000 'X position for tool 4
Pos_X_Tool(5) = 500.0000 'X position for tool 5
Pos_X_Tool(6) = 600.0000 'X position for tool 6
Pos_X_Tool(7) = 700.0000 'X position for tool 7
Pos_X_Tool(8) = 800.0000 'X position for tool 8

'variables for the Y Position
Pos_Y_before = 200.0000 'Y position in front of TC
Pos_Y_in = 100.0000 'Y position in TC

'variables for the Z Position
Pos_Z_save = 300.0000 'Z position over all that we can move (X/Y) save to TC
Pos_Z_over = 200.0000 'Z position over the placed tool (X move possible)
Pos_Z_in = 100.0000 'Z position in TC

'variable for toolclamp output
TC_output = Output1

'variable for delay open/close toolclamp
TC_wait = 1000
 
' ---------------------------------------------------------------------------------


'get the tool relvated numbers
newtool = GetSelectedTool() 'get the new toolnumber
acttool  = GetCurrentTool() 'get the actual toolnumber

'do some basic check's

' no tool loaded nothing to unload
If ((newtool = 0) and (acttool = 0)) Then
message("no tool loaded nothing to unload !")
Exit Sub
End If

' nothing to do newtool = acttool
If newtool = acttool Then
message("nothing to do newtool = acttool !")
Exit Sub
End If
 
'check toolnumber in range
If  (((newtool > 8) Or (newtool < 1)) and (newtool <> 0)) Then
Message (" toolnumber " & newtool & " is not in range (1-8). abort toolchange  ! ")
DoButton(3)
Exit Sub
End If

'X-axis is not referenced
If GetOEMLED(807) Then
Message ("X-axis no reference -> abort !!")
DoButton(3)
Exit Sub
End If

'Y-axis is not referenced
If GetOEMLED(808) Then
Message ("Y-axis no reference -> abort !!")
DoButton(3)
Exit Sub
End If

'Z-axis is not referenced
If GetOEMLED(809) Then
Message ("Z-axis no reference -> abort !!")
DoButton(3)
Exit Sub
End If

Message "change tool: " +CStr(acttool) + " to: " + CStr(newtool)

'get the current position and settings
CurrentFeed = GetOemDRO(818)  'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
CurrentXpos = GetOemDRO(83) 'Get t X position where we came from
CurrentYpos = GetOemDRO(84) 'Get t Y position where we came from
CurrentZpos = GetOemDRO(85) 'Get t Z position where we came from

'Get Axis Scale factors in use
XScale = GetOEMDRO(59)
YScale = GetOEMDRO(60)
ZScale = GetOEMDRO(61)

'Set All Axis Scales to 1
SetOEMDRO(59,1)
SetOEMDRO(60,1)
SetOEMDRO(61,1)
Sleep(250)

' turn spindle off just in case
Code "M5"

' go to save Z position
Message "goto Z-save"
Code "G53 G90 G01 Z"+CStr(Pos_Z_save)+"F"+CStr(F_fast)
WaitForMove

'only unload tool
If newtool = 0 Then
'go to X/Y position (Y-before)
Message "go to X/Y position"
Code "G53 G90 G01 X"+CStr(Pos_X_Tool(acttool))+"Y"+CStr(Pos_Y_before)
WaitForMove
'goto Z-in fast
Message "goto Z-in fast"
Code "G53 G90 G01 Z"+CStr(Pos_Z_in)
WaitForMove
'go to Y position in
Message "go to Y position in"
Code "G53 G90 G01 Y"+CStr(Pos_Y_in)+"F"+CStr(F_slow)
WaitForMove
'open toolclamp
Message "open toolclamp"
ActivateSignal(TC_output)
Sleep(TC_wait)
'goto Z-over slow
Message "goto Z-over slow"
Code "G53 G90 G01 Z"+CStr(Pos_Z_over)
WaitForMove
End If

'only load tool
If acttool = 0 Then
'go to X/Y position
Message "go to X/Y position"
Code "G53 G90 G01 X"+CStr(Pos_X_Tool(newtool))+"Y"+CStr(Pos_Y_in)
WaitForMove
'goto Z-over fast
Message "goto Z-over fast"
Code "G53 G90 G01 Z"+CStr(Pos_Z_over)
WaitForMove
'open toolclamp
Message "open toolclamp"
ActivateSignal(TC_output)
Sleep(TC_wait)
'goto Z-in slow
Message "' goto Z-in slow"
Code "G53 G90 G01 Z"+CStr(Pos_Z_in)+"F"+CStr(F_slow)
WaitForMove
'close toolclamp
Message "close toolclamp"
DeactivateSignal(TC_output)
Sleep(TC_wait)
'go to Y position before
Message "go to Y position before"
Code "G53 G90 G01 Y"+CStr(Pos_Y_before)
WaitForMove
End If

'full tool change
If ((acttool <> 0) and (newtool <> 0)) Then
'unload tool
'go to X/Y position (Y-before)
Message "go to X/Y position"
Code "G53 G90 G01 X"+CStr(Pos_X_Tool(acttool))+"Y"+CStr(Pos_Y_before)
WaitForMove
'goto Z-in fast
Message "goto Z-in fast"
Code "G53 G90 G01 Z"+CStr(Pos_Z_in)
WaitForMove
'go to Y position in
Message "go to Y position in"
Code "G53 G90 G01 Y"+CStr(Pos_Y_in)+"F"+CStr(F_slow)
WaitForMove
'open toolclamp
Message "open toolclamp"
ActivateSignal(TC_output)
Sleep(TC_wait)
'goto Z-over slow
Message "goto Z-over slow"
Code "G53 G90 G01 Z"+CStr(Pos_Z_over)
WaitForMove

'load new tool
'go to X/Y position
Message "go to X/Y position"
Code "G53 G90 G01 X"+CStr(Pos_X_Tool(newtool))+"Y"+CStr(Pos_Y_in)+"F"+CStr(F_fast)
WaitForMove
'goto Z-in slow
Message "' goto Z-in slow"
Code "G53 G90 G01 Z"+CStr(Pos_Z_in)+"F"+CStr(F_slow)
WaitForMove
'close toolclamp
Message "close toolclamp"
DeactivateSignal(TC_output)
Sleep(TC_wait)
'go to Y position before
Message "go to Y position before"
Code "G53 G90 G01 Y"+CStr(Pos_Y_before)
WaitForMove

End If


' go to save Z position
Message "goto Z-save"
Code "G53 G90 G01 Z"+CStr(Pos_Z_save)+"F"+CStr(F_fast)
WaitForMove

'restore the origin values
Code "F" &CurrentFeed 'Returns to prior feed rate
If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
Code "G91"
End If
If CurrentGMode = 0 Then ' if G0 was in effect before then return to it
Code "G0"
End If   

'Put previous Axis Scale factors back
SetOEMDRO(59,XScale)
SetOEMDRO(60,YScale)
SetOEMDRO(61,ZScale)
Sleep(250)

'set new tool
    SetCurrentTool( newtool )

' go back to the position we came from
Message "goto origin X/Y"
Code "G53 G01 X"+CStr(CurrentXpos)+"Y"+CStr(CurrentYpos)
WaitForMove
Message "goto origin Z"
Code "G53 G01 Z"+CStr(CurrentZpos)
WaitForMove

'set new tool
    SetCurrentTool( newtool )
Message " "

End Sub


'global Sub's
Sub WaitForMove ()
While IsMoving()
Sleep(15)
Wend
End Sub