Hello Guest it is March 29, 2024, 02:29:28 AM

Author Topic: Macro  (Read 4352 times)

0 Members and 1 Guest are viewing this topic.

Macro
« on: June 25, 2008, 04:53:52 AM »
Hi there people,

I need a bit of a hand editing the M3, M4 and M5 macros.

What I need to happen is when an M3 or M4 are called, a contactor to be brought in (there is one for each direction), a delay and then to bring a third contactor in which starts the drive.

and when the M5 is called for it to disable the drive contactor first and then bring out the direction contactor.

Many Thanks

Mike

Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: Macro
« Reply #1 on: June 25, 2008, 06:14:25 AM »
It is fairly simple to write,
At the moment the M3 and M4 put out seperate signals on seperate pins any how, so all that would be required is the addition of another signal to turn on the drive after the delay -  but  - it might be easier just writing a script using the output# pins to do the switching.

1. How are you going to control your contactors - are you using outputs through the LPT1 socket to drive intermediate relays to close the   contactors - or can you drive these contactors directly.
2. What is the timing on the delay - are we looking at the time for a relay to close or longer.

« Last Edit: June 25, 2008, 06:22:34 AM by jimpinder »
Not me driving the engine - I'm better looking.
Re: Macro
« Reply #2 on: June 25, 2008, 06:16:50 AM »
Yes the contactors are going to be controlled through one of the LPT's either 1 or 2 have not decided yet.

Yes the delay is just for the contactor to come in

Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: Macro
« Reply #3 on: June 25, 2008, 06:35:12 AM »
That was quick - I took my post back and added a bit - but you had replied anyway.

I think I would utilise the output# pins. If you look on Config/Ports and Pins/Output Pins - you can see that there are quite a few designated. So pick 3, one for forward, one backward, and one for motor on. You can then allocate these to whichever pins you want.

The program would then be:

Switch on direction relay pin
Delay
Switch on Drive relay pin
End

- and -

Switch off Drive Relay pin
Delay
Switch off pin
End

I don't know whether you have a list of the Vis Basic commands for use with Mach 3 but they are on the forum. I don't know the syntax off by heart so I will have to look them up.

You could put this post on the Vis Basic and the Brains forum - you might have a lot more people familiar with the syntax - particularly with Brains ( I have never done any - and they might be much simpler).

There are two Brains video tutorials you can watch, and one on scripting if you have never done any.

I get back to you when I have had a look - my wife says I've got to tidy the "shed" today. >:(


Not me driving the engine - I'm better looking.

Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: Macro
« Reply #4 on: June 25, 2008, 07:51:19 AM »
Got a quick half hour before lunch -

All three Macros in the one file. You will have to split them and post them in your Macro folder under M3, M4 and M5

Rather than using the original M3 DoSpin etc, I just got the macro to turn on Output 1,2 or 3 as required.

Now this works on my office computer - I haven't had it up and running on my workshop machine attaced to the  lathe or mill.

It turns the Outputs on and off - allocate the outputs to which ever pins you are using.

The delay time is in Milliseconds and can be altered to suit.
Not me driving the engine - I'm better looking.
Re: Macro
« Reply #5 on: June 25, 2008, 08:04:04 AM »
Thanks!

Looks simple now I see how you would do it.

I'll let you know how I get on.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Macro
« Reply #6 on: June 25, 2008, 08:57:17 AM »
Here is a "Brain" that does the same thing. If using Output1 as your M3, Output2 as M4, and Output3 to pull in your contactor.
Under Ports and Pins, under the spindle tab, you will have to enable "relays" Output1 for M3, and Output2 for M4.
Obviously, you would need to restore the M3, 4, and 5 macro to thier original states so they wont conflict with the brain.
The "Timer" delay is set to "1" second.

Brain attached,

Scott
fun times