Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: sanlee on January 23, 2008, 01:17:50 AM

Title: Configuring Start Button as Push Button
Post by: sanlee on January 23, 2008, 01:17:50 AM
Dear All

I have 3-Axis CNC Machine running by Mach3. Now while taking production on the machine every time my operator has to press start Button from the Screen using the Mouse. I would like to configure this start button from the outside and want to give Push Button. so that operator does not have to press start button from the PC screen using the mouse. he can simply press the start button which is provided at the external like i have provide an Emergency Button. Can any body help me that how can i configure this start button from the externally.

Thanks

Sanlee
Title: Re: Configuring Start Button as Push Button
Post by: Hood on January 23, 2008, 03:37:09 AM
In Ports and Pins, Inputs set it up as an OEM trigger by asigning the pin you have it connected to, then go to config menu then system hotkeys and for the OEM trigger, you have is asigned to,  just put 1000 in the box, that should work.
Hood
Title: Re: Configuring Start Button as Push Button
Post by: corydoras on January 23, 2008, 03:40:33 AM
Sure no problem.

If you are familiar with the connection of switches to designated pins/inputs on your port, then it is just an easy config in mach3 that is left.

Assign your port and pin number in the ports and pins input section.
Use input for OEM trigger#1 (if you dont ahve any ather assigned to this)

Go to System Hotkeys and type in OEM code 1000 in the OEM input field 1

I am writing this at work and do not have the mach screen in front of me, so I think this is how it is done.

If not I´ll look in to it later tonight

Best reg
Cory
Title: Re: Configuring Start Button as Push Button
Post by: corydoras on January 23, 2008, 11:05:35 AM
He he, you beat me hood by 3 min:)

Cory
Title: Re: Configuring Start Button as Push Button
Post by: sanlee on January 25, 2008, 07:51:03 AM
Thank you Cory and Hood

It works very nicely.

Sanlee
Title: Re: Configuring Start Button as Push Button
Post by: sanlee on January 25, 2008, 08:07:49 AM
Hello Dear

Can you tell me how can i use any Output from Output#1 to 10 as OEM. I have used output#1 as spindle on. actually i have one specific application where my spindle is running in two different RPMs. initially when job is started spindle motor is running arround 5000 rpm and after certain job is completed if i turn ON one relay then it will reduce the splindle rpm by 2500. actually my splindle motor is double winding type. now my question is that how can i control that relay? also it has to be cut off after my turning is over and my splindle will run at 5000 rpm.

Thanks

Sanlee
Title: Re: Configuring Start Button as Push Button
Post by: poppabear on January 25, 2008, 08:24:33 AM
That will depend on how you want to control the reley.......

Do you want a Spindle speed change button? In where you push the button and it drops the speed or raises the speed?
OR
do you want the spindle speed change reley to activate at a certain spindle RPM automatically?
Or
do you want the Spindle Reley to respond to custom M-codes in your Gcode interpreter?
OR
Do you want some combination of all the above?  There are many, many ways to do what you want, but you need to define what it is you want exactly.

M5 Will shut off your spindle

Scott
Title: Re: Configuring Start Button as Push Button
Post by: sanlee on January 27, 2008, 02:17:45 AM
Hi Scott

Actually i want that my spindle speed should be controlled automatically as per the program when it is running. My Spindle Reley has to respond to custom M-codes in my Gcode interpreter only. and when this particular relay turns off my spindle speed should go into its previous speed i.e. it may be higher or lower. my spindle should remain on till the program is finished and M5 code is given.

Thanks lot

Sanlee
Title: Re: Configuring Start Button as Push Button
Post by: poppabear on January 27, 2008, 08:05:54 PM
Ok if you want your G code to control it then you will need 2 custom Macros one is for relay on (1/2 speed relay), and one is for that same relay to turn off, thus returning you to your 5k speed.

M60.m1s
'M60  (relay activate for 1/2 speed)
ActivateSignal(OUTPUT5)  'You can use output5 or what ever one you want just make it the same in both

M61.m1s
'M61 (relay turns off for restore to normal 5k speed)
DeActivateSignal(OUTPUT5)

'Regards,
'Scott
Title: Re: Configuring Start Button as Push Button
Post by: sanlee on January 28, 2008, 02:45:29 AM
Thankyou Scott

I have made M60.m1s file and write following thing
'M60
ActivateSignal(OUTPUT5)

and similarly for M61 as deactivate signal. now when writing M60 ro M61 into my Gcode program it is giving following error message.
"No Trigger in P Word, ignoring M60"

Please tell me what to do. I am saving M60.m1s file into "C:\Mach3\macros\Mach3Mill". Is it OK?

Thanks

Regards

Sanlee
Title: Re: Configuring Start Button as Push Button
Post by: Hood on January 28, 2008, 06:00:24 AM
Have you set up Output 5 in ports and pins for your relays?
Hood
Title: Re: Configuring Start Button as Push Button
Post by: poppabear on January 28, 2008, 09:48:45 AM
Like Hood said, make sure you enabled OUTPUT5 and set the correct ports and pins for it.
Also, Make sure you put these macros under the Profile your using if your using "Mach Mill" then look in the Macros folder, look in the "machmill" folder under that
see if you see your two macros. You have to put the macros under the Profile macros that they belong to. If you have more than one profile you have to watch this.

Scott
Title: Re: Configuring Start Button as Push Button
Post by: sanlee on January 30, 2008, 04:15:12 AM
Hello Hood and Scott

Thanks, I have already Enabled OUTPUT#5 in Output Signals, then Created file named M60.m1s. in that i have written ActivateSignal(OUTPUT5). then saved this file under MACH3,Macros,Mach3mill. But still it is showing error "No trigger in P word, ignoring M60" when executing M60 in Gcode. please let me know what is P word? Even i have restart my PC also to confirm the updatation of Macros. If in VB script editor i am running then i can see in diagnosis mode that output5 is getting on when ActivateSignal(OUTPUT5) is running. but M60 is not working in Gcode, Please guide me if anything else i have to do for this...

Thanks

Sanlee
Title: Re: Configuring Start Button as Push Button
Post by: Hood on January 30, 2008, 05:22:35 AM
I think M60 must be getting used or is being reserved by Mach for some reason, try changing to M70 and M71 and it should work. (check to see you dont have a M70 and 71 macro already in that folder, if you do then you can just pick a convenient number that is not being used)
Hood
Title: Re: Configuring Start Button as Push Button
Post by: sanlee on January 31, 2008, 04:54:16 AM
Thankyou Very much Hood

I think M60/M61 is being used by Mach or may he kept reserve but M70 and M71 works perfactly. Thanks again.

Regards

Sanlee
Title: Re: Configuring Start Button as Push Button
Post by: marting on May 02, 2012, 04:08:50 PM
Hi to all, I've just installed Super PID on my CNC router, which is controlled by Mach3 (via printer port #2, since port #1 is totally occupied by the Rutex servo drives) and while on the fly, i decided to also throw in an encoder for fine positioning and also 6 push button switches to activate Start, stop etc (also connected via printer port #2). So far the PID and positioning encoder are working as expected, however I cannot get to set the OEM triggers to communicate through pins 2 to 7 (of Print Port 2). Now.... I know that pins 2 to 9 are originally outputs, however in the "Ports and Pins" - "Port Setup" I set the outputs of port 2 to inputs. Further more in the "Input Signals" it says that only pins 10-13 and 15 are inputs, which is probably the source of my difficulty. I have also tried going around it through the Keygrabber but to no avail. I am a bit confused how or from where to get these set. Does any of you guys have any idea how to go about this? thanks
Marting
Title: Re: Configuring Start Button as Push Button
Post by: Hood on May 02, 2012, 04:45:05 PM
If you attach your xml I will have a look and see if I can find a problem.
Hood
Title: Re: Configuring Start Button as Push Button
Post by: marting on May 02, 2012, 05:27:37 PM
Hi Hood, attached as requesed .... much appreciated, Thanks
Marting
Title: Re: Configuring Start Button as Push Button
Post by: Hood on May 02, 2012, 05:33:25 PM
You dont have any OEM triggers assigned in that xml.
Hood
Title: Re: Configuring Start Button as Push Button
Post by: marting on May 02, 2012, 05:47:55 PM
So far no, as when something does not work, I revert back to the last working settings to keep as clean as possible. On the otherhand I need to assign OEM triggers on pins 2 to 7 of Printer Port 2.
Thanks Marting
Title: Re: Configuring Start Button as Push Button
Post by: Hood on May 02, 2012, 05:52:34 PM
Yes you will need to tell Mach which port and pin you have the switches set to, so say you have a button set to port 2 pin 2 you would then set OEM Trig 1 to port 2 pin 2. Then you would go to Config menu then system Hotkeys and enter the OEM code for the actionyou want that button to do, for example if you set OEM Trig to 1000 it would be the Start button.
Hood
Title: Re: Configuring Start Button as Push Button
Post by: marting on May 02, 2012, 06:08:06 PM
Already done it several times and also with different pin #, but no results.
Title: Re: Configuring Start Button as Push Button
Post by: Hood on May 02, 2012, 06:24:11 PM
If you do it then pass the xml I will look, should work fine if done correctly.
Hood
Title: Re: Configuring Start Button as Push Button
Post by: marting on May 02, 2012, 06:56:26 PM
Hi Hood, isn't it the one I've sent 4 posts ago?
Title: Re: Configuring Start Button as Push Button
Post by: Hood on May 02, 2012, 07:11:21 PM
That xml did not have any OEM triggers set up.
Hood
Title: Re: Configuring Start Button as Push Button
Post by: marting on May 02, 2012, 07:19:36 PM
Ho! I'm sorry, I didn't understand that right away. I'll try to get it done and send by tomorrow. Thanks
Title: Re: Configuring Start Button as Push Button
Post by: marting on May 03, 2012, 01:26:17 AM
Hellow Hood, attached is the modified xml file with OEM trigger 1 set to start cycle as an example of how I am setting these.
Thanks
Marting
Title: Re: Configuring Start Button as Push Button
Post by: Hood on May 03, 2012, 03:10:34 AM
You dont need the Emulated chosen, that is only if you wish to use a keyboard key to emulate a signal. Have you tried with Active High?
Otherwise it looks like it should work so if its not then it would seem the signal is not getting through to Mach.
Hood
Title: Re: Configuring Start Button as Push Button
Post by: marting on May 03, 2012, 05:09:08 AM
Yes, I have tried Active high as well. I am suspecting that iether I need to upgrade to the latest version of Mach3 or else I will have to use to original input pins 10, 11, 12, 13 and 15 (as it states at the bottom of the window in the "Input Signals"). The problem is that pin 10 & 11 are occupied by the fine positioning encoder and pin 12 is occupied by the probe. Now I will try to use pin 13 for the Start and 15 for the Stop commands but would still fall 1 switch short for the Z axis auto zero command. On the otherhand .... now that I'm thinking of other possibilities ..... maybe another alternative is reroute/declare other pins (eg pin 2 & 3 of port 2) in the Encoder/MPG's window for the fine positioning encoder ..... I think this should work!!! I'll keep you posted.
In the mean time, any remarks or ideas are always welcome.
Thanks
Marting
Title: Re: Configuring Start Button as Push Button
Post by: Hood on May 03, 2012, 05:29:52 AM
Your Mach version will not matter and also port 2 Pins 2-9 work fine as inputs as long as you have that option chosen, which you do. It could be a few things, it may be is if you are using a breakout board then that may not be configurable for these pins to be used as Inputs, some bobs can be used that way others cant. It may also be that your second port is not capable of being set EPP which I would think it would require.
I had that problem a long time ago when I did my first machine, the way I got around it was to use the onboard port as Port 2 and the PCI port as Port 1, the onboard port could be set in the BIOS to EPP
Hood
Title: Re: Configuring Start Button as Push Button
Post by: marting on May 03, 2012, 05:44:19 AM
Very well, so now that I know that Mach version should not be an issue, that eliminates 1presumption. Now ... regarding the breakout board that I have is simply a printer cable with pins soldered on one end and are then connected directly to the switches, hence I don't think that it qualifies as a breakout board. Therefore I have to presume that I need to set Printer Port 2 to EPP, which I have no idea how to do this or what it means. Just in case my preceding idea of re-allocating different pin outs for the encoder does not work, can you please elaborate a bit on the EPP term and how to do this?
Thanks
Marting
Title: Re: Configuring Start Button as Push Button
Post by: Hood on May 03, 2012, 05:56:10 AM
EPP is Enhanced Parallel Port I think, it means it is not just a standard port (SPP) and thus it should be capable of being set up to use the normal outputs (Pins2 -9) as Inputs. If you look in device manager it should tell you what mode the PCI port is in, if it is just SPP then you may have options to change it, possibly via a jumper on the card however that is not very common. There is also another mode which is ECP, think that should work as well but it has been a long time since I used the parallel port so I cant really remember.
Hood
Title: Re: Configuring Start Button as Push Button
Post by: marting on May 03, 2012, 03:19:58 PM
Hi Hood, First of all I would like to thank you so much for the support and patience that you have had with me. I have made the changes as I mensioned by changing pin configuration and in worked out fine. Further more it seems that there is an issue with the PCI port setting as you have pointed out, but for the time being is not of major issue since I am up and running.
Thanks once again
Title: Re: Configuring Start Button as Push Button
Post by: Hood on May 03, 2012, 03:59:35 PM
Good to hear you are sorted :)
Hood