4 Attachment(s)
Dialogue problems between KMotionCNC and C program
good day to everyone,
my goal is to write a G Code program based on the input of a KMotionCNC graphics page to execute a complete thread G32 based. As u can see from attached screenshots, I used the instruction
GetEditControlDouble(variable,VAR,offset)
to read the Controls inside the page, but I get always a NULL value. Of course there is something wrong, but I can't to understand where.
Some advice to fix the problem?
Beppe
Re: Dialogue problems between KMotionCNC and C program
Hi Beppe,
To print the value of a variable a format specifier must be included in the string to indicate where and how the value should be placed. %f for a floating point variable. Like in the line you commented out. %5.1f requests 5 characters total with one decimal place be printed.
Note all the strings should end with a \n (newline character) to cause it to print.
3 Attachment(s)
Re: Dialogue problems between KMotionCNC and C program
hi Tom
following your advices now the C program is running.
I have another problem on the tool changer: until a week ago it was working fine and suddenly it stopped to work. As you can see on attached KMotionCNC screenshots, the TOOL_VAR variable read is always zero and obviously the tool change program reports an error. Doesn't care if I call the change by manual button, by MDI command or from a G-Code... the TOOL_VAR is always zero. I am sure that the declaration #define TOOL_VAR 9 is inside the rotate tool changer program only and I am also sure I don't use any persist.UserData[] to write the VAR #9 into the other C programs: any advice how to debug the problem?
Attached screenshots and RotateToolChanger program
Beppe
Re: Dialogue problems between KMotionCNC and C program
Tom
sorry, when I recorded the KMotionCNC screenshot I didn't see i wasn't inside the right thread but the Console is reporting what happened due Tool Changer program
Beppe
Re: Dialogue problems between KMotionCNC and C program
Hi Beppe,
Do you have M6 configured to use Var #9?
Re: Dialogue problems between KMotionCNC and C program
hi Tom,
if you mean in the KMotionCNC tool setup, yes
Re: Dialogue problems between KMotionCNC and C program
Hi Beppe,
Correct.
What Slot Value do you have in the Tool Table for Tool ID 1002?
Re: Dialogue problems between KMotionCNC and C program
hi Tom,
here is already night and I will check tomorrow morning what you ask. Just to understand better... is the Tool ID value been passed from KMotionCNC to Kflop VAR #9?
Beppe
Re: Dialogue problems between KMotionCNC and C program
Hi Beppe,
Normally what is important for a Tool Change Program is what Slot the Tool is in not the ID. But both are passed to the Tool Change Program. Slot in VAR and ID in VAR+1.
HTH
Re: Dialogue problems between KMotionCNC and C program
good day Tom,
problem fixed: because I develop C programs at home, something went wrong with copying files to the lathe PC and the M6 calling was on VAR #0 instead #9. That's all. A stupid problem that make me feel more stupid.
thanks anyway for your infinite patience.
Beppe
Re: Dialogue problems between KMotionCNC and C program
Hi Tom,
I was designing a KMotionCNC diagnostics page to view all the status of Kflop-Kanalog IN / OUT but I realized I didn't have enough IDC_But to use as a led. Is there any way to add more buttons?
Beppe
Re: Dialogue problems between KMotionCNC and C program
Hi Beppe,
Not without changing the source code. We will consider adding more.
You might consider going to multiple screens.