I can still not get it to work. I have:
1) Set UserAlgo.CFunc=1 first thing in global includes
2) Have EXPORT_SYMBOL(CfromScript); in usrcode.h
3) Set build action to "Compile" for usrcode.c (and two other c files used in my calculations), Build action is 'content' for the c header files.
4) Verified that the build output from "Build and download realtime routines" contains no errors. (Se attached file for build log)
5) Directly after "Build an download realtime routines" or "Build and download all programs", typing "UserAlgo.CFunc" in the IDE console answers "0". If I manually do "UserAlgo.CFunc=1" in the console it refuses to change. Does UserAlgo.CFuncStatus=-1 mean anything???
For reference, my entry function in usrcode.c looks like this:
double CfromScript(
double CS_Number_double,
double State_double,
double KinematicsType_double,double arg4,double arg5,double arg6,double arg7,
struct LocalData *Ldata) {
int CS_Number = (int)CS_Number_double;
int State = (int)State_double;
int KinematicsType = (int)KinematicsType_double;
int ErrCode = 0; // 0= no error
switch(State) {
case Forward_Kinematics_State: {
ErrCode = ForwardKinematics(CS_Number,Ldata);
break;
}
case Inverse_Kinematics_State: {
ErrCode = InverseKinematics(CS_Number,Ldata);
break;
}
default: {
ErrCode = -11; // Invalid State Entered
break;
}
}
return (double)ErrCode;
} realtime_build.txt