homing problem

Moderators: TomKerekes, dynomotion

Post Reply
ar295
Posts: 3
Joined: Wed Jul 04, 2018 12:16 pm

homing problem

Post by ar295 » Wed Mar 13, 2019 4:25 pm

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,

User avatar
TomKerekes
Posts: 2677
Joined: Mon Dec 04, 2017 1:49 am

Re: homing problem

Post by TomKerekes » Wed Mar 13, 2019 5:29 pm

Hi ar295,

Remove the NOT operator ‘!’
Regards,

Tom Kerekes
Dynomotion, Inc.

ar295
Posts: 3
Joined: Wed Jul 04, 2018 12:16 pm

Re: homing problem

Post by ar295 » Thu Mar 14, 2019 9:33 am

Tnks Tom,
was this!

Post Reply