201
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.
'M400 for digtizing
'get the filename for digfile from user
Sub Main()
If NOT Isloading() then
Dim FNum, FName ' Declare variables.
'get Filename from user
Begin Dialog TextBoxSample 16,30,180,96,"enter digfilename"
OKButton 132,20,40,14
Text 8,8,132,8,"filename without extension:"
TextBox 8,20,100,12,.TextBox1
Text 8,44,132,8,"file will be in c:\Mach3\GCode"
End Dialog
Dim Dlg1 As TextBoxSample
Dialog Dlg1
SetUserLabel(255, Dlg1.TextBox1)
'open the to file errase all existing data
FNum = FreeFile ' Determine next file number.
FName = "C:\Mach3\GCode\" + GetUserLabel(255) + ".nc"
Open FName For Output As FNum ' Open file.
Close ' Close all files.
SetUserDro(1166,1)
End If
End Sub
'M401 for digtizing
'write the values into digfile
Sub Main()
Dim FNum, FName ' Declare variables.
'wait for axis standstill
WaitForMove
'open the file for output data data
FNum = FreeFile ' Determine next file number.
FName = "C:\Mach3\GCode\" + GetUserLabel(255) + ".nc"
Open FName For Append As FNum ' Open file.
Print #FNum, nFmt(GetDro(0),4) & "," & nFmt(GetDro(1),4) & "," & nFmt(GetDro(2),4)
Close ' Close all files.
End Sub
'global Sub's
Sub WaitForMove ()
While IsMoving()
Sleep(5)
Wend
End Sub
'function for button1 ------------------------------------------------
Function Button1() as Boolean
Code ("F300")
End Function
Sub Main()
Call Button1()
End Sub
#Expand <\..\..\macros\Your profile name\MyFunctions>