Motor brake
Moderators: TomKerekes, dynomotion
Re: Motor brake
No this was not the case. The problem comes when i press the button MOVE X, MOVE Y... on the main screen. This button calls another c program the GOTOX.c, GOTOY.c and so on. Only the button GOTOB works ok. Also when the command DisableAxis(4) is commented, disabled, there is no problem, everything work fine.
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Motor brake
Hi cnc_freak,
That makes sense. You can not run GCode or MDI commands if all the Axes in the defined Coordinate System are not enabled. If you want to run GCode or MDI commands with Axis B disabled then B should be removed from the Coordinate System beforehand. See the example code below. A better approach might be to have the B axis normally excluded instead of included and only include it when the B axis is enabled. That would seem more logical to me and might avoid other issues.
Note you were also missing curly brackets so you would have a bad result if the Operator hit cancel.
That makes sense. You can not run GCode or MDI commands if all the Axes in the defined Coordinate System are not enabled. If you want to run GCode or MDI commands with Axis B disabled then B should be removed from the Coordinate System beforehand. See the example code below. A better approach might be to have the B axis normally excluded instead of included and only include it when the B axis is enabled. That would seem more logical to me and might avoid other issues.
Note you were also missing curly brackets so you would have a bad result if the Operator hit cancel.
Code: Select all
#include "KMotionDef.h"
#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"
main()
{
int Answer;
float value;
char p[100];
Answer = InputBox("Enter Distance to go X", &value);
if (Answer)
printf("Operator Canceled\n");
else
{
DefineCoordSystem8(0,1,2,3,-1,-1,6,7); // remove B from Coordinate System
sprintf(p, "G0X%3.1f", value);
MDI(p);
DefineCoordSystem8(0,1,2,3,4,-1,6,7); // include B in the Coodinate System
}
}
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.