3
« on: August 02, 2020, 08:19:48 PM »
I would like to take an input to my motion controller (PMDX416) and in mach4 software use this input to activate an output. To be specific I want to get step and direction inputs from an out side source (THC) and have a script (or some other method) that allows the inputs to activate the same outputs that now control a stepper motor. This is for a plasma torch. I have a torch touch off set up in the gcode. When the code comes to the touch off I want mach4 to take control and activate the outputs as usual but when the probe action is over I want the input from the THC to control the output. By design the THC should take the z axis output from the motion controller and pass it on through to the stepper controller when the torch is not on but it has stopped doing this. I think maybe some failed circuit in the THC is causing this. The THC does still send step and dir signals when the torch is on. This failure to send the output for the step and dir from mach4 to the THC causes the probe action not to work. I have checked the motion controller and the outputs work but get lost trying to pass through the THC like they used to do.
If I were writing this in some simple programming language I might do;
if step signal from mach4 or step signal from THC (input) set output to true
else set output false;
endif
With the same sort of routine for direction.
Unfortunately I do not know the LUA scripting to do this. Can someone help.