Jump to content
OMRON Forums

User Servo Rountine in Libraries Folder


leandro.martins
 Share

Recommended Posts

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".

image.png.7a515b33dd0c16dbffcde6ff300bdbdc.png

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.

image.png.a170dacc1cbfda0b38ddffa7ea17bc2d.png

 

Am I missing something, or is it impossible to do what I'm thinking?

Thanks in advance.

  • Like 1
Link to comment
Share on other sites

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.

image.thumb.png.3c260adc9a826d8273ca328e10197229.png

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 by leandro.martins
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...