Hello Guest it is March 19, 2024, 03:30:35 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 - TPS

1
General Mach Discussion / Re: edit button scripts
« on: March 09, 2024, 02:53:04 AM »
to excecute G-Code via button script the instruction should be for example:

Code: [Select]
  Code("G00 Z.100")
  Code("G00 X0 Y0")

see:
https://www.machsupport.com/wp-content/uploads/2013/02/Mach3_V3.x_Macro_Prog_Ref.pdf

for reference.

2
General Mach Discussion / Re: edit button scripts
« on: March 08, 2024, 09:50:27 AM »
pls post your code

3
General Mach Discussion / Re: I get this error massage
« on: February 23, 2024, 02:09:36 AM »
open the program with text editor and delete everythin before

(*** New file Started ***)

so that (*** is the first entry in the file and save it.

4
General Mach Discussion / Re: delay the start of processing
« on: February 14, 2024, 01:20:26 AM »
either way is ok.

5
General Mach Discussion / Re: delay the start of processing
« on: February 13, 2024, 12:42:31 PM »
time depends on setting in:

Config -> General Config -> General Cinfiguration -> G04 dwell in ms

if this is enabed also "delay spin up" will be in ms

6
Mach Screens / Re: simple numeric keyboard for input in DRO
« on: February 12, 2024, 02:31:48 AM »
ok like written earlier in this post, put this code:

Code: [Select]

Global value As String

'TPS 01.12.2017
'numerische Eingabe
Function NumericKeyboard(ByVal DRONum As Integer) As Double
Dim title As String
'value = GetOemDRO(DRONum)
title = Header


Begin Dialog UserDialog1 60,60, 195, 180, "Input:"  , .Enable

PushButton 10, 10, 25, 25, "7", .but7
PushButton 40, 10, 25, 25, "8", .but8
PushButton 70, 10, 25, 25, "9", .but9

PushButton 10, 40, 25, 25, "4", .but4
PushButton 40, 40, 25, 25, "5", .but5
PushButton 70, 40, 25, 25, "6", .but6

PushButton 10, 70, 25, 25, "1", .but1
PushButton 40, 70, 25, 25, "2", .but2
PushButton 70, 70, 25, 25, "3", .but3

PushButton 10, 100, 25, 25, ".", .butD
PushButton 40, 100, 25, 25, "0", .but0
PushButton 70, 100, 25, 25, "<-", .butB

PushButton 100, 10, 25, 25, "X", .butX
PushButton 100, 40, 25, 25, "Y", .butY
PushButton 100, 70, 25, 25, "Z", .butZ
PushButton 100, 100, 25, 25, "A", .butA

PushButton 130, 10, 25, 25, "F", .butF
PushButton 130, 40, 25, 25, "S", .butS
PushButton 130, 70, 25, 25, "M", .butM
PushButton 130, 100, 25, 25, "Sp", .butSp

PushButton 160, 10, 25, 25, "G", .butG

TextBox 10, 130, 175, 18, .FText
PushButton 10, 155, 40, 21,"OK", .OK
CancelButton 55, 155, 40, 21
End Dialog


Dim Dlg1 As UserDialog1

'Dlg1.FText = CStr(value)
Dlg1.FText = ""
x = Dialog( Dlg1 )

'NumericKeyboard = CDbl(Dlg1.FText)
If x <> 0 Then
'SetOEMDro(DRONum,CDbl(Dlg1.FText))
Code Dlg1.FText
End If
End Function

Function Enable( ControlID$, Action%, SuppValue%)

Select Case Action%
Case 1

Case 2 'Button wurde gerückt
If ControlID$ = "but0" Then
value = CStr(value) + "0"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but1" Then
value = CStr(value) + "1"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but2" Then
value = CStr(value) + "2"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but3" Then
value = CStr(value) + "3"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but4" Then
value = CStr(value) + "4"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but5" Then
value = CStr(value) + "5"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but6" Then
value = CStr(value) + "6"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but7" Then
value = CStr(value) + "7"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but8" Then
value = CStr(value) + "8"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but9" Then
value = CStr(value) + "9"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "butD" Then
   If InStr(1,value,".") = 0 Then
value = CStr(value) + "."
DlgText "FText", CStr(value)
Enable =1
   End If
End If
If ControlID$ = "butB" Then
value = Left(value,Len(value)-1)
DlgText "FText", CStr(value)
Enable =1
End If

If ControlID$ = "butX" Then
value = CStr(value) + "X"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "butY" Then
value = CStr(value) + "Y"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "butZ" Then
value = CStr(value) + "Z"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "butA" Then
value = CStr(value) + "A"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "butF" Then
value = CStr(value) + "F"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "butS" Then
value = CStr(value) + "S"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "butM" Then
value = CStr(value) + "M"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "butSp" Then
value = CStr(value) + " "
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "butG" Then
value = CStr(value) + "G"
DlgText "FText", CStr(value)
Enable =1
End If


If ControlID$ = "OK" Then
Enable = -1
End If
Case 3 'Text verändert
'MsgBox Dlg1.FText
Case Else
End Select

'Wert zurückgeben
If Enable = -1 Then
Enable = value
End If

End Function   


in a macro in your macrofolder like: C:\mach3\macros\your profile name\numerickeyboard.m1s

if you put following code into a transparent button over the X-axis dro
the code do edit x-axis would be:

Code: [Select]
Sub Main
call NumericKeyboard(800)

End Sub


#Expand <\..\..\macros\yourprofile\numerickeyboard.m1s>



call NumericKeyboard(800)

the red number is the OEMDro you want to edit.




7
G-Code, CAD, and CAM discussions / Re: Mach4 Lathe weird toolpath
« on: February 01, 2024, 11:11:18 AM »
somewhere in cofigation general you can switch IJ Mode absulute and incremental

8
for test place three simple Led's on your screen (1500,1501,1503)
to see the status of those three led's.
then you can witch is true or false.

9
so it looks like UserLed(1500) is false if you push the buttom

in this case If condition should look like this:
Code: [Select]
If ((GetUserLed(1500) = False) And (GetUserLed(1501) = True))  Then

10
if you go to

Operator -> Brain Control -> select your Brain -> view Brain

can you see the branch getting green when you press the external start button?

have you restarted Mach3 after you added code to macropump?
you have to do this every time you change macropump script.

add for test this code:
Code: [Select]
msgbox("i was here")
to macropump to chech that it's running.