What's new
What's new

Using auxiliary M codes to trigger an external relay....

cc22288

Aluminum
Joined
Dec 27, 2019
Hey all,

Apologies if this exposes my lack of electrical knowledge.

I know that you can use auxiliary M codes (M21-26) to trigger external devices. I would like to use one to trigger a solenoid valve and supply air from a second source. The solenoid I have uses 120V AC power. I BELIEVE that means that I will need to use a relay in between the IO board and the solenoid valve as, by looking at it, the IO board doesnt appear to me to have been designed to run 110 through the aux M code terminals. I also BELIEVE that the I/O board outputs 5 volts when the M code is executed. So, I THINK need to find a relay that uses 5v to switch but will take a 120v input to supply to the solenoid when closed. Also, if anyone knows the best place in the cabinet to tap for 110v power that would be helpful too. Possibly the GFCI?

Is anyone able to verify or correct any of that? Thanks so much in advance.
 
M21+ is meant to be used with M-fin. When you reach M21 in your program it will wait for the M-fin signal to confirm your device is activated before moving forward through your program. M51+ triggers the same relay but can be canceled by M61+ (or Reset button/M30).

You can use the outlet on the side of the machines electrical cabinet to supply any power you desire to your device using an appropriate adapter.

Inside the electrical cabinet (usually upper left corner of your I/O board) there is a row of terminal blocks, one for each M-code relay. You can figure out where they are by commanding M51 in MDI, and then looking for the red light by the terminal on the board to turn on, or make a looping program that blinks the light. Each block has 3 screw terminals for NO/COM/NC, the order of these changes between machines/years so verify how your machine works with a multimeter. All that happens when you hit M21/51 is you make/break continuity between the NO/COM/NC screw terminals, there is no power from the M-code relay itself.

Run one leg of the power (from the outlet) through the appropriate terminals to your solenoid, and the other leg straight to it. When you command M51 the relay will make continuity your solenoid will activate.
 
M21+ is meant to be used with M-fin. When you reach M21 in your program it will wait for the M-fin signal to confirm your device is activated before moving forward through your program. M51+ triggers the same relay but can be canceled by M61+ (or Reset button/M30).

You can use the outlet on the side of the machines electrical cabinet to supply any power you desire to your device using an appropriate adapter.

Inside the electrical cabinet (usually upper left corner of your I/O board) there is a row of terminal blocks, one for each M-code relay. You can figure out where they are by commanding M51 in MDI, and then looking for the red light by the terminal on the board to turn on, or make a looping program that blinks the light. Each block has 3 screw terminals for NO/COM/NC, the order of these changes between machines/years so verify how your machine works with a multimeter. All that happens when you hit M21/51 is you make/break continuity between the NO/COM/NC screw terminals, there is no power from the M-code relay itself.

Run one leg of the power (from the outlet) through the appropriate terminals to your solenoid, and the other leg straight to it. When you command M51 the relay will make continuity your solenoid will activate.
Awesome. So that terminal CAN bridge 110 power through it safely and reliably then? No relay needed? Thanks so much BTW
 
The M-code relays on the I/O board do not output power, so any device (be it a pneumatic solenoid, or an electrical relay) must have power run through the M-code relay terminals to function.
If you really wanted to you could use a 5v power adapter on the electrical cabinet outlet, and run it through the M-code relay to trigger a 5V relay, to trigger your 110V solenoid...

I am not an electrical engineer so I can't say for certain if there are any issues running AC through the terminals. I will say I built a prototype chuck-clamp-pressure-adjuster using whatever parts I had lying around (which happened to be a 110V solenoid like yours) and ran it straight through the M-code relay without issue for a few weeks until the real parts showed up, YMMV.
I have one or two devices on each machine here and they all run from the outlet straight through the M-code relay without issue, but most of that stuff is 24V. In DC applications it is recommended to add a diode in parallel between the two terminals on the M-code relay.
 








 
Back
Top