Hello Guest it is December 07, 2024, 03:35:04 PM

Author Topic: How do I assign an m-function to a parallel port pin?  (Read 5763 times)

0 Members and 1 Guest are viewing this topic.

How do I assign an m-function to a parallel port pin?
« on: April 04, 2013, 01:28:02 AM »
I am configuring a new install of Mach3 with steppers and the parallel port.  I have the X-Y motors working fine but I need to assign pin8 and pin9 to specific M-functions.   How do I assign M3 to turn pin 8 on, and M5 to turn it off, and the same for pin 9 with and M#?

Also, where can I find information on customizing screens?

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: How do I assign an m-function to a parallel port pin?
« Reply #1 on: April 04, 2013, 03:26:54 AM »
For the M3 macro you would just edit it to do what you want. It all depends exactly what you are wanting it to do, ie is it to do the output in addition to the normal output or is it just to do that output only?

You can write custom macros and name them from m100 upwards and save them in the macro folder of the profile you are using. For example if you opened the editor and typed in
ActivateSignal(OutPut1)

then save it as m101.m1s it would turn on Output 1 when you called m101 from code or MDI. That then follows that you would need to set up Output 1 as pin 9 in ports and pins.
To turn it off you would just do similar to above but have the following
DeActivateSignal(OutPut1)

and then save it as maybe m102.m1s


Hood
Re: How do I assign an m-function to a parallel port pin?
« Reply #2 on: April 04, 2013, 10:32:19 AM »
Hi Richpress and  Hood,

I think the easyest way is to use the standart method.
config > ports and pins > spindle setup > uncheck " disable spindle relays " > sign output #1 to #6 as you wish for M3 > output signals  > enable the output you choose >assign port No. and finally pin 8 > save settings

M5 is ready, no changes required.


just a thought.

Alex

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: How do I assign an m-function to a parallel port pin?
« Reply #3 on: April 04, 2013, 01:15:13 PM »
Alex, that is why I asked the question,
Quote
is it to do the output in addition to the normal output or is it just to do that output only?
Hood
Re: How do I assign an m-function to a parallel port pin?
« Reply #4 on: April 04, 2013, 02:31:27 PM »
Hood, my apologies.

maybe I had better took my glasses on or learn more English or both.  ::)

be kind.  :)

Alex

Offline BR549

*
  •  6,965 6,965
Re: How do I assign an m-function to a parallel port pin?
« Reply #5 on: April 04, 2013, 03:58:33 PM »
It sounds like he wanted to know HOW to set up spindle and coolant.

You do that in Config,portspins,spindle and setup what outputs you want.

Then go to OUTPUTS and setup the pins and ports for those outputs.


Just a thought, (;-)tp

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: How do I assign an m-function to a parallel port pin?
« Reply #6 on: April 04, 2013, 05:13:26 PM »
;D

Re: How do I assign an m-function to a parallel port pin?
« Reply #7 on: April 04, 2013, 10:10:13 PM »
Hello and thanks for the suggestions.   I am a novice with mach3 but hope to learn as much as possible.  Right now all I need to do is have M3 set pin 8 hi and M5 set it low.  I will need the same for pin 9 with some other numbers soon.    This has nothing to do with spindle  or coolant,  it is opening and  closing a laser shutter.   The choice of Function number is legacy.  It is fine if it is easier to use another set of numbers.   The I/O for pin 8 and 9 are hardwired and I would rather not change that.  But, any Number is fine.
Re: How do I assign an m-function to a parallel port pin?
« Reply #8 on: April 05, 2013, 09:18:39 AM »
Richpress,
M3/M5 have delays that may interfere with your laser use.  Probably better to set up a phantom axis (I use 'C') direction pin and issue a C-x to to advance the shutter, and C0 to retract it, in your code.

John Champlain