Good Evening,
I am getting a strange error that I don't understand while running a C Program. A display window pops up in KMotionCNC which says "Invalid External Command Received". I have attached a screen shot. The only way to make it go away is to reboot the KFlop. I am running 434h.
It occurs when I run the program "Set Z Height.C" - AFTER - I have run the program "4X8 Router Tool Touch.c". It will not occur if I do not run "4X8 Router Tool Touch.c"
If I comment out this line it will not cause the error, but as soon as I remove the comment the error window pops up.
persist.UserData[ZOffset] = *(int *) & Offset; //Save offset as global variable
Does anyone know what I could be doing wrong? Been at it for a while and cant seem to make any sense of it.
Thanks!
Snyggis
External Command Error
Moderators: TomKerekes, dynomotion
External Command Error
- Attachments
-
- Set Z Height.c
- (1.11 KiB) Downloaded 149 times
Re: External Command Error
Not sure my attachments went through.
- Attachments
-
- 4X8 Router Tool Touch.c
- (5.76 KiB) Downloaded 145 times
-
- Set Z Height.c
- (1.11 KiB) Downloaded 146 times
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: External Command Error
Hi Snyggis,
You forgot to include your RouterIO.h file. But persist variables 100-107 are used to communicate commands to KMotionCNC so those aren't available for your use when using KMotionCNC. See PC-DSP.h file:
#define PC_COMM_PERSIST 100 // First Persist Variable that is uploaded in status
#define N_PC_COMM_PERSIST 8 // Number of Persist Variables that are uploaded in status
If you set a big value in Variable 100 KMotionCNC will try to interpret it as a command and report it as invalid.
HTH
You forgot to include your RouterIO.h file. But persist variables 100-107 are used to communicate commands to KMotionCNC so those aren't available for your use when using KMotionCNC. See PC-DSP.h file:
#define PC_COMM_PERSIST 100 // First Persist Variable that is uploaded in status
#define N_PC_COMM_PERSIST 8 // Number of Persist Variables that are uploaded in status
If you set a big value in Variable 100 KMotionCNC will try to interpret it as a command and report it as invalid.
HTH
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: External Command Error
Thanks Tom! That makes sense. In the example program that I copied the header file had the following:
#define TMP 10 // which spare persist to use to transfer data.
I was avoiding global variable 10, I guess that line means something else?
Here are the definitions from the header file, looks like I am using all of the global variables that I should not use.
#define ZOffset 100
#define S1Offset 101
#define S2Offset 102
#define S3Offset 103
#define S4Offset 104
Just change these to 50-54 and we should be good.
Thanks,
Snyggis
#define TMP 10 // which spare persist to use to transfer data.
I was avoiding global variable 10, I guess that line means something else?
Here are the definitions from the header file, looks like I am using all of the global variables that I should not use.
#define ZOffset 100
#define S1Offset 101
#define S2Offset 102
#define S3Offset 103
#define S4Offset 104
Just change these to 50-54 and we should be good.
Thanks,
Snyggis
- Attachments
-
- RouterIO.h
- (2.24 KiB) Downloaded 140 times
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: External Command Error
Hi Snyggis,
Correct. The 100-107 variables are used to send commands and parameters to KMotionCNC. The TMP determines where KMotionCNC will place any returned values.
Hope that resolves the problem.
Correct. The 100-107 variables are used to send commands and parameters to KMotionCNC. The TMP determines where KMotionCNC will place any returned values.
Hope that resolves the problem.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.