the machine works with a parallel port
it is required to switch outputs from stepgens depending on the tool number:
 M6T1 - axis Z worked,
M6T2 - axis A worked,
M6T0 - both axes worked simultaneously

the component was written :
component switchZA     "switch spindle Z A";

pin in bit stepz     "stepgen.2.step";
pin in bit stepa     "stepgen.3.step";

pin in bit dirz         "stepgen.2.dir";
pin in bit dira         "stepgen.3.dir";

pin in bit isrunning    "halui.program.is-running";

pin out bit outZstep "parport";
pin out bit outAstep "parport";

pin out bit outZdir     "parport";
pin out bit outAdir     "parport";

pin in s32 ntool        "iocontrol.0.tool-number";


license "GPL";
function _;
;;
FUNCTION(_) {
if (isrunning)
{
    if (ntool==1) { outZstep = stepz; outZdir = dirz; outAstep = 0; outAdir
= 0;}
    if (ntool==2) { outZstep = 0; outZdir = 0; outAstep = stepz; outAdir =
dirz;}
    if (ntool==0) { outZstep = stepz; outZdir = dirz; outAstep = stepz;
outAdir = dirz;}
}
else { outZstep = stepz; outZdir = dirz; outAstep = stepa; outAdir = dira;}

++++++++++++++++++++++

# hal
loadrt switchZA
addf   switchZA.0  servo-thread

net Ntool         iocontrol.0.tool-number       switchZA.0.ntool
net is:running    halui.program.is-running      switchZA.0.isrunning

net zstep switchZA.0.stepz
net zdir  switchZA.0.dirz

net astep switchZA.0.stepa
net adir  switchZA.0.dira

net outZdir   switchZA.0.outZdir   parport.0.pin-07-out
net outZstep  switchZA.0.outZstep  parport.0.pin-06-out

net outAdir   switchZA.0.outAdir   parport.0.pin-09-out
net outAstep  switchZA.0.outAstep  parport.0.pin-08-out


============================
can a component cause problems for stepper motors - they are jerky
??

_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to