Hello Guest it is March 28, 2024, 01:38:35 PM

Author Topic: work break button  (Read 2557 times)

0 Members and 1 Guest are viewing this topic.

work break button
« on: March 26, 2018, 05:32:53 AM »
buongiorno
e' fattibile un pulsante  script per la pausa lavorazione?
mi spiego a meta' lavorazione metto in pausa premo il pulsante e lui memorizza in un file dove si e' arrestato ( riga=xx , x=xx , y= xx , z=xx ).

Offline Tweakie.CNC

*
  • *
  •  9,196 9,196
  • Super Kitty
    • View Profile
Re: work break button
« Reply #1 on: March 26, 2018, 07:26:12 AM »
@ Brillo1959,

Vuoi imparare come farlo da solo o vuoi semplicemente che gli altri scrivano il codice per te?

Tweakie.
PEACE
Re: work break button
« Reply #2 on: March 26, 2018, 08:32:03 AM »
thanks Tweakie for the answer
I would (if possible) that someone wrote it, I would not be able to,
regards

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: work break button
« Reply #3 on: March 26, 2018, 12:18:59 PM »
code for the button to get a filname where to write to:

Code: [Select]
'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



code for the button witch saves the actual coordinates:
Code: [Select]
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, cStr(GetDro(0)) & "," & CStr(GetDro(1)) & "," & CStr(GetDro(2)) 
Close ' Close all files.

End Sub

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


what you realy looking for is digitizing.

digitizing wizard and search function is your friend.


anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: work break button
« Reply #4 on: March 26, 2018, 12:56:49 PM »
thanks for the TPS answer (kind as always)
what I would like to do is this:
1 gcode load
2 start of processing
3 break (if the processing is long)
4 press the button and at this point I should store in file 1 the line where I stopped and the coordinates, to continue (hypothesis) the day after
I do not know if it's possible, I repeat VB I do not understand!

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: work break button
« Reply #5 on: March 26, 2018, 02:02:19 PM »
and what is about:

-doing a new refernce ?
-knowing where you have stopped your gcode file (power off)

what you are planning is not done with pushing a button and running a script.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: work break button
« Reply #6 on: March 26, 2018, 04:30:36 PM »
it is exact in the file I would like to save where I interrupted the execution of the gcode, it would be enough for me to save the row number I attach photos to make me understand