Hi!
We are using the PLCNext platform as the main control unit for our mobile robot system. We have written a custom localization system in C++ which uses an industrial camera and motor encoders as sensor inputs, all connected via Profinet.
I am looking for advice on what the best / correct way is to do data exchange between the PLC and the C++ code. We are running all relevant cycles at 4 ms cycle time currently.
There are three kinds of data exchange we are doing:
- We read the data from the sensors, which we are currently doing just trough the defined ports in .hpp file and the GDS. Here my question is if we should the changing this to using ISubscriptionService instead of ports? What benefits to we have here / in what scenarios would we want to make the switch?
- We write the output of the localization system to the GDS, the same way as in 1.
- [I am currently implementing this] On startup we want to read a .json map file which we only need to load once and then parse the data into a lookup table which we want to use as part of the realtime application. My current approach would be to follow a combination of the InternalFunctionExtension and ThreadExample from the C++ examples. Is this the correct way to do this?
Thank you all for taking the time to read and best regards
Fred