Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Fastest1 on March 31, 2010, 04:23:36 PM

Title: How do you use the macro in VB Script Editor?
Post by: Fastest1 on March 31, 2010, 04:23:36 PM
So I am back with the tool changer macro. Upon opening the correct macro with the Vb script editor, what do I do with it from that point? Save it? Are the arrows and run buttons supposed to do something in this state? If I try to press the (what would appear to be a play button) all it says is "syntax error". I was under the impression that Mach needs to be closed and restarted right after this particular step and that the macro would run upon the next start. Is that right?
Title: Re: How do you use the macro in VB Script Editor?
Post by: Hood on March 31, 2010, 04:33:04 PM
If you are getting a syntax error it will not run, attach the VB and someone will be able to find the problem, I am not great at VB but will have a look and if its simple I may see the problem ;D

Hood
Title: Re: How do you use the macro in VB Script Editor?
Post by: Fastest1 on March 31, 2010, 05:50:08 PM
Is this it?
Title: Re: How do you use the macro in VB Script Editor?
Post by: Hood on March 31, 2010, 06:12:49 PM
Ok try this file. Download to desktop then rename it to M6Start.m1s and copy and paste it into the macro folder of the profile you use.
Hood
Title: Re: How do you use the macro in VB Script Editor?
Post by: Fastest1 on March 31, 2010, 07:13:45 PM
Hood, I dont have time to try it til later this evening. I know how to load it into my profile just fine. My real question is after opening it with the VB script editor, what is the proper process for closing it or saving it? And dont I have to restart Mach after loading that file? Then it works upon restarting? That is how I understand it.
Title: Re: How do you use the macro in VB Script Editor?
Post by: Hood on March 31, 2010, 07:19:44 PM
You dont need to open it in the editor unless you are wanting to edit it or look at it, just placing it in the macro folder of your profile is all you need to do (apart from renaming ;) ) If you do open and edit you can either just close and you will be asked if you want to save or you can choose the save icon or save from file menu.
You dont need to restart Mach for a macro as it is only accessed when called. The macropump requires a restart as it is loaded at startup and runs continuously in the background, so that may be what you are thinking about?

Hood
Title: Re: How do you use the macro in VB Script Editor?
Post by: Fastest1 on March 31, 2010, 09:54:42 PM
Hood, you got me going another step forward! I can seem to address the toolchanger in that profile though there are problems. Problem 1 seems that now I cant jog any axis' in that profile, jogging works in other profiles. Also I can only call tools by tool number not offset, ie M6 T1 will get tool 1. M6 T1  01 or M6 T101 neither get any response or tool number changes. Using the T and a number under 6 changed the tool number before, though the carousel didnt move, now neither happens. When I advance to the next tool and I select between 2 tools or more repeatedly upon backing up onto the pawl it must lose some steps (which I was aware of) however maybe the dro should change to the corresponding degree (multiple of 60 depending on tool selected) as I seem to lose about 10 degrees per change. Eventually it doesnt pass the pawl and still backs up. But we are moving the toolchanger as requested!
Title: Re: How do you use the macro in VB Script Editor?
Post by: Hood on April 01, 2010, 02:16:42 AM
Is this a lathe you have? Just when you say carousel it sounds like it may actually be a mills toolchanger?
Hood
Title: Re: How do you use the macro in VB Script Editor?
Post by: Fastest1 on April 01, 2010, 07:38:50 AM
Hood, yes it is a lathe with a 6 position rotary tool changer.
Title: Re: How do you use the macro in VB Script Editor?
Post by: Hood on April 01, 2010, 07:48:34 AM
Can you attach your xml please.
Hood
Title: Re: How do you use the macro in VB Script Editor?
Post by: Fastest1 on April 01, 2010, 10:56:03 AM
It would nice to be able to. Every time I try to post a file, it comes back with" there is already a file with that name".
Title: Re: How do you use the macro in VB Script Editor?
Post by: Hood on April 01, 2010, 11:29:10 AM
Thought that might be the case, you are using a mill profile so T101 wont work, you need to use a Turn profile. On a Mill you call M6T1 for the tool and G43H1 for number 1 length offset.
Hood
Title: Re: How do you use the macro in VB Script Editor?
Post by: Fastest1 on April 01, 2010, 11:42:54 AM
Are you saying I built that xml from a milling profile? I sure thought when I assembled it, it was a profile created from Mach3turn? Why did it work just prior to my inserting the toolchanging macro (toolchanger didnt work with M commands but did revolve via the keyboard though now I will have to see what it calls the rotary axis, I would think it would be referred to as A?). If it is as simple as moving the values to a different profile I dont see a problem, but I still cant figure out why it changed. When inserting the new M6Start file, I did delete the old 1 instead of renaming it. That is all I can think of but I wouldnt have thought it jeopardized the jogging control.
Title: Re: How do you use the macro in VB Script Editor?
Post by: Hood on April 01, 2010, 11:47:46 AM
Just to make sure you never attached the wrong xml open up your  turn profile and have a look at ports and pins and see what it says, if it says Mill options then its a mill profile.
Hood
Title: Re: How do you use the macro in VB Script Editor?
Post by: Fastest1 on April 01, 2010, 05:59:18 PM
I will have to look into it. Could I have dragged and dropped the xml into the wrong profile? Or could I move it over into a turn profile now or have to rebuild thru the turn profile.
Title: Re: How do you use the macro in VB Script Editor?
Post by: Hood on April 01, 2010, 06:02:19 PM
I think you will have to open a turn profile and start from scratch I am afraid.
Hood
Title: Re: How do you use the macro in VB Script Editor?
Post by: Fastest1 on April 01, 2010, 11:57:10 PM
I got most of it done. Still a little bit to do. Oddly enough if I used the "create profile" as the mach3turn was highlighted it took at least 5 trys for it to open with the correct profile, most of the time it was mill? Finally got 1 with turn options and modified it. I ended up dumping the Mach and reinstalling fresh. Though on the lathe screen I can only tell what the tool number is, not the position of the carousel. It isnt a problem as my spindle motor is about to change and I am really just trying to dial it all in with Mach. Learning how to set soft limits. I do have switches  at 1 end of both axis. Seem to work well. I did get my touch screen mounted on an articulating arm though! Thanks as always!
Title: Re: How do you use the macro in VB Script Editor?
Post by: Hood on April 02, 2010, 02:27:37 AM
No offset DRO is one of the things that I am looking forward to in Rev4 of Mach. Softlimits in Turn dont work properly either and again should be fixed in Rev4, its not something I am too bothered about but I know others are.

Hood