you want to use EnableChanDest(int ch, double Dest).
So from your post -
Code:DisableAxis(CHNO_X); EnableChanDest(CHNO_X, -0.123456E+8); X init Point
quick Q:
how do we set arbitrary encoder position when homing in C file instead of Zero(ch)?
is that right:
DisableAxis(CHNO_X);
chan[CHNO_X].Position = -0.1234567E+8; // X init point
EnableAxis(CHNO_X);
you want to use EnableChanDest(int ch, double Dest).
So from your post -
Code:DisableAxis(CHNO_X); EnableChanDest(CHNO_X, -0.123456E+8); X init Point
I think it is actually Axis not Chan
Code:DisableAxis(CHNO_X); EnableAxisDest(CHNO_X, -0.123456E+8); // X init Point
Regards
TK http://dynomotion.com
You could well be right, and that would explain why my lathe still occasionally disables due to following error during initialisation...
That does not work. It alters destination but not current position. Verified this on console. "Pos" reads the same value before and after EnableAxisDest:
Attachment 392523
I've not got a KFlop handy to test, but I thought that function should set the position to match the destination.
You may need to use
However, AFAIK you can't use a constant to select the channel number, and I'm not sure if you'd also have to set the destination to match before enabling.Code:ch0->position=-0.123456E6;
that is same as was suggested in initial header post. "chan[CHNO_X].Position" type syntax allows to put some definition in to [] braces. And later "EnableAxis" seems to reset destination to current Pos. All looks to be working but lets wait confirmation from TomKerekes if there is no underwater stones doing so.
So it is.
In my defence, I've had a hard day!
As long as it's updating the values how you want, then it's fine.
I'm assuming you're now using chan[CHNO_X].Position to set the position, followed by EnableAxisDest[CHNO_X] to enable at the value you want?