Hello Guest it is April 24, 2024, 11:31:42 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 - birillo1959

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 »
1
VB and the development of wizards / macro fix help
« on: February 20, 2024, 06:00:25 AM »
Good morning
I found a macro on the net, I adapted it to my needs, from the tests I did it seems to work, but since it is not within my capabilities I would like to be sure of its functioning without having problems. I wonder if someone (much more capable than me) could check it for me and possibly correct it.
I thank anyone who can help me. Regards
Code: [Select]
Sub Main()
Dim Title As String
Begin Dialog TextBoxSample 250,15,180,335," RICERCA ANGOLO  > "
Picture 25, 5, 130, 130, "c:\mach3\bitmaps\Ita_Screenset\ANGOLO2.bmp"
OKButton 30,312,40,15
CancelButton 100,312,40,15
  GroupBox 5,140,170,165,"-- RICERCA ANGOLO",.GroupBox1 
TextBox 15,160,25,12,.XPlateWidth
   Text 45,162,128,8,"SPESSORE PIASTRA LATERALE X"                
TextBox 15,178,25,12,.YPlateWidth
   Text 45,180,128,8,"SPESSORE PIASTRA LATERALE Y"                                    
TextBox 15,196,25,12,.Xrepos
   Text 45,198,125,8,"SPOSTAMENTO LATERALE X"              
TextBox 15,214,25,12,.Yrepos
   Text 45,216,125,8,"SPOSTAMENTO LATERALE Y"              
TextBox 15,232,25,12,.PlateHeight
   Text 45,234,128,8,"ALTEZZA PIASTRA "              
TextBox 15,250,25,12,.ProbeDiameter
   Text 45,252,80,8,"DIAMETRO PROBE"
   Text 55,272,80,8,"###   VELOCITA'   ###"            
TextBox 15,288,25,12,.Velo
   Text 42,290,110,8,"<--  VELOCE        PIANO  -->"        
TextBox 140,288,25,12,.Pian    
  End Dialog
Dim Dlg1 As TextBoxSample
'Default Settings
  Dlg1.Xrepos = 25     'Distanza per spostare X- prima di spostarsi verso il basso per la sonda
Dlg1.Yrepos = 25     'Distanza per spostare X- prima di spostarsi verso il basso per la sonda
Dlg1.XPlateWidth = 0    'SPESSORE LATERALE X
Dlg1.YPlateWidth = 0    'SPESSORE LATERALE Y
Dlg1.PlateHeight = 5 'ALTEZZA PIASTRA
Dlg1.ProbeDiameter = 3.0 'DIAMETRO PROBE
Dlg1.velo = 150          'VELOCITA' VELOCE
Dlg1.Pian = 40        'VELOCITA' PIANO

Button = Dialog (Dlg1)
If Button = 0 Then Exit Sub
Xrepos = Val(Dlg1.Xrepos)
Yrepos = Val(Dlg1.Yrepos)
XPlateWidth = Val(Dlg1.XPlateWidth)
YPlateWidth = Val(Dlg1.YPlateWidth)
PlateHeight = Val(Dlg1.PlateHeight)
ProbeDiameter = Val(Dlg1.ProbeDiameter)
velo = Val(Dlg1.velo)
Pian = Val(Dlg1.Pian)

Cutter_Size = ProbeDiameter
Cutter_Size2 = Cutter_Size/2

Plate_X_Offset = XPlateWidth
Plate_Y_Offset = YPlateWidth
Plate_Z_Offset = 0

Plate_X_Offset1 = -1*(Plate_X_Offset+Cutter_Size2)
Plate_Y_Offset1 = -1*(Plate_Y_Offset+Cutter_Size2)

Message( "Probing routine initialized" )

If IsSuchSignal (22) Then
SetDRO(0,0) 'set X DRO a Zero
SetDRO(1,0) 'set Y DRO a Zero
SetDRO(2,0) 'set Z DRO a Zero
Sleep 10
code "G90"

'Z Probing
code "G31 Z-30 F" & velo
While IsMoving()
Wend
Sleep 50
code "G0 G91 Z1"
While IsMoving()
Wend
code "G31 Z-10 F" & Pian
While IsMoving()
Wend
ZProbePos = GetOEMDRO(802)
code "G90"
code "G0 Z" &ZProbePos
While IsMoving()
Wend
Call SetDro(2, Plate_Z_Offset)
Sleep 100
code "G0 Z5"
End If

'Y Probing
If IsSuchSignal (22) Then
code "G0 Y-" & Yrepos
code "G0 Z-8"
code "G31 Y5 F" & velo
While IsMoving()
Wend
Sleep 50
code "G0 G91 Y-3"
While IsMoving()
Wend
code "G31 Y5 F" & Pian
While IsMoving()
Wend
YProbePos = GetOEMDRO(801)
code "G90"
code "G0 Y" &YProbePos
While IsMoving()
Wend
Call SetDro(1, Plate_Y_Offset1)
Sleep 100
code "G0 Y-18"
code "G0 Z5"
code "G0 Y10"
End If

'X Probing
If IsSuchSignal (22) Then
code "G0 X-" & Xrepos
code "G0 Z-8"
code "G31 X5 F" & velo
While IsMoving()
Wend
Sleep 50
code "G0 G91 X-3"
While IsMoving()
Wend
code "G31 X5 F" & Pian
While IsMoving()
Wend
XProbePos = GetOEMDRO(800)
code "G90"
code "G0 X" &XProbePos
While IsMoving()
Wend
Call SetDro(0, Plate_X_Offset1)
Sleep 100
code "G0 X-18"
code "G0 Z10"
End If

Sleep 100

code "G0 X0.0"
code "G0 Y0.0"

While IsMoving()
Wend
z=GetOEMDRO(802)
z=Z+PlateHeight
SetOEMDRO(802,z)
Message( "Probing routine complete" )

End Sub

2
General Mach Discussion / Re: delay the start of processing
« on: February 13, 2024, 01:10:26 PM »
ok, actually in "Config -> General Config -> General Cinfiguration -> G04 dwell in ms" it is enabled, do you recommend disabling it or entering 5000?
thanks for the reply regards

3
General Mach Discussion / delay the start of processing
« on: February 12, 2024, 12:51:29 PM »
Good morning
I would like to delay the processing after turning on the spindle (m3) to give it time to reach the spindle revolutions. I tried in " config \port and pins\spindle setup\cv delay spin up and cw delay spin down) to insert various values from 1 to 10 but nothing changes
I'll start by saying that I use UC400ETH, Windows XP everything else works fine, is it possible to modify M3, any ideas/suggestions?
any advice is welcome.

4
yes, with the output from the VFD I control another relay for the pump
Greetings

5
Good morning
I (in my small way) connected it directly to the HUANYANG VFD
It has a built-in relay which when active the spindle trips and the pump starts
Greetings

6
VB and the development of wizards / center piece modification
« on: December 30, 2023, 06:51:21 AM »
Good morning
I found this macro on the net (JIM TAYLOR) for the center of the piece and it works well (for me) I tried to modify it to insert the parameters, I also used " #5= question......" but it doesn't work (don't laugh !!!!), if possible I would like to use a screen to enter the data, since it is not in my skills (I understand very little about programming) is there any soul who can help me?

Code: [Select]

;Set the monitor variables to zero
#1=0
#2=0
#3=0
#4=0

#5=180 (X-rh)
#6=0 (X-lh)
#7=200 (Y-top)
#8=0 (Y-bot)
#9=0 (good x-ctr)
#10=0 (good Y-ctr)
#17=0 (Z-ref)
#18=4 (edge clearances)

#11=[[#5-#6]/2] (nominal X-value of block center)
#12=[[#7-#8]/2] (nominal Y-value of block center)
#13=-3.5 (some Z-value below the block surface)
#14=3 (probe tip radius)

#15=[#5-#6] (nominal width X-dir)
#16=[#7-#8] (nominal height Y-dir)

;move to nominal block center
G0 X#11 Y#12 (move to nominal block center)
G31 Z-50 f50 (probe Z-ref)
G0 Z[#2002+2] (move above block)
#17=#2002

;probe +X side of block
g0 X[#11+#15/2+#14+#18] (move past +X-edge)
g0 Z[#13+#17] (descend below surface)
G31 X[#11 - #15] (probe +X side of block)
#5=[#2000-#14]     (RH edge)
g0 Z[#17+2]

;move to nominal block center
G0 X#11 Y#12 (move to nominal block center)

;probe -X side of block
g0 X[#11-#15/2-#14-#18] (move past -X-edge)
g0 Z[#13+#17] (descend below surface)
G31 X[#11 + #15] (probe -X side of hole)
#6=[#2000+#14]     (LH edge)
#9=[[#5 + #6] / 2.0]    (good X-block center)
g0 z[#17+2]
#1=[#5-#6] (+RH edge + -LH edge - +tool dia = Xwidth)

;################################################

;move to nominal block center
G0 X#9 Y#12 (back to center of block)

;probe +Y side of block
g0 Y[#12+#16/2+#14+#18] (move past +Y-edge)
g0 Z[#13+#17] (descend below surface)
G31 Y[#12 - #16]
#7=[#2001-#14]     (Top edge)
g0 Z[#17+2]

;move to nominal block center
G0 X#9 Y#12 (back to center of block)

;probe +Y side of block
g0 Y[#12-#16/2-#14-#18] (move past -Y-edge)
g0 Z[#13+#17] (descend below surface)
G31 Y[#12 + #16] (probe -Y side of block)
#8=[#2001+#14]     (Bot edge)
#10=[[#7 + #8] / 2.0]                           (good Y-value block center)
g0 Z[#17+2]
#2=[#7-#8] (Top edge - Bot edge - tool dia = Yheight)

g0 x#9 y#10 (go to XYctr)
M30

7
VB and the development of wizards / Re: DRO reading
« on: December 04, 2023, 01:31:43 PM »
ok TPS, it works perfectly, thanks!!!!!!
yes it's true I had the same problem some time ago
it was for saving in scan, honestly I tried
to modify it (and I wasted a lot of time!! ) but I didn't succeed
It's not within my knowledge, maybe for her it's simple, for me it's very complicated!!!!!!
thanks again, regards

8
VB and the development of wizards / DRO reading
« on: December 04, 2023, 11:41:09 AM »
Good evening
having the need to see the read the dro in the bar
I put the following line in the script:
Message "X = " & GetOemDRO(800)
it works fine, but in the display it gives me a series of numbers
after the point, I'll try to explain better if the value of the dro is
"77,340"
in the bar I see:
"77.340000001242"
I ask anyone who is capable (since I am not) if it is possible to shorten the figures e.g.: 77,340.
I thank anyone who can help me
Greetings

9
VB and the development of wizards / virtual keyboard
« on: December 03, 2023, 04:47:08 AM »
Good morning
I have a problem with this virtual keyboard connected to the network (TPS),
the problem is the following:
I insert (in the same line) x37.22 y22.
here comes the problem at the second point comes out and moves the cnc
Since it's not within my capabilities and skills, is there anyone who can correct it?
I thank anyone who can help me
Greetings

  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

10
VB and the development of wizards / Re: change virtual keyboard
« on: October 12, 2023, 05:03:08 AM »
TPS thanks for your help, once again you solved my problem !!!!!!!!!! works well.
Greetings

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 »