-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shared library support #184
Shared library support #184
Conversation
I'm not sure what do do about this ...
... in the case of BUILD_SHARED_LIBS |
Hi, The devicedata.h has probably to be changed, that these parameters have to be provided by a to be defined start function for library use. Vendor ID, device type and so on are needed parameters for device identification at the PLC. Regarding your problem with the circular dependencies (I only see your comment in an email, but not in the associated issue), I have to check, but from a the first look, I would guess, that for library use, the functions HandleApplication, CheckIoConnectionEvent, AfterAssemblyDataReceived, BeforeAssemblyDataSend, ResetDevice, and ResetDeviceToInitialConfiguration have to be provided via function handles, as these functions are application dependent. The functions CipCalloc and CipFree should be moved to the platform dependent code sections, and RunIdleChanged should move into the common CIP lib. |
Okay, I see where/how I'll need to work with devicedata.h. I removed my comment regarding circular dependencies because it's not an issue after all; it was just an issue with library linking. I've actually got a ROS1/C++ project compiling and linking (catkin) against OpENer shared libs. However, I decided to close the PR until I get a little further along. Should moving the functions CipCalloc, CipFree, and RunIdleChanged be a requirement for merging any forthcoming PR for shared lib support? |
Hi, |
It looks like CipCalloc and CipFree are already located in the platform dependent sampleapplication.c. It looks like CipCalloc would be better placed in the CIP lib; probably cipcommon.c. And CipFree might be placed there as well, as it seems sort of like a common thing, though it's never called from there. So I'm thinking that you meant to say these Cip functions should be moved out of platform dependent code (sampleapplication.c)? As for RunIdleChanged, I can see that one moved to cipioconnection.c. All that aside, one cannot help but notice the "Copyright (c) 2011, Rockwell Automation, Inc" at the top of most source files. It would seem like a good thing to try to keep such files unchanged. Or is there no chance that Rockwell would make updated versions available? but then again, I don't understand the genesis and roadmap of this project. Please share that if you can. In any event, circular dependencies notwithstanding, I was able to link the existing main and sampleapplication to shared libraries, and tested against an actual running PLC. So it can all work the way it is, it's just not as nice as it might be. But maybe that is your motivation? |
Hi, Yes, I would like to do it nice, but if it works for you, I would still merge your changes and improve on them later on. The main reason for the copyright attributed to Rockwell Automation is that they are the sole sponsor of this project, but although all code is copyrighted to Rockwell, it is still under the BSD license. But you hit an important point. I will try to discuss this with Rockwell, how to handle that for contributions in the future. |
OK, I'm pretty much out of time and over budget on this project as it is. So I'd like to re-open the PR and have you merge, at your convenience and as your time permits. Also, my project is using OpENer as a git sub-module, pushing a tagged version. So if you would, please tag the master branch with a version I can hang the rest of my project on. Thanks, Bill |
+ BUILD_SHARED_LIBS default OFF + Prefer using VERSION on project seeting to seetin _VERSION_MAJOR/MINOR explicitly + Check for existing Vendor ID, Device Type, Device Name, Product Code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this myself
@@ -12,7 +12,7 @@ | |||
#include "typedefs.h" | |||
#include "ciptypes.h" | |||
#include "ciperror.h" | |||
#include "opener_user_conf.h" | |||
//#include "opener_user_conf.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, commenting this out breaks the traces.
Thanks for sharing the code! Shared library is merged into master |
Oh, your last commit was a little bit to late. I have to add it now in addition to the rest of the code |
Yea, sorry about that late commit. I didn't have a proper build environment to test with until I got to work this morning. |
Changes to CMakeLists files to support shared libraries in support of issue #183 .