FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important
information on the platform change.
03-07-2022 09:42 AM
I have a problem with the c++ datalayer client example. When I build the snap and run it on the virtual ctrlx core I can write data to the datalayer. But when I try the sample app on the core itself then I get the message DL_CLIENT_NOT_CONNECTED. Addationally when the app is installed I can't see the data layer anymore. Is there some sort of security that blocks the client access to the datalayer, I find it strange that the sample works on the virtual core but not on the real core.
Thanks in advance
Solved! Go to Solution.
03-07-2022 11:15 AM - edited 03-07-2022 11:27 AM
Hello,
the samples work fine for me, on ctrlX CORE and ctrlX COREvirtual.
Have you installed the sdk-cpp-alldata sample first? And are you sure your CORE is in operation mode?
Please have a look at Apps and check if you can switch to Operation mode.
If you can see the possibility to switch to service mode, your CORE is in Operation mode. On the other hand, if the button says "Operation mode" your control is in service mode.
Best regards,
Nick
03-07-2022 11:58 AM
Yes I've installed the necesarry apps en the core is in operation mode. After a bit more searching I found a difference between my core and the virtual core. And that is that I don't have a system/root user. This is the only thing that is different between my real core and the virtual core.
03-07-2022 12:06 PM - edited 03-07-2022 12:07 PM
The root user does not have any impact on the examples of the SDK. But beware when you are connected via a tcp communication you have to add a fitting IP, username and password to your application code. Only on DL_IPC_AUTO, what should be standrad in the all data provider example, it works without.
03-07-2022 03:17 PM
Oke but what I don't understand is why the sample code is working on the virtual core but not on the real core, there must be something that is different. If I look at the log messages then the communication that is used is the DL_IPC. Is there something in the sample code that I need to change to make it work on the real core or should the sample code work on the real core without changing something in the code?
03-07-2022 03:46 PM - edited 03-07-2022 03:53 PM
Please have a look at the variable "_connectionClient" (line 22 of datalayerclient.h)
This connection string defines a tcp connection to the Data Layer of the localhost of the control. It contains the username and the password of the control (both "boschrexroth"). This connection only works at your control without any changes, if you use the same password and username.
If you have a different username or password, you can either change the default "boschrexroth:boschrexroth" of the tcp string to your username and password. Or you can use the connection with DL_IPC_AUTO, then you don't have to worry about usernames or passwords.
std::string _connectionClient = DL_IPC_AUTO;
Here you can access further information about the connection types of clients (and providers).