Page 1 of 1

Determining if axis has been enabled

Posted: Fri Dec 16, 2022 2:35 am
by larryjamessmith
I have a problem in KMotion which I hope has a simple answer but is driving me crazy. I have a need in a C program to determine if an axis is already enabled before proceeding. I see a console command "Enabled<N>" which works fine in the console, but I cannot find any C functions to do the same thing. I am surprised since I have generally been able to find a C function equivalent to pretty much all the Console commands. Any suggestions?

Re: Determining if axis has been enabled

Posted: Fri Dec 16, 2022 2:43 am
by TomKerekes
Hi Larry,

You should be able to check:

if (chx->Enable) ...

where x is the axis of interest.

HTH

Re: Determining if axis has been enabled

Posted: Fri Dec 16, 2022 3:11 am
by larryjamessmith
Tom,
Thank you so much. I will try that as soon as I can. So, I assume that the Enable value is the one within the CHAN structure defined in KMotionDef.h? That makes sense now that I am studying that structure for other useful status...

I am amazed at the promptness of your reply to my question. I love your product and am building my second CNC mill using it. This one I built with an automatic tool changer and I am making a big effort to handle all exceptions and errors in an intelligent fashion. On my first mill every error required me to restart rather than resume actions...

Thanks again,
Larry

Re: Determining if axis has been enabled

Posted: Fri Dec 16, 2022 6:17 pm
by TomKerekes
Hi Larry,

That is correct. Thanks for the kind words. Consider leaving a review.