Dear Community User! We are updating our platform to a new system.
Read more: Important information on the platform change.

cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

CtrlX Datalayer Client with current user credentials?

CtrlX Datalayer Client with current user credentials?

cdutz
Long-established Member

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?

2 REPLIES 2

Sgilk
Frequent Contributor

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. 

cdutz
Long-established Member

Guess moving that paragraph to the top of the description would have been helpful 😉 But thanks for explaining.

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist