Hello Guest it is December 07, 2024, 04:10:51 PM

Author Topic: Custom M Code  (Read 4165 times)

0 Members and 1 Guest are viewing this topic.

Offline RRS

*
  •  3 3
Custom M Code
« on: February 05, 2014, 10:11:36 PM »
I am trying to set up a custom M code to switch an electric relay (c15 from CNC4PC) for a peripheral electric devise (an electromagnetic valves, not coolant).  I wrote the custom M macros to activate and deactivate the output and saved the m codes in the macro folder.  When I run the m codes manually in diagnostic screen I see the assigned output # light up but I cannot get the virtual parallel port pin to light up on the screen.  I tried with active lo and active hi.  Also, when I manually checked with a voltage meter I am not getting voltage on the pin. 

Am I missing something?  I am very very new to this, but I have ready everything I can find trying to resolve this issue and no luck. I am still running the demo, is there a demo limitation that would limit the custom M outputs??  Yes, I know, I will pay for the full version soon - just not quite in the budget yet, blew my money on the CNC hardware kit I'm still putting together.

Thanks for any help!

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: Custom M Code
« Reply #1 on: February 06, 2014, 02:59:26 AM »
First off, ignore the current state LEDs, they are an unknown as far as I know, seem to signify something one time then totally different the next.

If the actual OutPut LED is switching on and off then that is showing Mach is activating the outp[ut, are you sure you are measuring the correct pin on your port?

What pin are you setting as the output?
Hood

Offline RRS

*
  •  3 3
Re: Custom M Code
« Reply #2 on: February 06, 2014, 10:16:04 AM »
Thanks for the reply Hood,

I was a little rushed in my original post so I will take my time this go around and layout all settings a little better.

I am using the latest DEMO download version of the Mach3 which I downloaded last week.  Does the demo version possibly limit output commands?

I am currently running the desktop computer standalone (not connected to the CNC machine’s breakout board) to eliminate other potential issues; so I am looking for voltage with a multimeter at the parallel port on the back of the computer directly.

In Ports and Pins/Output Signals tab I am enabling Output #1 (green check), Port #1, Pin #16, and left active low as a red x (high) but also tried a green check (low).

I am using macro M111 to activate PIN #16:  ActiveateSignal(Output1)
I am using macro M110 to deactivate PIN #16:  DeactivateSignal(Output1)

To test I go into the Diagnostics screen and enter M111 into the manual code entry line down by the RESET button.  In the Output Signals Current State (lower right area of the Diagnostics screen) I get the Output 1 LED to blink red with M111 and turn back off with M110 but don’t get voltage on the actual parallel port pin #16.

Thanks for the heads up that the virtual parallel port LEDs in Diagnostics is not reliable to determine if I am getting a signal on the PIN, I was relying on that and only quickly manually checking with a voltage meter to double check when I got no LED light.  Having said that, I am almost certain I check the correct pin, but I will double check when I get home.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • www.razordance.co.uk
Re: Custom M Code
« Reply #3 on: February 06, 2014, 10:43:08 AM »
I am currently running the desktop computer standalone (not connected to the CNC machine’s breakout board) to eliminate other potential issues; so I am looking for voltage with a multimeter at the parallel port on the back of the computer directly.

Have you installed the parallel port driver?

Offline RRS

*
  •  3 3
Re: Custom M Code
« Reply #4 on: February 11, 2014, 01:40:06 PM »
Okay, I ended up doing some general cleanup of the old desktop PC I am using - deleting old programs and unused software, etc.  I removed and reloaded Mach3 also since I wasnt sure if I loaded the parallel driver.  Anyway, now everything seems to be working great.  I am now getting the hi lo signals that I was expecting.  Thanks for the advise.