leandro.martins Posted February 15, 2022 Share Posted February 15, 2022 Hello, I'm implementing a Custom User Servo Algorithm, that's been sucessful until now. For modularity purposes, I'm trying to declare a function in a folder inside the "Libraries". I declared my function "test" in "test.c" file, and in the "test.h" I made all the includes contained in usrcode.h #ifdef __KERNEL__ #include <linux/module.h> #else #define EXPORT_SYMBOL(x) #define KERN_ALERT #define printk printf #include <gplib.h> #endif #include <RtGpShm.h> #include <rtpmacapi.h> double test(struct MotorData *Mptr); EXPORT_SYMBOL(test); I also included the path to "test.h" in the "usrcode.c" #include "../Libraries/test/test.h" The code is compiled sucessfully, but the function "test" doesn't appear in the User Servo Setup. Am I missing something, or is it impossible to do what I'm thinking? Thanks in advance. 1 Quote Link to comment Share on other sites More sharing options...
Omron Forums Support Posted February 15, 2022 Share Posted February 15, 2022 Only the functions added through the "Add a New Function" button can be used for user servo/phase routines. You can call other functions from inside these functions. However, I do not believe libraries can be called from usercode.c. You may have to create a header file in the "Include" folder and include it. Quote Link to comment Share on other sites More sharing options...
leandro.martins Posted February 16, 2022 Author Share Posted February 16, 2022 Thanks Eric, I'm being able to use the functions created manually in the usrcode.c, without using the "Add a New Function" button. Unfortunately in the "Include" folder, it's not possible to create subfolders, which would be the best, thinking in the modularity of the applications. I'll try some more and update here. Quote Link to comment Share on other sites More sharing options...
leandro.martins Posted February 21, 2022 Author Share Posted February 21, 2022 (edited) Indeed, it's not possible to include the functions created in the "Libraries" folder. The code is compiled, but the following errors appear in the Output during the download. I also tried to create the header in the "Include" folder, and include the function from there, but the same erros occur. I'm guessing that isn't possible to achieve what I was thinking in the beginning. Edited February 21, 2022 by leandro.martins Quote Link to comment Share on other sites More sharing options...
Omron Forums Support Posted February 22, 2022 Share Posted February 22, 2022 If the issue with header files in the includes folder was modularity, then it would still be possible to create some level of modularity by creating an include file that includes other includes files and using a helpful naming convention. I've made a feature request with the software team for subfolders in the Include folder. I can't comment on whether it will be accepted. Quote Link to comment Share on other sites More sharing options...
leandro.martins Posted February 23, 2022 Author Share Posted February 23, 2022 The main objective was to maintain modularity in custom servo routines, being possible to execute functions from others folders For other uses, I think the "Libraries" folder (and its subfolders) already answer that need. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.