Page 1 of 1

homing problem

Posted: Wed Mar 13, 2019 4:25 pm
by ar295
hi,
i have a problem to make my homing routine.

I have all 3axis home limits at NO and when i write in c code this code read that the bit is high and doesn't go to swith the limit.

// Home Z up first - jog until it sees the limit

Jog(2,15000); // jog slowly positive
while (!ReadBit(171)) ; // loop until IO bit goes high
Jog(2,0); // stop
while (!CheckDone(2)) ; // loop until motion completes
DisableAxis(2); // disable the axis
Zero(2); // Zero the position
EnableAxis(2); // re-enable the ServoTick
Move(2,-5000.0); // move some amount inside the limits
while (!CheckDone(2)) ; // loop until motion completes
Zero(2); // Zero the position
ch2->LimitSwitchOptions = SaveALimits; // restore limit settings

How i can change the code to say to kflop to wait when my pin is low and not high i try with clearBit but doesn't work.
thnks,

Re: homing problem

Posted: Wed Mar 13, 2019 5:29 pm
by TomKerekes
Hi ar295,

Remove the NOT operator ‘!’

Re: homing problem

Posted: Thu Mar 14, 2019 9:33 am
by ar295
Tnks Tom,
was this!