sbrun Posted October 23, 2012 Share Posted October 23, 2012 I have CfromScript functions which work very well when i call them from Script or from Kinematic. I try to call those functions from a C Background-Program (C-app application). I get errors in the Compilation. I put in my c-App code : #include "../../Realtime Routines/usrcode.h" double cr; cr = CfromScript(1,0,0,0,0,0,0); // for test or cr = CfromScript(1,0,0,0,0,0,0,NULL); and in usrcode.h there is at the moment: #ifdef __KERNEL__ #include #else #define EXPORT_SYMBOL(x) // x #define KERN_ALERT #define printk printf #endif #include // Global Rt/Gp Externals and structures #include double CfromScript(double arg1,double arg2,double arg3,double arg4,double arg5,double arg6,double arg7,LocalData *Ldata); EXPORT_SYMBOL(CfromScript); What is the correct call for declaring a call for CfromSript in C code ? Link to comment Share on other sites More sharing options...
Sina.Sattari Posted October 23, 2012 Share Posted October 23, 2012 Sbrun, Are you including the usercode.h with proper path in your background C program? Link to comment Share on other sites More sharing options...
sbrun Posted October 23, 2012 Author Share Posted October 23, 2012 Sbrun, Are you including the usercode.h with proper path in your background C program? Yes Sina, as show above : #include "../../Realtime Routines/usrcode.h" , and with only this include (and no call to CfromScript) i have no build error. Link to comment Share on other sites More sharing options...
Omron Forums Support Posted October 23, 2012 Share Posted October 23, 2012 CfromScript is real-time kernel code only. If you want to run it from a Background C Program, you will have to reproduce a separate version of the function in a location separate from usrcode.c. Link to comment Share on other sites More sharing options...
sbrun Posted October 25, 2012 Author Share Posted October 25, 2012 Thank you Charles. and i confirm that i have no problem from Rti-Cplc or Bg-Cplc. Link to comment Share on other sites More sharing options...
Recommended Posts