Hello Guest it is June 15, 2025, 06:00:10 PM

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

0 Members and 1 Guest are viewing this topic.

Re: Macro/Script rodillos de sujeccion fresadora
« Reply #10 on: April 13, 2025, 03:44:47 AM »
With GetOEMDro(801), can I use it for the two functions shown in the attached files?

I need to work with those two, MaxY and MinY.

Offline TPS

*
  •  2,592 2,592
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #11 on: April 13, 2025, 03:46:44 AM »
i mean:

ActY = GetOEMDro(801)

it will not effect the Min and Max.
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 #12 on: April 13, 2025, 03:53:01 AM »
I need to compare the current position of the machine with the minimum and maximum Y values ​​in the G code, to raise or lower the rollers when they are close to the maximum and minimum Y limits.

Offline TPS

*
  •  2,592 2,592
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #13 on: April 13, 2025, 03:56:12 AM »
I need to compare the current position of the machine with the minimum and maximum Y values ​​in the G code, to raise or lower the rollers when they are close to the maximum and minimum Y limits.
that is what the code does? if you are using G54,G55 .. it should do it during you run your G-code program.
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 #14 on: April 13, 2025, 04:04:43 AM »
I'll try ActY = GetOEMDro(801).

Thank you.

If we are using G55 and G56
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #15 on: May 24, 2025, 01:26:34 PM »
Hi friend. How are you?

I can't get this macro to work properly, please help me.

It only activates output 10, but it's fixed and doesn't do what I need: deactivate when it reaches the limit.

It also never activates output 11, even though it's in the working position.

I'm uploading the code here for you to review. I think I'm missing some actions.

Offline TPS

*
  •  2,592 2,592
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #16 on: May 25, 2025, 03:01:20 AM »
there is still a bug in your script:

  rear lowering

should be:

  'rear lowering

witch i have written earlier, anyway you can copy this code:

Code: [Select]
'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+80) Then
ActivateSignal(OUTPUT10)
MsgBox "OUTPUT10 activated"
End If  
'front raising
If ActY > (MinYCoord+80) Then
DeActivateSignal(OUTPUT10)
MsgBox "OUTPUT10 deactivated"
End If  
'rear lowering
If ActY <= (MaxYCoord-80) Then
ActivateSignal(OUTPUT11)
MsgBox "OUTPUT11 activated"
End If  

'front raising
If ActY > (MaxYCoord-80) Then
DeActivateSignal(OUTPUT11)
MsgBox "OUTPUT11 deactivated"
End If  

into VB Scripter Window and use  >||  button to step through programm to see what is going on.

a GGode programm has to be loaded to have valid MinY and MaxY coords. then you can move y axis in manual and step throug programm again.
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 #17 on: June 06, 2025, 02:14:18 AM »
Hola, he escrito el código tal cual me lo ha enviado y no funciona. La maquina solo activa la salida 11, fija durante todo el mecanizado, sin subir cuando se acerca al limite. Y al finalizar el mecanizado activa las dos salidas 10 y 11.

Offline TPS

*
  •  2,592 2,592
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #18 on: June 06, 2025, 02:34:55 AM »
copy this code:

Code: [Select]
'Get the current values
ActY = GetOEMDro(801)
MinYCoord = GetOEMDro(5)
MaxYCoord = GetOEMDro(11)

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

into VB Scripter window and press the run button, then you will get a messagebox with coordinates
to see the real coordinates and post the  result
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 #19 on: June 06, 2025, 02:55:41 AM »
This mesag in the screen