11/13/2024
HowTo, Enginnering, C2C, Data Layer

Data exchange between controls – ctrlX Data Layer Remote Connection

Introduction

The whole Data Layer of a control can be shown in the Data Layer of another control via the Data Layer remote connection. This is a build in feature of the ctrlX Data Layer, you don'tΒ need to install any additional app or need any additional license. The communication between the controls is based on tcp and therefore NRT.Β 

Prerequisites

The only prerequisite is, that the control got to be in the same network. In the following I will show how you can set this up with two ctrlX COREs in the same network (ip1: 192.168.1.1 , ip2: 192.168.1.2), but you could as well use any other ctrlX OS device as well.

ctrlX CORE or other ctrlX OS devices connected in the same network

Step-by-Step guide

  1. Create Remote Connection in the Data Layer

The configuration of a Data Layer remote connection can be easily done via the ctrlX CORE web UI by one simple create request to the node β€œdevices/remotes” in the Data Layer (Settings -> Data Layer), with the following payload:

{
 "name" : "otherControl",
 "address" : "tcp://<user>:<pw>@192.168.1.2"
}

Β 

create the child node at devices/remotes in the ctrlX Data Layer

  1. Certificate Handling

With V4.6 onwards certificates are also checked for Data Layer Remote Connections. Therefore a user hast to trust the certificate of the Control he wants to connect to. Go to "Settings -> Certificates & Keys -> Data Layer" and trust the Certificate of the device you want to connect to.

trust the certificate of the control you want to connect to

As an alternative the certificate check can also be disabled. This can be done by adding "?NoCheckCertificate=true" to the connection string. In this example this would mean: "address" : "tcp://<user>:<pw>@192.168.1.2?NoCheckCertificate=true"

Check the output in the Data Layer

Now you can already access the Data Layer of the other control at this path: β€œdevices/remotes/otherControl”. This data can be accessed by you as a user and also by any other app running on this ctrlX CORE or ctrlX OS device. This configuration is stored persistent in the App Data on the ctrlX CORE since V1.20. (Note: for older versions the remote Data Layer connection can be also used, but the configuration is not persistent)Β 

The Data Layer of the "otherControl" (192.168.1.2) in the Data Layer of the first control (192.168.1.1)

Documentation

Further Information

  • How to do a access to a limited set of nodes: See this thread.

3
Types
How-to
Products
Controls