Hello Tom,
For cycle time improvement I would like to change my M6 code to have not only the tool changed but also the A axis moved (rotary table), does M6 support a second parameter?
Cordially,
Francois
M6 TXXXX QYY
Moderators: TomKerekes, dynomotion
- TomKerekes
- Posts: 2529
- Joined: Mon Dec 04, 2017 1:49 am
Re: M6 TXXXX QYY
Hi Francois,
No it doesn't. You could use a dummy M Code to first pass some parameters. ie
M100 Pxxx Qyyy Rzzz
M6 Txxx
No it doesn't. You could use a dummy M Code to first pass some parameters. ie
M100 Pxxx Qyyy Rzzz
M6 Txxx
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: M6 TXXXX QYY
Hello Tom,
Thanks it works, but I kinda got an issue while reading DROs, sometimes GetDROs(...) is not getting updated and the value of the previous movement is shown in the console. I use the latest version of KMotionCNC.
here is the code :
double DROx, DROy, DROz, DROa, DROb, DROc, OffsetZ;
GetDROs(&DROx, &DROy, &DROz, &DROa, &DROb, &DROc);
printf("DROa = %f\n", DROa);
It happened twice, DRO was 0 on KMotionCNC, but appeared as 90 in the console, causing a wrong rotary table movement (no crash )
Cordially,
Francois
Thanks it works, but I kinda got an issue while reading DROs, sometimes GetDROs(...) is not getting updated and the value of the previous movement is shown in the console. I use the latest version of KMotionCNC.
here is the code :
double DROx, DROy, DROz, DROa, DROb, DROc, OffsetZ;
GetDROs(&DROx, &DROy, &DROz, &DROa, &DROb, &DROc);
printf("DROa = %f\n", DROa);
It happened twice, DRO was 0 on KMotionCNC, but appeared as 90 in the console, causing a wrong rotary table movement (no crash )
Cordially,
Francois
Re: M6 TXXXX QYY
Hello Tom,
I just tried using MDI(s) command, there also I have a problem, the command will only work randomly :
WaitNextTimeSlice();
char s[80];
float Angle = *(float *)&persist.UserData[TMP];
Angle = 10; // just for trial to have a fix value
sprintf(s,"G0 A%f", Angle);
MDI(s);
I may need to run it 20 times to have it moving.
I am using a very slow computer (cheap win10 tablet), may that be the issue?
Edit : I added a delay of 0.01s in the init program in the forever loop, it seems to have solved the MDI issue, but it does not feel safe...
Cordially,
Francois
I just tried using MDI(s) command, there also I have a problem, the command will only work randomly :
WaitNextTimeSlice();
char s[80];
float Angle = *(float *)&persist.UserData[TMP];
Angle = 10; // just for trial to have a fix value
sprintf(s,"G0 A%f", Angle);
MDI(s);
I may need to run it 20 times to have it moving.
I am using a very slow computer (cheap win10 tablet), may that be the issue?
Edit : I added a delay of 0.01s in the init program in the forever loop, it seems to have solved the MDI issue, but it does not feel safe...
Cordially,
Francois
- TomKerekes
- Posts: 2529
- Joined: Mon Dec 04, 2017 1:49 am
Re: M6 TXXXX QYY
The communication to KMotionCNC is not Thread safe. That is if two Threads send a command at the same time then commands can be dropped or results mixed up.
If your forever loop is issuing commands then one solution is to have the other Thread tell the forever loop to issue the command rather than doing the command itself.
HTH
If your forever loop is issuing commands then one solution is to have the other Thread tell the forever loop to issue the command rather than doing the command itself.
HTH
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.