Hello Guest it is June 15, 2025, 08:34:59 AM

Author Topic: Macro/Script rodillos de sujeccion fresadora  (Read 4624 times)

0 Members and 1 Guest are viewing this topic.

Re: Macro/Script rodillos de sujeccion fresadora
« Reply #20 on: June 06, 2025, 03:07:44 AM »
This image

Offline TPS

*
  •  2,592 2,592
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #21 on: June 06, 2025, 06:50:31 AM »
then there is a bug in line 15 of your code.
pls post excactly the code of the VB scripter window.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #22 on: June 06, 2025, 07:11:05 AM »
I've fixed the msg issue in the script.

The ActY takes data from the Yact machine, so it's invalid. We need MaxY and MinY from the G-code.


The code:

'Get the current values
ActY = GetOEMDro(801)
MinYCoord = GetOEMDro(5)
MaxYCoord = GetOEMDro(11)

MsgBox "ActY: " &ActY &" MinY: " &MinYCoord &" MaxYcoord; " &MaxYCoord



'front lowering
If ActY >= (MinYCoord) Then'<=
ActivateSignal(OUTPUT11)
End If
'front raising
If ActY <= (MinYCoord) Then'<=
DeActivateSignal(OUTPUT11)
End If
'rear lowering
If ActY >= (MaxYCoord) Then'<=
ActivateSignal(OUTPUT10)
End If
'front raising
If ActY <= (MaxYCoord) Then'>=
DeActivateSignal(OUTPUT10)
End If
 
   
      
If(GetInBit(90, 2)) And Not (GetOemLed(800)) Then
   Code(" G55")
   Espera
   If getDro (24) = 2 Then
      Code("G52 X-275.95 Y167.36 ")
      Espera
   End If
   If getDro (24) = 3 Then
      Code("G52 X-551.09 Y-2.87 Z0")
      Espera
   End If
   Espera

End If

If(GetInBit(90, 3)) And Not (GetOemLed(800)) Then
   Code(" G56")
   Espera
   If getDro (24) = 2 Then
      Code("G52 X-275.95 Y167.36 ")
      Espera
   End If
   If getDro (24) = 3 Then
      Code("G52 X-551.09 Y-2.87 Z0")
      Espera
   End If

End If
      
      
End

 ' -----------------------------------------------------------------------------
Sub Espera ()
   While IsMoving()
      Sleep(15)
   Wend
End Sub
' -----------------------------------------------------------------------------

                                                         

Offline TPS

*
  •  2,592 2,592
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #23 on: June 06, 2025, 11:38:40 AM »
if i load i simple G-code here i can see the Min/Max values from G-Code program in program limit's
this is what OEMDro(5) and OEMDro(11) are normaly showing.

and ActY is what this Axis DRO is showing
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #24 on: June 06, 2025, 01:08:31 PM »
If you look at the message generated in the VB script, the ActY value is the machine coordinate.

The MinY value refers to the minimum absolute machine coordinate.

Only the MaxY value is actually how we want to compare it with the MaxY in G code.

This is strange, since, as you say, 5 and 11 refer to G code.

Only OEM Dro 11 is working as we want.
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #25 on: June 07, 2025, 02:04:21 AM »
The OEMDRO 801 is a multifunction device that can be used for Machine Coordinates, Work, or DTG. How do we select one of these three functions?

Offline TPS

*
  •  2,592 2,592
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #26 on: June 07, 2025, 02:36:10 AM »
here:

https://www.machsupport.com/forum/index.php?topic=19482.0

you can download a list of all DRO's / OEMDro's

OEMDro(801) is the current Y-Coord
Dro(84) is Y-MachineCoord

and there a couple of other's

i usually allways use OemDro(801)

anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline TPS

*
  •  2,592 2,592
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #27 on: June 07, 2025, 02:43:52 AM »
maybe OEMDro(185) will do the job
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #28 on: June 08, 2025, 03:20:20 AM »
Okay, thanks, friend. The variables are correct. I don't understand why it's not collecting the information about the Gcode. Would it be possible to add an option so that it only starts executing these script functions after requesting the Gcode program to start?

Offline TPS

*
  •  2,592 2,592
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #29 on: June 08, 2025, 04:56:20 AM »
okay this is a version witch is only excecuted if Cycle Start LED is ON
Code: [Select]
'only if Start LED is only
If GetOEMLed(804) = True Then

'Get the current values
ActY = GetOEMDro(801)
MinYCoord = GetOEMDro(5)
MaxYCoord = GetOEMDro(11)

'front lowering
If ActY >= (MinYCoord) Then'<=
ActivateSignal(OUTPUT11)
End If
'front raising
If ActY <= (MinYCoord) Then'<=
DeActivateSignal(OUTPUT11)
End If
'rear lowering
If ActY >= (MaxYCoord) Then'<=
ActivateSignal(OUTPUT10)
End If
'front raising
If ActY <= (MaxYCoord) Then'>=
DeActivateSignal(OUTPUT10)
End If
End If
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.