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.
10-25-2023 03:58 PM
Hi,
So as I've got answers to my other questions, I am now trying to get an application working which was created by a colleague end of 2022 and which wasn't working. Luckily the first file I had a look at was: helper/ctrlx_datalayer_helper.py
Here I instantly saw why there was no chance of it working, as the coordinates for accessing the datalayer seem to be hard-coded into the program:
def get_provider(system: ctrlxdatalayer.system.System,
ip="192.168.1.1",
user="boschrexroth",
password="boschrexroth",
ssl_port=443):
Having a look, the cpp version also uses the same, the Node implementation doesn't seem to require credentials but still needs a hard-coded host and port to connect to.
This is fine in a demo environment, however this can't be the way it works in a production environment. I mean ... not all PLCs can have the ip 192.168.1.1 (I would assume this should be pretty simple to figgure out ... simply defaulting to one of the current machine's IPs) but more importantly, not a single PLC should use the default credentials "boschrexroth"/"boshrexroth" ... so is there a way to forward this information (with a token or so?) from the CtrlX main web application to the App sites it opens, so a user could continue using the application using the login to the main application?
Solved! Go to Solution.
10-25-2023 04:11 PM - edited 10-25-2023 04:14 PM
Hello,
See the following note in the ctrlx_datalayer_helper.py:
IMPORTANT:
You need not change the parameter settings before building a snap and installing the snap on a ctrlX CORE.
The method get_connection_string detects the snap environment and uses automatically inter process communication.
Therefore the connection string to the ctrlX Datalayer is:
"ipc://"
The connection string paramaters are configurable so you can connect the app to an external CORE. As an example, you could read/write datalayer nodes on a physical CORE directly from your app build environment. If running locally, as a snap, ipc communication is used automatically.
10-25-2023 04:25 PM
Guess moving that paragraph to the top of the description would have been helpful 😉 But thanks for explaining.