Hello Guest it is April 24, 2024, 05:15:23 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 - TPS

1
General Mach Discussion / Re: Read in DRO continuously
« on: April 14, 2024, 05:16:46 AM »
there are two ways to do this.

1st use macropump macro witch is running (if activated in Config -> General Config) where you can place your
code and it will be excecuted arround every 10ms

2nd you can make a brain (Operator -> Brain Editor, the use Operator -> Brain Control to activate)
witch will be excecuted faster.

2
without knowing the exact hardware of your control box it will be hard to help.
maybe this:

https://www.youtube.com/watch?v=tYulWcAqjR4

can help.

3
VB and the development of wizards / Re: system command in the gcode
« on: March 30, 2024, 12:52:17 PM »
this is creating a string with date time xcoord ycoord zcoord

Code: [Select]
mystring = Date() & "_" & Time() & "_X_" & GetOEMDRO(800) & "_Y_" & GetOEMDRO(801) & "_Z_" & GetOEMDRO(802)

msgbox mystring

4
from Mach3_V3.x_Macro_Prog_Ref.pdf:

Code: [Select]
'Example:
‘ This macro expects three arguments: P, Q, & R
‘ If put into an M-macro, and invoked via MDI, it will
‘ display the argument values on the status line
‘ For example, if using M1200:
‘ M1200 P1.234 Q2.345 R3.456
‘ Executing the above line to MDI will display:
‘ P=1.234 Q=2.345 R=3.456
Parg = Param1()
Qarg = Param2()
Rarg = Param3()
Message “P=” & Parg & “Q=” & Qarg & “R=” & Rarg

5
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.

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

7
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.

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

9
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

10
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.