I just finished the initial upgrade of our code to use RMP v10.
Overall, I’m very happy with the changes. Thanks for your work and consideration of the customer.
Interface Code (C++ headers)
The code is significantly more beautiful that from v8.
I use SWIG to generate interface code so that I can use the runtime API from Python. v10’s headers (without lots of CPP macros and indirection which tend to freak out everyone but the full-blown C/C++ compiler) worked right out of the box without me having to do any cleanup or anything! With v8, this was quite a chore, especially if I wanted to be able to upgrade to newer versions (with API changes).
Inline docs mean that I don’t have to switch to the web browser again and again to get the official word about what a function is supposed to do. It also means that I can see right away that “this function that looks like it might be useful” is actually deprecated.
Separating out enums into a different header is nice (for me) for two reasons. I can parse it separately (without having to know/care about most of C++ syntax) so that getting the enum name from its value is easier. I can search through the main header for a name and not spend the first 3-50 hits on enum names.
- Using C++ class enums means that the names are no longer global. Excellent!
- Using C++ class enums also means that there’s no implicit conversion to/from integral data types (VS 2017, --std=c++17).
- It seems like some API functions take integers instead of enums. This means that I have to do a lot of
static_cast<int32_t>(<enum_sym>)
. I ran into this when converting my code, but I didn’t take notes on what/when.
- It seems like some API functions take integers instead of enums. This means that I have to do a lot of
- It might have been good to use this as an opportunity to strip off the (now, redundant) prefixes for all the enum symbols. For example, to use
RSIMotorIoTypeMaskOUTPUT
, I have to sayRSIMotorIoTypeMask::RSIMotorIoTypeMaskOUTPUT
. This can get pretty (needlessly) lengthy. Since switching to C++ class enums was going to break every customer anyway, why not use this opportunity to clean up the names, so that I would only need to sayRSIMotorIoTypeMask::OUTPUT
?
- Using C++ class enums also means that there’s no implicit conversion to/from integral data types (VS 2017, --std=c++17).
Is RSIAPP
gone? I never wanted it before, even though it’s not unreasonable to insist that client code define it. However, stylistically, making clients jump through hoops to use the API is probably backward, since it should be a simple-to-use black box. Thanks for removing this thing on which I occasionally stub my toe when I forgot.
RapidSetup and Files
Switching to NodeInfo.xml
from “EtherCATNodeInfo.xml” (“ENI”, but NOT the real ENI, which is named EtherCAT.xml
—oh the time I spent trying to unconfuse people about this) seems like a good move.
Thank you for putting the client runtime DLLs in separate places and creating a commonly used “include”, “lib”, etc. directory structure.
Did v8 have the “Network Timing” and “Packet Errors” tools? I’m glad it’s here, even if it’s not new.
Thanks for including more info in RapidSetup. The more that’s there, the less I have to go writing C++ (or ,now, Python) apps to get things.
Thanks for bundling the samples in with the install. This makes it a lot easier to use sample code.