Hello Guest it is April 17, 2024, 10:44:38 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 »
71
Hi All,  Seeing how Les at SHEETCAM gave us the ability to create image files from our jobs I created
a Button function in MACH3 to be able to LOAD a Gcode file by viewing an image
file and making a selection to LOAD.

Button code and Screenshot of the function is in the MACH TOOL BOX section.

(;-) TP

72
MACH TOOL BOX / Load Gcode file from an Image of part
« on: March 09, 2013, 10:48:20 PM »
Seeing how Les at SHEETCAM gave us the ability to create image files from our jobs I created
a Button function in MACH3 to be able to LOAD a Gcode file by viewing an image
file and making a selection to LOAD. The image and Gcode file MUST have the same
name of course and the function will LET YOU KNOW if it cannot find a gcode
under the image name you selected(;-).

You would need to add a new button to your screen and copy over the code to it
so it may not be for everyone. I could create a macro from it and you could just
call it from the MDI line, OR open for suggestions ???

If you are like me I have about a half a zillion Gcode files for plasma cutting.
After the first hundred or so gcode file names they all seem to run together
anymore. Memory is not the best anymore.

So now you can select the FIlename and View an image of it THEN if it is the
correct one load it into Mach3 and be ready to cut.

To use simply press the button and a veiw screen will pop up. Click on the file name you wish to view and the IMAGE will come up in the view window. Once you have found the correct file/image push the load button and the function will search the Gcode DIR and IF it finds a matching name it will load the program and CLOSE.

IF it does not find a match it will display a message and you can either cancel or select again.

HOPE it is helpful, I already use it in the shop for plasma cutting.

(;-) TP


Button Code for Load from Image:

'=========================================================
' Macro function to load Gcode file FROM the BMP image.
' The image files MUST be in BMP format and be the same
' Name as the Gcode file. The Gcode files and the BMP files
' can be in the same DIR or different DIRs you will have to
' Point the CODE to the proper DIRs.
'
' There are notes in the code as to the various POINTERS
' that you may need to modify for your application
'=========================================================
 
Sub DrawBitmapSample
    Dim MyList()
    Begin Dialog BitmapDlg 60, 60, 590, 420, "Load Gcode From BMP Image", .DlgFunc
        ListBox 10, 10, 80, 180, MyList(), .List1, 2
        Picture 100, 10, 480, 380, "C:\mach3\bitmaps\splash.bmp", 0, .Picture1
        CancelButton 27, 225, 40, 12    
        PushButton 10, 200 ,80,12 ,"Load Gcode File", .PB1
    End Dialog
 
    Dim frame As BitmapDlg
    Dialog frame
End Sub
 
Function DlgFunc( controlID As String, action As Integer, suppValue As Integer)
 
    DlgFunc = 1  ' Keep dialog active
 
Select Case action
    Case 1 ' Initialize
        temp = Dir( "D:\ScamData\Jobs\*.bmp" )  ' Points to the DIR of the BMP files
        count = 0
    While temp <> ""
        count = count + 1
        temp = Dir
        Wend
        Dim x() As String
        ReDim x(count)
        x(0) = Dir( "D:\ScamData\Jobs\*.bmp" ) ' Points to the DIR of the BMP files
        For i = 1 To count
            x(i) = Dir
        Next i
        DlgListBoxArray "List1", x()
        
    Case 2 ' Click
        fName = ( "D:\ScamData\Jobs\" & DlgText("List1") )  'Points to the DIR of the BMP DIR.
        DlgSetPicture "Picture1", fName
        
  If controlID = "PB1" Then
   sFile = Dlgtext("List1")
   sFile = Left(sFile, InStr(1, sFile, ".") - 1)
   Fext= ".TAP"               'Sets the .ext of the Gcode type
   Lfile = sFile &Fext
   
    If Dir ("C:\Mach3\Gcode\" & Lfile) ="" Then      'Points to the DIR of the GCODE files
        Message"Function Closed"
        MsgBox" Requested GCODE File Does NOT Exist "
    Else
   Loadfile "C:\Mach3\Gcode\" &Lfile                'Points to the DIR of the GCODE files
   End
   End If

End If      
End Select
End Function
End            

73
Hi ALL, I am working on a new file loader for MACh3 that uses images of afile to load gcode files. I am having trouble getting the Pushbutton"LoadGcode File" to work.  All the other componets work as needed.

From the screen you select the file from the listbox as you select the file the Program displays the IMAGE file on screen. when you find the correct file then you would push  the load G code file button and it will load a gcode file of the same name to mach3.

The part that I cannot get to function would be CASE 3. I cannot find a clear description as to HOW to get a pushButton to function as needed.

IF anyone has an idea or a suggestion please fill free to add to it to get it to work correctly.

(;-) TP



' Macro to select Gcode files by BMP picture
Sub DrawBitmapSample
    Dim MyList()
    Begin Dialog BitmapDlg 60, 60, 590, 420, "Select Gcode FIle VIA BMP Image", .DlgFunc
   
        ListBox 10, 10, 80, 180, MyList(), .List1, 2
        Picture 100, 10, 480, 380, "c:\mach3\bitmaps\splash.bmp", 0, .Picture1
        CancelButton 25, 198, 40, 12     
        'OKButton 50, 198, 40, 12
        PushButton 10,225,80,12 , " Load G Code File ", .PB1
    End Dialog
   
     
     Dim frame As BitmapDlg
     ' Show the bitmap dialog
    Dialog frame
End Sub
 
Function DlgFunc( controlID As String, action As Integer, suppValue As Integer)
 
    DlgFunc = 1  ' Keep dialog active
 
    Select Case action
    Case 1 ' Initialize
        temp = Dir( "D:\ScamData\Jobs\*.bmp" )
        count = 0
        While temp <> ""
            count = count + 1
            temp = Dir
        Wend
        Dim x() As String
        ReDim x(count)
        x(0) = Dir( "D:\ScamData\Jobs\*.bmp" )
        For i = 1 To count
            x(i) = Dir
        Next i
        DlgListBoxArray "List1", x()
         
    Case 2 ' Click
        Fname = ( "D:\ScamData\Jobs\" & DlgText("List1") )
        DlgSetPicture "Picture1", Fname
   
     
       
    Case 3 ' select File to load from Image
   
     
  If button = 1 Then
 

 
sFile = Dlgtext("List1")
sFile = Left(sFile, InStr(1, sFile, ".") - 1)
Fext= ".TAP"
Lfile = sFile &Fext
If Dir ("C:\Mach3\Gcode\" & Lfile) ="" Then
MsgBox" File Does NOT Exist "
Message"Function Closed"
End

Else
 
Loadfile "C:\Mach3\Gcode\" &Lfile
 
End If
 End If
       
 End Select
End Function
End       


74
Hi ALL, I have added several new button scripts to the MachToolBox.

One is a Gcode FIle Loader

The other is a tool to advance you to the next tool change(mill) in the loaded Gcode file

(;-) TP

75
MACH TOOL BOX / Gcode File section script
« on: March 08, 2013, 12:40:05 PM »
Hi ALL, Here is a button script that allows you to load a gcode file from a set directory and filetype.

(;-) TP



'Gcode Selection Box
Sub GcodeSelect
    Dim MyList()
    Begin Dialog GcodeFileDlg 60, 60, 190, 220, "MACH3 Gcode Program Select", .DlgFunc
        ListBox 10, 10, 150, 180, MyList(), .List1, 2
        CancelButton 42, 198, 40, 12
        OKButton 90, 198, 40, 12   
       
    End Dialog
   
   
    Dim Button As GcodeFileDlg

    Dim frame As GcodeFileDlg
 
    ' Show the GcodeFile dialog
    Dialog frame
End Sub
 
Function DlgFunc( controlID As String, action As Integer, suppValue As Integer)
 
   
    Select Case action
    Case 1 ' Initialize
        temp = Dir( "c:\Mach3\Gcode\*.tap" )
        count = 0 
        While temp <> ""
            count = count + 1
            temp = Dir
        Wend
        Dim x() As String
        ReDim x(count)
        x(0) = Dir( "c:\Mach3\Gcode\*.tap" )
        For i = 1 To count
            x(i) = Dir
        Next i
        DlgListBoxArray "List1", x()
       
    Case 2 ' select
     If controlID = "OK" Then
  LoadFIle("c:\Mach3\Gcode\" &DlgText("List1"))
End If

End Select

End Function

End


76
Hi ALL, This is a button script to allow you to search through a loaded Gcode file. It advances to the next M6 it finds in the current file. If no file is loaded then it errors OUT and ends.

(;-)TP

'Macro for  GcodeFile string search
Dim sLine As String
Dim i As Long
Dim lFoundLine As Long

Fname = FileName

If Fname = "No FIle Loaded." Then
MsgBox" There is NO File Currently Loaded in Mach3"
End
Else

Open FIlename For Input As #1

Do Until EOF(1)
  lFoundLine = lFoundLine + 1
  Line Input #1, sLine
  If InStr(1, sLine, "M06") > 0 And lfoundline > GetDro(16) Then
    Exit Do
  End If
Loop
Close #1
Nline = (lfoundline -1)
MsgBox""&Nline
Setdro(16,Nline)
End If
End

77
Newfangled Mill Wizard / New Name for Mill Wizard ????
« on: March 06, 2013, 11:57:43 AM »
HIYA RON MIght want to consider a new NAME for the new wizard. It is going to get very confusing real soon keeping the two apart for troubleshooting and support.

Might I suggest  something along the lines of CPS ( Conversational Programming System) By NFW.

Just a thought, (;-) TP

78
Newfangled Mill Wizard / 4th axis toolpath ?
« on: March 03, 2013, 09:56:59 PM »
HIYA RON, Do yall plan on turning ON the 4th axis rotary toolpathing for the display in the mill wizard ??

(;-) TP


79
Newfangled Mill Wizard / Wizard does not recognise License
« on: February 26, 2013, 11:18:15 PM »
HIYA RON, The wizard does not recognise the LIC file. If you try to reload the lic the window opens looking for a *.TXT file not a *.DAT file. SO you cannot select the license.

(;-) TP

80
General Mach Discussion / CNC study guide tutorial
« on: January 17, 2013, 02:23:34 PM »
If anyone needs a FREE cnc study /tutorial guide here is a Haas manual that does a very good job explaining most commands.

The Haas Gcode system  is very compatible with MACH3 . There are a few exceptions.


http://www.egr.unlv.edu/~kevinn/CNCworkbooks/MillProgrammingBook.pdf


(;-) TP


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