Hello Guest it is April 29, 2025, 11:05:20 PM

Author Topic: LABEL WITH TOOL DESCRIPTION  (Read 11693 times)

0 Members and 1 Guest are viewing this topic.

Re: LABEL WITH TOOL DESCRIPTION
« Reply #20 on: March 07, 2025, 03:44:36 AM »
when I insert it new it tells me that before inserting the button I have to point to the image file by opening the search window...

Offline TPS

*
  •  2,574 2,574
Re: LABEL WITH TOOL DESCRIPTION
« Reply #21 on: March 07, 2025, 03:44:55 AM »
after insetring a "fresh" one just type 34 to standard code then select Standard Code -> Run basic script adjust position and size by mouse , done.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline TPS

*
  •  2,574 2,574
Re: LABEL WITH TOOL DESCRIPTION
« Reply #22 on: March 07, 2025, 03:48:17 AM »
in the MachScreen Properties input mask under Control, i select Image button transp, then i use
the Add button and click into the screen to place it, i get nothing asked
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: LABEL WITH TOOL DESCRIPTION
« Reply #23 on: March 07, 2025, 03:53:23 AM »
you are right, I was wrong because I inserted a normal image button and not a transparent image button. Thanks a lot for the help
Re: LABEL WITH TOOL DESCRIPTION
« Reply #24 on: March 07, 2025, 04:14:54 AM »
I share the code to make the write label command run only once in macropump
Code: [Select]
If GetUserLabel(123) = "" Then
    ' Leggi il numero utensile corrente
    Dim currentToolNumber As Integer
    currentToolNumber = GetDRO(24)
   
    ' Esegui il comando
    SetUserLabel(123, GetToolDesc(currentToolNumber))
   
    ' Aggiorna la variabile con il nuovo numero utensile
    lastToolNumber = currentToolNumber
End If

Offline TPS

*
  •  2,574 2,574
Re: LABEL WITH TOOL DESCRIPTION
« Reply #25 on: March 07, 2025, 04:17:26 AM »
I share the code to make the write label command run only once in macropump
Code: [Select]
If GetUserLabel(123) = "" Then
    ' Leggi il numero utensile corrente
    Dim currentToolNumber As Integer
    currentToolNumber = GetDRO(24)
   
    ' Esegui il comando
    SetUserLabel(123, GetToolDesc(currentToolNumber))
   
    ' Aggiorna la variabile con il nuovo numero utensile
    lastToolNumber = currentToolNumber
End If

but now it will not be updated if you change for example from tool1 to tool2?
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: LABEL WITH TOOL DESCRIPTION
« Reply #26 on: March 07, 2025, 04:19:30 AM »
and also the code that must always be inserted in macropump which both writes the label only once and changes the text of the label when the tool number changes when changing from the panel
Code: [Select]
' CODICE PRECEDENTE


' Definisci una variabile per memorizzare l'ultimo numero utensile (usa DRO 2005 come variabile persistente)
Dim lastToolNumber As Integer
lastToolNumber = GetoemDRO(1225) ' Leggi il valore persistente da DRO 1225

' Definisci una variabile per memorizzare il numero utensile corrente
Dim currentToolNumber As Integer

' Controllo del numero utensile all'inizio (solo se GetUserLabel(123) è vuoto)
If GetUserLabel(123) = "" Then
    ' Leggi il numero utensile corrente
    currentToolNumber = GetDRO(24)
   
    ' Esegui il comando
    SetUserLabel(123, GetToolDesc(currentToolNumber))
   
    ' Aggiorna la variabile persistente con il nuovo numero utensile
    SetDRO(1225, currentToolNumber)
    lastToolNumber = currentToolNumber
End If

' Controllo se il numero utensile è cambiato (solo se necessario)
currentToolNumber = GetDRO(24) ' Leggi il valore corrente
If currentToolNumber <> lastToolNumber Then
    ' Esegui il comando solo se il numero utensile è cambiato
    SetUserLabel(123, GetToolDesc(currentToolNumber))
   
    ' Aggiorna la variabile persistente con il nuovo numero utensile
    lastToolNumber = currentToolNumber
End If

' RESTO DEL CODICE
« Last Edit: March 07, 2025, 04:24:01 AM by Giuno85 »
Re: LABEL WITH TOOL DESCRIPTION
« Reply #27 on: March 07, 2025, 04:22:29 AM »
yes exactly I will use the first one because in my case the tool number cannot be changed from the panel using the transparent image button, but can only be changed from the M6 ​​tool changer.
obviously I have the label update done in the m6Start script
Re: LABEL WITH TOOL DESCRIPTION
« Reply #28 on: March 07, 2025, 04:23:16 AM »
anyway I also shared the code to be able to change the label by manually changing the number from the panel