Hello Guest it is January 14, 2026, 08:48:13 AM

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

0 Members and 1 Guest are viewing this topic.

Re: Macro/Script rodillos de sujeccion fresadora
« Reply #40 on: January 10, 2026, 10:40:22 AM »
That's how I have it configured, but it activates the output after pressing reset, it's very strange

Look at the photo: output 0. I just opened Mach3 and pressed reset, and output 0 activated, referring to the spindle.

Offline TPS

*
  •  2,622 2,622
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #41 on: January 10, 2026, 10:48:48 AM »
it is excactly happening what i told you.

you have assigned Enable1 to port 10 pin 0 witch is CSMIO/S output 0
and this will be enabled after reset E-Stop

in Spindle Setup you have assigned Output#1 for Spindle Clockwise
so you have to go to Config -> Ports&Pins -> Output Signal's
and enable Output#1 and set port 10 pin 0

AND disable Enable1 set port and pin to 0
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 #42 on: January 10, 2026, 10:53:23 AM »
That's right, what a silly mistake! Haste makes waste.

Thanks a million!

Another question: I need to program the machine so that when I press one button, it starts the start cycle with code G54. When this cycle finishes, pressing another button starts the cycle with code G55, allowing me to work in two different areas.

Can you help me?

Offline TPS

*
  •  2,622 2,622
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #43 on: January 10, 2026, 10:55:34 AM »
a screen button or a hardwarebutton?
allways the same program (program name)?
or start the manually loaded program?

« Last Edit: January 10, 2026, 11:02:07 AM by TPS »
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 #44 on: January 10, 2026, 11:11:53 AM »
A physical button, activated by an electrical pulse. First, the desired G-code is loaded. Then, using the physical buttons on the machine, the work area is selected.

I've seen a machine that does that function; they've programmed it inside a macropump, but I don't quite understand where to wire it. I've attached an example.



Offline TPS

*
  •  2,622 2,622
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #45 on: January 10, 2026, 11:31:06 AM »
OK,
goto Config -> Ports&Pins -> Input Signal's
and enable  OEM Trig#1 and OEM Trig#2 then assign Port and Pin from CSMIO input's you want to use.

then goto Config -> General Config
now have a look for Initialitazion String and put M333 with a space before at the end

next goto Config -> System Hotkeys
on the right side (External Buttons - OEM Codes)
enter for 1 and 2 the number ->  301

now create a textfile in your macrofolder with the
name M333.M1S
copy and paste this code into the file:
Code: [Select]
' assign Triggermacro
' needs to be added to Initialisation String
Sub Main
SetTRiggerMacro 334   'assing Macro M334 for OEM-Code 301
Message ("Triggermakro 334 set")
Sleep(200)
End Sub


now create a textfile in your macrofolder with the
name M334.M1S
copy and paste this code into the file:
Code: [Select]
' check OEMTrigger
' called by OEM Code 301

Sub Main
message "button 1 (G54) has been pressed"
If IsActive (OEMTRIG1) Then         
Code("G54")
' Run loaded G-Code
RunFile()
goto ende
End If
message "button 2 (G55) has been pressed"
If IsActive (OEMTRIG2) Then         
Code("G55")
' Run loaded G-Code
RunFile()
goto ende
End If

ende:
End Sub


that's it.
be careful not tested just written down

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 #46 on: January 10, 2026, 12:00:55 PM »
Ok, i need input a M code in the g-code?

Offline TPS

*
  •  2,622 2,622
Re: Macro/Script rodillos de sujeccion fresadora
« Reply #47 on: January 10, 2026, 12:03:15 PM »
no, nothing extra in G-Code needed.

the macro M334 will "switch" G54 and G55 and start the loaded  G-Code file.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.