Hello Guest it is May 28, 2025, 03:27:03 PM

Author Topic: Macro/Script rodillos de sujeccion fresadora  (Read 2693 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,585 2,585
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,585 2,585
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,585 2,585
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.