Clayton,
Eu encontrei num site alemão um exemplo de uso...
Nma macro chamada M333.m1s se escreve:
SetTRiggerMacro 334 'Setzt Makro M334 bei OEM-Code 301
dooembutton (327) 'MPG Jog Mode
DoOEMButton (303) 'Geschwindigkeits-Modus Handrad
dooembutton (119)
O cara diz que ajustou o OEMTrigger #2 para 301
Na macro M334.m1s:
Sub Main()
' -------------------------------------------------------------------------------
'
Handrad Makro 05.09.2008 (c) Gerhard Günzel
' -------------------------------------------------------------------------------
'
' Aktive Achse Nullen wenn Taste ZERO gedrueckt ist
'
If IsActive (OEMTRIG2) and getoemled (59) Then 'Zero Taste und X aktiv
'msgbox "Setze X auf NULL" 'Auskommentieren zum Test
dooembutton (1008) 'Setze X auf NULL
goto ende
End If
if IsActive (OEMTRIG2) and getoemled (60) Then 'Zero Taste und Y aktiv
'msgbox "Setze Y auf NULL"
dooembutton (1009) 'Setze Y auf NULL
goto ende
End If
if IsActive (OEMTRIG2) and getoemled (61) Then 'Zero Taste und Z aktiv
'msgbox "Setze Z auf NULL"
dooembutton (1010) 'Setze Z auf NULL
goto ende
End If
'
' Achse umschalten und zugehoerige LED am Handrad an
'
DoOEMButton (175) 'MPG-Achse wechseln
If getoemled (59) Then
DoOEMButton (233) 'OUTPUT 4 an, Button 233
DoOEMButton (236) 'OUTPUT 5 aus
DoOEMButton (238) 'OUTPUT 6 aus
End If
If getoemled (60) Then
DoOEMButton (235) 'OUTPUT 5 an
DoOEMButton (234) 'OUTPUT 4 aus
DoOEMButton (238) 'OUTPUT 6 aus
End If
If getoemled (61) Then
DoOEMButton (237) 'OUTPUT 6 an
DoOEMButton (234) 'OUTPUT 4 aus
DoOEMButton (236) 'OUTPUT 5 aus
End If
goto ende
ende:
End Sub
Outro exemplo de uso:
1. Create a macro that contains a single line "Beep". Let's call this m952.m1s.
2. Create another macro containing the single line "SetTriggerMacro(952)". Let's call this m951.m1s.
3. Add "M951" to the initialization string in the config section. This will cause the m951 macro to be called during Mach3 initialization, which is turn will set the trigger macro to macro 952.
4. Set "Trigger #1" in the system hotkeys setup to 301. Whenever the #1 is triggered, this will cause the trigger macro to be called, which in this case is m952 which does nothing but "Beep".
5. To enable trigger #1, Enable the "OEM Trig#1" in the "Ports & Pins" by setting it to the exact setting of the probe.
6. Restart Mach3. Your computer should now beep every time you touch your probe to your bit.