Hi Tom
I was able to successfully connect a VFD to RS232 and control my spindle with c programs.
Even though I found SpindleOnJog.c SpindleCssJog.c and so on I am not able to get the S Value out of KMotionCNC. To test this I set up following:
wrote an M3.c Program:
Code:
main (){
#define KMVAR PC_COMM_CSS_S
#define KMVAR1 1
float speed1 = *(float *)&persist.UserData[KMVAR];
float speed2 = *(float *)&persist.UserData[113];
float speed3 = *(float *)&persist.UserData[KMVAR1];
printf("%f \n", speed1);
printf("%f \n", speed2);
printf("%f \n", speed3);
}
Then I configured this M3.c in KmotionCNC, for M3, Thread 4, Exec/Wait.
Kmotion is showing a Spindle Speed of 123.0
The console returns 0.000000 on pressing the M3 Button or executing M3 S123 in maual entry.
It seams that I don't understand the concept to access those values. Can you help me?
Regards
Leo