Hello Guest it is April 23, 2024, 06:24:24 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 - glengeniii

Pages: 1 2 3 »
1
General Mach Discussion / Mach 3 and the use of a CMM as an engraver
« on: August 02, 2010, 03:42:57 AM »
Does anyone know is CMM's us ball screws.  I would like to scrap the controls on an old CMM, and retrofit it with Mach3 for use as a cnc engraver/router.  Is this plausible?

Thanks

2
VB and the development of wizards / M98 and M99 VBScript
« on: July 18, 2010, 03:34:54 AM »
Does anyone know how to access the VBScript for the M98 and M99 macros?  They are not found in the Macros Folder.  I don't want to change them, I would just like to see how Mach3 Find the M98 O word when the M98 P word is called, and how Mach3 exits the subroutine with the M99 comand.

3
Thanks for the replies, I really appreciate them.  I'm new to VB script and have been struggling with some of it.  I created some VB script that I will insert into the M6 tool change file that when a tool change is ran, the script will find certain info in the gcode of the current open file.  I use SheetCAM to write my gcode programs, which inserts certain info into the gcode (Processes, Tool Descriptions, Notes and etc.), always using the same  format. The script I working on will scan the gcode and post this current info to several userlabels, as well, it  will scan ahead to find the next tool change number and post the SheetCAM info that takes place with that tool. This way, while the machine is running, I can see what processes are taking place as well as the next tool number and next processes that will take place so I can get ready for them.  It seems to work good, as long as there are no subroutines in the code.  The problem that happens is that the script does not recognize that it is in a M98 subroutine, so it scans ahead but does not find the next blocks of SheetCAM info because they are in another  file.  My current part programs all use a Main Program with M98 calls using the  M98(filename.nc) format, not the P word / O word format Ex.  M98 P12345. I believe I can get around this by using the M98 P12345 O12345 format because all the gcode will be in one single file.  I really don't want to have to edit all my programs that have already been written.  Would it be wiser to use a Macro-pump to constantly scan for this info, instead of only searching for the info during tool changes?  It seems like it might be a good idea because I could receive real time info of what processes are taking place, not just what processes will take place with a specific tool, Although I'm not sure this is what the Macro-pump is meant for.

4
 ???Um..... Anyone out there?  If a M98 P12345 subroutine is currently loaded,  is there any way I can request the current sub routine name (M98) in VBscript?

 

5
In VBscript, how can I find out what subroutine is currently open.
Example:
(c:Mach3/subroutines/99999.nc) is the current subroutine opened with a M98 command.

GetCurrentSubroutinefile = linestring 'gets the name of the current subroutine that is open
setuserlabel (1,linestring)  'inserts 99999.nc into userlabel 1

Is there an led that signals when a subroutine is open?

Thanks

George

6
Thanks for the help, this is exactly what I needed.  The idea of stating the T# in advanced is a good idea but the CAM program I use does not all it and I don't want to have to manually edit the programs.   I'm still interested in learning how to post to user labels.  I didn't think this was possible because in Screen4 when you add a user label to the screen, the  label has no specific number to identify it from other labels,  unlike the DROs.  If I could post to a user label and use it as another message bar that would be great.

Thanks

7
I think your misunderstanding what I'm trying to ask.  I know how to set DRO's, what I can't figure out is how to extract the T number from the line string.  The VB script I have so far will find the next line of code with the M6, and stores it as a string of text "linestring".  So an example would be that linestring = N1000 T3 M6 G43 H3.  I would like to be able to grab the number after the T word (3) and store it as "NextTool" so that it can then be set setuserDRO (1152,NextTool).  I've been able to do it with some very crude impractical methods that use the run from here button and require preparation moves.  One method that I would like to use looks something like this;

1000
n=n + 1
If n>256 Then
Code "(no tool found)"
setuserDRO (1152,0)
end if
exit sub
Else
If ((InStr(linestring,"T" & n )   Then
setuserDRO (1152,n)
end if
exit sub
Else
goto  1000


Where n is an integer from 0 to max. tool number ( I think it is 256)
linestring is the string of text that appears in the Gcode.
I would like to run this script in the M6 macro, and I want to avoid preparation moves.
This code works if the line says:  If ((InStr(linestring,"T3" )    but it does when I use If ((InStr(linestring,"T" & n )  even if I insert
n=3 into the script

Any help would be appreciated.

Thanks


8
How would I send the string to a user label.  I don't think it's possible.

Thanks

9
What I mean is that I would like to place a custom userDRO on the screen that would display what tool number is next in line to run after the current tool finishes.  This way while tool A is running, I can look on the screen and find which tool to get ready for the next manual tool change.  I figure when the tool change macro is ran,  I'll use some script to scan ahead and find which tool is next.

So far, I have been able to get the macro to find the line the next tool change is on and post the entire line of code to the message bar, but I'm not sure how to post just the T number (word) to a DRO.  I want it posted to the DRO because any messages are immediately replaced in the history file.


Dim currentfile As String
Dim filesys, filetxt, lastline, oldline As String
Dim currentLine As String
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set filesys = CreateObject("Scripting.FileSystemObject")
currentLine = GetOEMDRO(816)
Found = False
currentfile = FileName
Set filetxt = filesys.OpenTextFile(currentfile, ForReading, True)
Dim i As Integer
i = 0
Do While filetxt.AtEndOfStream <> true
linestring = UCase(filetxt.ReadLine()) & " "
If linestring <> " " Then
i = i+1
If i > currentLine Then
If ((InStr(linestring,"M6" ) >0 Or InStr(linestring,"M06" )>0)) Then  
Message "()" & linestring 'post the entire line of code to the history folder
Found = True
MsgBox " Your next toolchange position is at line "& i
Exit Do
End If
End If
End If
Loop
If Found = False Then
MsgBox "No M6/M06 Found after LINE:"& currentLine
End If
filetxt.Close
Set filesys = Nothing
Set filetxt = Nothing

My question is, how can I get the tool number (T word) set to a user dro.

10
Thanks, it was the safe Z.

Pages: 1 2 3 »