Hello Guest it is March 29, 2024, 03:19:50 AM

Author Topic: Why doesn't the Shuttle-Plugin start a macro correctly?  (Read 2882 times)

0 Members and 1 Guest are viewing this topic.

Why doesn't the Shuttle-Plugin start a macro correctly?
« on: January 05, 2008, 06:39:01 PM »
Hey there...

I have a question regarding the Shuttle-Plugin and it's ability to start Macros...

A mate wrote a macro for me to switch through the Jog-Steps. I know, i can switch through the Jog-Steps already, but i want to have only three Jog-Steps (1mm, 0,1mm, 0,01mm) and not 10(!) of them.
And if you repeat the 1 0,1 0,01-thing you have 1mm at the end AND at the beginning of the 10 Steps.

So, to avoid errors when switching through the steps, a mate wrote a macro for me that does what i need, switch from1 to 0,1 to 0,01mm and then start over
The Macro:

'M1.m1s

Sub Makro1()


If GetOEMDRO(828) = 1 Then
SetOEMDRO(828,0.1)
Message("Jog Step auf 0.1 gesetzt")

Else
If GetOEMDRO(828) = 0.1 Then
SetOEMDRO(828,0.01)
Message("Jog Step auf 0.01 gesetzt")

Else
If GetOEMDRO(828) = 0.01 Then
SetOEMDRO(828,1)
Message("Jog Step auf 1 gesetzt")

Else
MsgBox("!Achtung! Jog Step steht nicht auf 1 oder 0.1 oder 0.01")


End If
End If
End If

End Sub
   
The macro is stored as M1.m1s in the Macro-Folder of the profile i use (and in every other macro-folder in the meantime...)

And if i run the macro directly from the VB-Editor it does, what it is supposed to do, it switches from 1 to 0,1 and then to 0,01mm, every time i run it.

BUT:
If i try to run the macro with the shuttle-plugin (Defined a button as "Custom Macro Number 1" and entered the integer "1" in the Custom-Macro-Number-1-field) nothing happens...?

So, what do i do wrong?
For example, if i enter the integer "4" in the macro-field and then press the button, the spindel starts (what complies with M4.m1s)

So:
The macro itself does work (from VB-Editor)
The Plugin starts Macros (the M4-Spindel-Start-macro)

But the Plugin won't start my M1-Macro!

What the ...?

Can anyone help me with this problem?

Regards,

Marc
P.S. Sorry for my bad english, but it is a long time ago since school^^
Plz excuse my english, I'm german :-D
Re: Why doesn't the Shuttle-Plugin start a macro correctly?
« Reply #1 on: January 08, 2008, 04:42:46 PM »
Marc,
Good post.  This question deserves a bump.  I'm interested in the answer too.
Dave
Re: Why doesn't the Shuttle-Plugin start a macro correctly?
« Reply #2 on: January 08, 2008, 04:56:24 PM »
It's getting stranger and stranger...

Incited by your post i decided to do some further research and testing.
And then i found a post in this forum, where someone described how to start a macro with the shuttle (exactly the way i did, BUT it was named M650.m1s instead of m1.m1s)

So i renamed the macro in M650.m1s , changed the settings in the plugin and...

IT WORKS!!!

Maybe it needs 3 numbers to work?
Plz excuse my english, I'm german :-D