Hay Tom,
Got INIT code working so far. Next i need to add external switch control for spindle and coolant.
Something else i was wondering concerning a C program that does a homing sequence for Y axis. This is what i have for Y axis.
Code:
#include "KMotionDef.h"
#define Y 1
main()
{
ch1->LimitSwitchOptions=0x00000000; // disable limits
DisableAxis(Y);
Zero(Y);
EnableAxisDest(Y,0.0);
Jog(Y,2000); // start moving
while (!ReadBit(139)) ; // wait for switch (input #139) to change
Jog(Y,0); // StopMotion
while(!CheckDone(Y)) ;
Jog(Y,-500); // start moving off of switch
while (ReadBit(139)) ; // wait for switch (input #139) to change
Jog(Y,0); // StopMotion
while(!CheckDone(Y)) ;
Delay_sec(.5);
DisableAxis(Y);
Zero(Y);
EnableAxisDest(Y,0.0);
//Jog(Y,-2000);
//Move(Y,-800);
while(!CheckDone(Y)) ;
Delay_sec(.5);
DisableAxis(Y);
Zero(Y);
EnableAxisDest(Y,0.0);
Delay_sec(.9);
ch1->LimitSwitchOptions=0x113;
}
I copied this code from a working example for my Z axis and worked fine. But would not work for Y axis. When executed for Y, table would not move off of switch until i changed the first ReadBit line by adding a "!" and then removing the "!" from second ReadBit. Is this because my limit switches of Z axis is set as Active High and my Y axis switches is set to Active Low?
The above code works fine for Y axis now,... but man.... was like finding a needle in a hay stack when you dont know what your looking for
Thanks,
Troy