Page 1 of 1

Call a C program in a C program

Posted: Sat May 29, 2021 8:09 pm
by cemoa9
Hello Tom,

I have been trying to call a program in a program, from some examples I see I need to include "KMotionDLL.h" the but I always get a message error :

Image

If I copy the file in the folder then I get that :

Image

I must be missing something...

Re: Call a C program in a C program

Posted: Sat May 29, 2021 8:34 pm
by TomKerekes
KMotionDLL.h is for a C++ Class for code that runs on the PC under Microsoft Windows. It can not be used in a C Program that runs on KFLOP.

Could you describe more specifically what you are trying to do?

Re: Call a C program in a C program

Posted: Sun May 30, 2021 6:08 am
by cemoa9
Hello Tom,

I have specific program for the homing of the spindle, and I would like to call it during my toolchange program.

Cordially

Francois

Re: Call a C program in a C program

Posted: Sun May 30, 2021 4:09 pm
by TomKerekes
Hi Francos,

Convert the Program into a function. Put the function into a file. #Include the file in the Tool Change Program. Call the function from the Tool Change code wherever required.