Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 12:52:32 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  How to write macro to control two spindle motor ?
Pages: 1   Go Down
Print
Author Topic: How to write macro to control two spindle motor ?  (Read 483 times)
0 Members and 1 Guest are viewing this topic.
mongkol
Active Member

Offline Offline

Posts: 13


View Profile
« on: August 11, 2011, 08:18:02 AM »

Hello,
I need the help. Right now I have two spindle on Z- axis. If I fill MDI on mach3 screen with M03,two spindles will rotate simultaneously.
I  want to control two spindles independently. I don't know how to write macro.
I mean if I write M101,the A spindle will rotate but the B spindle will not.
           If I write M102,the B spindle will rotate but the A spindle will not.

Pls advise me how to write VB macro

Mongkol
Logged
BR549
Active Member

Offline Offline

Posts: 2,557


View Profile
« Reply #1 on: August 11, 2011, 09:38:13 AM »

Looks like you have every thing you need now.  M3 turns on both, M101 turns on A,  M102 turns on B. What other possible combos are there??

Just a thought(;-) TP
Logged
mongkol
Active Member

Offline Offline

Posts: 13


View Profile
« Reply #2 on: August 11, 2011, 09:46:00 AM »

TP,
Thanks for the reply. I don't know how to write VB macro on M101 and M102. Pls advise.

Mongkol
Logged
stirling
Global Moderator
*
Offline Offline

Posts: 1,190

UK


View Profile WWW
« Reply #3 on: August 12, 2011, 04:31:58 AM »

Hello,
I need the help. Right now I have two spindle on Z- axis. If I fill MDI on mach3 screen with M03,two spindles will rotate simultaneously.
I'll assume you have BOTH spindles activated/connected via OUTPUT1.

First connect your second spindle to OUTPUT6 (for example) instead.

Now M03 will only activate spindle 1.

Now create another macro (say) M102 with this line...

activateSignal(OUTPUT6).

Then ADD the following to M05

deactivateSignal(OUTPUT6)

Now M03 will turn on spindle 1 and M102 will turn on spindle 2 and M05 will turn off whichever one/or both is on.

(remember to setup OUTPUT6 (or whichever) in ports n pins)

Cheers

Ian
Logged
BR549
Active Member

Offline Offline

Posts: 2,557


View Profile
« Reply #4 on: August 12, 2011, 10:28:09 AM »

OK I get what you mean now,sorry.  I think Stirling has you covered on this one.

(;-) TP
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!