Hello Guest it is April 25, 2024, 05:43:59 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 - zealous

21
BTW: you could use G31 is what I quess you are looking for.
G31 Z-20.0 F100 (Probe in Z)

22
I dont have all the info on what you are trying to do but following the code you have this would be how you would do it:

Code: [Select]
Code "G1 Z -20 F100"
While isMoving()
If (IsOutputActive(Output1)) Then
DoOEMButton(1003)
Sleep 100                
End If
Wend

23
Feature Requests / Re: List of Tools used in a Part Program
« on: February 06, 2011, 09:44:44 PM »
Quote
There is NO reason any more to ever use a binary data file
I second this %110.
No need to protect this data put it in the XML
*One thing you can do for now is store the data in a text file and onload of Mach write to these values or on a button push.

24
We do screen/hardware solutions:
Please contact me at Jason@FusionCNC.com

25
Feature Requests / Re: List of Tools used in a Part Program
« on: January 13, 2011, 06:00:10 PM »
I am so glad that you can use the code and it is useful  :)
I commented the code and cleaned it up a bit, I also fix the code to correctly show the "Line Number" the M6/M06 was on.

Would it help to have a "Show Next Tool" while running the machine? So you know what tool is coming up next in the Gcode?

Code: [Select]
'Define vars
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim filesys, filetxt, lastline,oldline,Stored_List,StoreFilePath,path,currentfile As String
Dim dTaskID As Double
Dim i,k,j As Integer

'Bring up File navigation
DoOEMButton(216)
While(isloading)
sleep(250)
Wend

'paths
StoreFilePath = CurDir & "\StoredM6.txt"
path = "C:\WINDOWS\notepad.exe"
currentfile = FileName

'Default values
Found = False
i = 0
k = -1
j=0

'File System Create objects
Set filesys = CreateObject("Scripting.FileSystemObject")
Set objTextFile = filesys.CreateTextFile(StoreFilePath)
Set filetxt = filesys.OpenTextFile(currentfile, ForReading, True)


'Read File
Do While filetxt.AtEndOfStream <> true
linestring = UCase(filetxt.ReadLine()) & " "

'Uppercase check if not emptyLine
If linestring <> " " Then

'Count Line Number
k = k+1

'Is there a M6 or M06
If ((InStr(linestring,"M6") >0 Or InStr(linestring,"M06")>0)) Then

'Tells if we should open Notpad
Found = True

'Count Number of M6 M06
j = j+1

'Find index of T
ToolIndex = InStr(linestring,"T")

'Count backwards till we get a number
For d = 3 To 0 Step -1

ToolNum = Mid(linestring,ToolIndex+1,d)

'Is it a number then we know the tool#
If IsNumeric(ToolNum) Then

'Set the values of the tool
N = GetToolDesc(ToolNum)
D = GetToolParam(ToolNum,1)
L = GetToolParam(ToolNum,2)

Exit For
End If
 Next d
 
 
'Write values to StoredM6.txt
objTextFile.WriteLine( j & " Line# " & k & " Tool# " & ToolNum & " Name: " & N & " Diam: " & D & " Length: " & L)

End If
End If
Loop


'If a M6 was found then open up notpad with the new values
If Found = True Then
dTaskID = Shell(path + " " + StoreFilePath, vbNormalFocus)
Else
MsgBox "No M6/M06 Found"
End If

'Close and release everthing
filetxt.Close
Set filesys = Nothing
Set filetxt = Nothing
objTextFile.Close

26
Feature Requests / Re: List of Tools used in a Part Program
« on: January 10, 2011, 06:23:48 AM »
Hello,
Simply change your "Load Gcode" button to "VBScript" and past this code, or if you would like to call on it to read the current file with out the navigation remove:

Code: [Select]
DoOEMButton(216)
While(isloading)
sleep(250)
Wend

This code will:
1. Open a file navigation to open Gcode in Mach
2. Look for "M6/M06" and the "T" value
3. Write a file called "StoredM6.txt" in the current directory
4. "StoredM6.txt" will contain: Inc M6 call,  Line Number, Tool Number, Name, Diam and Length.
5. Open the text file
If there are no M6's it will display a message.

Code: [Select]
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim filesys, filetxt, lastline,oldline,Stored_List,StoreFilePath,path,currentfile As String
Dim dTaskID As Double
Dim i,k,j As Integer

DoOEMButton(216)
While(isloading)
sleep(250)
Wend

StoreFilePath = CurDir & "\StoredM6.txt"
path = "C:\WINDOWS\notepad.exe"
Found = False
Stored_List = ""
currentfile = FileName
i = 0
k = 0
j=0

Set filesys = CreateObject("Scripting.FileSystemObject")
Set objTextFile = filesys.CreateTextFile(StoreFilePath)
Set filetxt = filesys.OpenTextFile(currentfile, ForReading, True)



Do While filetxt.AtEndOfStream <> true

linestring = UCase(filetxt.ReadLine()) & " "

If linestring <> " " Then
k = k+1
If ((InStr(linestring,"M6") >0 Or InStr(linestring,"M06")>0)) Then

Found = True
j = j+1
ToolIndex = InStr(linestring,"T")

For d = 3 To 0 Step -1

ToolNum = Mid(linestring,ToolIndex+1,d)

If IsNumeric(ToolNum) Then

N = GetToolDesc(ToolNum)
D = GetToolParam(ToolNum,1)
L = GetToolParam(ToolNum,2)

Exit For
End If
 Next d
 
 i = i+1

objTextFile.WriteLine( j & " Line# " & k & " Tool# " & ToolNum & " Name: " & N & " Diam: " & D & " Length: " & L)

End If

End If

Loop



If Found = True Then
dTaskID = Shell(path + " " + StoreFilePath, vbNormalFocus)
Else
MsgBox "No M6/M06 Found"
End If

filetxt.Close
Set filesys = Nothing
Set filetxt = Nothing
objTextFile.Close








27
Finished Screens / Re: MachMotion's Ultimate Screen 2.0
« on: December 11, 2010, 01:59:15 AM »
Hi Steve,
We have a support team at Mach Motion, if you could contact Andy he is the manager and will make sure you recive the update. sales@machmotion.com
If for any reason you do not reseve an email within the next 24 hours please contact me at sales@fusioncnc.com

thank you,
Jason Blake

28
Works in progress / Re: Mach3 2010
« on: November 27, 2010, 10:12:16 PM »
Great work I am loving it :)

29
General Mach Discussion / Re: How to make a Script PERSISTANT?
« on: November 27, 2010, 04:00:07 AM »
You might want to use the new "StartPeriodicScript" function rather then the Macropump:

StartPeriodicScript
Function StartPeriodicScript(ByVal ScriptQFN as String, ByVal UpdatePeriod as
Double) as Integer
This function causes Mach to start a script that will be invoked with the specified
periodicity.
Arguments:
ScriptQFN: the string of the Qualified File Name (QFN) for the script to be run.
The qualified path name is relative to the Mach install directory. The QFN does
not include the script extension. Mach will look first for ScriptQFN.mcc and if
not found, then ScriptQFN.m1s.
If the QFN is the name of a script already started by a previous call to
StartPeriodicScript(), an error condition is returned. Mach does not support
multiple periodic instances of a single script.
UpdatePeriod: The length of the time period between runs of the script.
The time units are seconds. The minimum value is 5ms, any value less than 5ms
will be ignored and the minimum value of 5ms will be used for the UpdatePeriod.
Page 88
It is recommended that periodic scripts be run with the longest UpdatePeriod
appropriate for the script’s task. This will help minimize the load on the machine
from multiple periodic scripts.
Return Value:
0 = requested function was performed successfully (script is now running).
< 0 = error, requested function was not successful (script is not running).
Error Return Values:
<tbd>
Example:
‘ Initialize a script that runs the way oiler every 30
minutes
If StartPeriodicScript(“OilerScript”, 30*60*1000) then
Msgbox “Oiler periodic script is running”
Else
Msgbox “Oiler script was not started”
End If
See also:
IsPeriodicScriptRunning, StopPeriodicScript
First Mach3 version with API:
This API was first implemented in Mach3 version 3.43.06.
It was defined as a Boolean function with
Return Value:
True = requested function was performed successfully (script is now
running).
False = error, requested function was not successful (script is not running).
This API was revised in Mach3 version 3.43.19 to be an Integer function.


StopPeriodicScript
Function StopPeriodicScript(ByVal ScriptQFN as String) as Integer
This function is used to stop a previously started periodic script.
A periodic script only stops at the end of one of the script’s UpdatePeriod time quanta (as
set by StartPeriodicScript) cycles. For example if a script is running with a 5 minute
UpdatePeriod, and the stop request is issued 2 minutes into the cycle, the script will not
stop until the current 5 minute cycle expires.
Arguments:
ScriptQFN: the string of the Qualified File Name (QFN) for the script to be
stopped. The QFN is relative to the Mach install directory.
The QFN passed must be identical to the QFN used to start the periodic script.
Attempts to stop a script that has not been started by StartPeriodicScript are
ignored (this is not an error condition as the script is “stopped” upon return from
the call).
Return Value:
0 = requested function was performed successfully (script is now running).
< 0 = error, requested function was not successful (script is not running).
Error Values:
<tbd>
Example:
‘ Stop a the running way oiler script
If StopPeriodicScript(“OilerScript”) then
Msgbox “Oiler periodic script has been stopped”
Else
Msgbox “Error, Oiler script was not stopped,
check the QFN passed.”
End If
Page 90
See also:
IsPeriodicScriptRunning, StartPeriodicScript,
First Mach3 version with API:
This API was first implemented in Mach3 version 3.43.06.
It was defined as a Boolean function with
Return Value:
True = requested function was performed successfully (script is now
running).
False = error, requested function was not successful (script is not running).
This API was revised in Mach3 version 3.43.19 to be an Integer function.



IsPeriodicScriptRunning
Function IsPeriodicScriptRunning(ByVal ScriptQFN as String) as Boolean
This function is used to determine if a periodic script has been started.
Arguments:
ScriptQFN: the string of the Qualified File Name (QFN) for the script to check.
The QFN is relative to the Mach install directory.
The QFN passed must be identical to the QFN used to start the periodic script.
Return Value:
True = the Script is running.
False = the script is not running.
Example:
‘ check if the oiler has been started
If IsPeriodicScriptRunning(“OilerScript”) then
Msgbox “Oiler script is running.”
Else
Msgbox “Oiler script is not running.”
End If
See also:
StartPeriodicScript, StopPeriodicScript,
First Mach3 version with API:
This API was first implemented in Mach3 version 3.43.06.

30
Finished Screens / Re: MachMotion's Ultimate Screen 2.0
« on: October 18, 2010, 06:38:53 PM »
The lathe version is in the works!