Author Topic: pmdx 411- mach4 - gecko m540 turn on out put #5  (Read 19 times)


  • Posts: 1
    • View Profile
pmdx 411- mach4 - gecko m540 turn on out put #5
« on: May 06, 2019, 11:22:55 AM »
Trying to turn on output # 5 on my g 540 control to supply a Neg to my TTL relay for a laser . Tried a script from 2016 posted here , did not work function , m10()

local inst = mc.mcGetInstance();
mc.mcCntlSetLastError(inst, "Turning on OUTPUT5");
local hsig = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5);
mc.mcSignalSetState(hsig, true);


if (mc.mcInEditor() == 1) then
   Any suggestions ?   ED 


  • Posts: 114
    • View Profile
Re: pmdx 411- mach4 - gecko m540 turn on out put #5
« Reply #1 on: May 07, 2019, 12:02:26 AM »
Output #5?????  Ani't no such thing.  The G540 has only 2 general purpose outputs - Output #1 and Output #2.  Do you mean the output signal on pin 5 of the G540's screw terminal block?

Also, even if there were an "output #5",  the G540 "output #5 " is NOT NECESSARILY Mach4 "Output #5".  And G540 "Output #1" (which does exist) is not necessarily Mach4 "Output #1".  That is a very unfortunate coincidence of naming.

So... if you want to use the Mach4 output signal named "Output #5" - what PMX-411 output pin do you have 'Output #5" mapped to?  Go to Config->Mach4, then the "Output Pins" tab.

There is a table somewhere in the G540 manual that tells you which signals are on which screw terminal pins, and which parallel port (DB25) pins they correspond to.  Then map Mach4 "Output #5" to the DB25 pin that corresponds to the screw terminal signal you want to use.