### Start() Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/net/html/interfaceDatalayer_1_1IProvider.html Starts the ctrlX Data Layer provider service. ```APIDOC ## Start() ### Description Starts the provider. ### Method POST (Assumed, as it modifies state) ### Endpoint /datalayer/start (Assumed) ### Response #### Success Response (200) - **DLR_RESULT** (int) - The result of the operation. #### Response Example ```json { "result": 0 } ``` ### Exceptions - **ObjectDisposedException**: Cannot access a disposed object. ``` -------------------------------- ### Execute Virtual Environment Installation Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-python/index.html Command to trigger the virtual environment setup script. ```bash ./install-venv.sh ``` -------------------------------- ### Install QEMU and KVM on Linux Host Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/setup_qemu_ubuntu.html Execute this script to install the necessary QEMU and KVM packages on your Linux host system. Ensure you have the ctrlX AUTOMATION SDK installed. ```bash ~/ctrlx-automation-sdk/scripts/environment/install-qemu.sh ``` -------------------------------- ### Start Px Proxy Server Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/px.html Batch file content to launch the Px proxy server from the installation directory. ```batch cd c:\tools\px px.exe ``` -------------------------------- ### Start Datalayer System Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/net/html/DatalayerSystem_8cs_source.html Method to start the system, optionally starting the broker. ```csharp public void Start(bool startBroker = false) { if (IsDisposed) { throw new ObjectDisposedException(Utils.Strings.ErrorObjectDisposed); } unsafe { NativeMethods.Datalayer.DLR_systemStart(_nativePtr, Convert.ToByte(startBroker)); } _isStarted = true; } ``` -------------------------------- ### Build ctrlX Data Layer Client Example Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-java/datalayer.client.simple/index.html Use these Gradle commands to clean the project and build the Java client example. ```bash ./gradlew clean ./gradlew build ``` -------------------------------- ### List Installed .NET Runtimes Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/dotnet.html Check the installed .NET runtimes on the VM. ```bash dotnet --list-runtimes ``` -------------------------------- ### Install .NET SDK on QEMU VM Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/dotnet.html Execute the script to install the .NET SDK as a snap on your VM. This script is located in the ctrlx-automation-sdk/scripts directory. ```bash ./install-dotnet-sdk.sh ``` -------------------------------- ### List Installed .NET SDKs Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/dotnet.html Verify the installed .NET SDK versions and their paths on the VM. ```bash dotnet --list-sdks ``` -------------------------------- ### Virtual Environment Setup Commands Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-python/index.html Commands executed by the installation script to create and configure a Python virtual environment. ```bash virtualenv -p python3 venv source venv/bin/activate pip3 install -r requirements.txt ``` -------------------------------- ### Example ctrlx-backup.json output Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/persist-device-settings.html The resulting JSON structure generated by the Setup app during a backup process. ```json { "apps": { "myApp" : { "settings": { "foo": "some value", "bar": { "enabled": true, "title": "my title" }, "baz": { "$path":"apps/myApp/settings/baz.bin" }, "secret": { "$path":"apps/myApp/settings/secret.bin.aes" } } } } } ``` -------------------------------- ### Install Standard Packages Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/setup_windows_virtualbox_ubuntu.html Install required development packages manually via command line. ```bash sudo apt-get install -y zip unzip ... ``` -------------------------------- ### Start DatalayerSystem Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/net/html/classDatalayer_1_1DatalayerSystem.html Initializes and starts the DatalayerSystem instance. Set startBroker to false when acting as a client. ```csharp using var system = new DatalayerSystem(); system.Start(startBroker: false); ``` -------------------------------- ### Build and Install Snap with Network Adapter Option Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples.html This command builds and installs a snap package on a ctrlX CORE, specifically configuring it with Network Adapter settings. It's a convenient way to deploy applications with specific network requirements. ```bash ../../scripts/build-upload-log-snap.sh -NA ``` -------------------------------- ### Console Output Example Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-node/hello-world/index.html This is an example of the expected console output from the 'Hello World' Node.js application, including timestamps. ```text Hello World from Node.js! Thu, 07 Oct 2021 11:35:08 GMT Hello World from Node.js! Thu, 07 Oct 2021 11:35:09 GMT Hello World from Node.js! Thu, 07 Oct 2021 11:35:10 GMT Hello World from Node.js! Thu, 07 Oct 2021 11:35:11 GMT Hello World from Node.js! Thu, 07 Oct 2021 11:35:12 GMT ``` -------------------------------- ### DatalayerSystem.Start Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/net/html/DatalayerSystem_8cs_source.html Starts the DatalayerSystem instance. ```APIDOC ## Start ### Description Starts the DatalayerSystem. ### Method void ### Parameters #### Parameters - **startBroker** (bool) - Optional - Indicates whether to start the broker. Defaults to false. ``` -------------------------------- ### Install SDK on App Build Environment Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/fbs2plc.html Installs the ctrlX AUTOMATION SDK on the App Build Environment using a script. Ensure you are in the correct directory before running. ```bash $ ~/scripts/install-sdk.sh ``` -------------------------------- ### Install Crossbuild Dependencies Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/setup_windows_virtualbox_ubuntu.html Install necessary development libraries for both amd64 and arm64 architectures. ```bash sudo apt-get -y update sudo apt-get -y upgrade sudo apt-get -y install libsystemd-dev:arm64 sudo apt-get -y install libsystemd-dev:amd64 sudo apt-get -y install libssl-dev:amd64 sudo apt-get -y install libssl-dev:arm64 ``` -------------------------------- ### Start the Provider Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/python/provider_8py_source.html Call this method to start the provider. It returns the status of the function call. ```python Result start(self) Start the provider. ``` -------------------------------- ### JSON merge examples Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/persist-device-settings.html Examples demonstrating how JSON structures interact with existing device settings during a merge operation. ```json "users": {} ``` ```json "users": {"john": {"passwordHash": "..."}} ``` ```json "users": {"jane": {"passwordHash": "..."}} ``` ```json "users": {"john": null} ``` -------------------------------- ### System API - Start Datalayer Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/python/classctrlxdatalayer_1_1system_1_1System.html Starts the datalayer system. This function can optionally start a broker. ```APIDOC ## start() ### Description Starts a datalayer system. Use `true` to start a broker. If you are a user of the datalayer, call with `false`. ### Method Not applicable (Python function) ### Endpoint Not applicable (Python function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python system.start(bo_start_broker=True) ``` ### Response #### Success Response (200) Not applicable (Python function returns boolean) #### Response Example ```python True ``` ### Error Handling None specified. ``` -------------------------------- ### Install Java and Gradle Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-java/index.html Installs Java JDK LTS and Gradle Build Tool using a script. Ensure you check the script for specific versions. ```bash cd ctrlx-automation-sdk/scripts ./install-java-gradle.sh ``` -------------------------------- ### RemoteBuilder Usage Examples Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/java/com/boschrexroth/api/RemoteBuilder.html Examples demonstrating how to use the RemoteBuilder to create connection strings for different scenarios. ```APIDOC ## RemoteBuilder API Documentation This class provides auxiliary methods to create ctrlX Datalayer client and provider connection strings to ctrlX CORE devices. It can be used for both running in an app build environment (QEMU VM) and within the snap environment on the ctrlX CORE. ### Default Connection String Format The default values for IP address, user, password, and SSL port are set to match a newly created ctrlX CORE device: * ip="192.168.1.1" * user="boschrexroth" * password="boschrexroth" * sslPort=443 The TCP connection string can be formatted as follows: ``` tcp://{user}:{password}@{ip}?sslport={sslPort} ``` ### Customizing Connection Strings If the default values do not suit your use case, explicitly pass the parameters that require different values. #### Example 1: Custom IP, User, and Password For a ctrlX CORE or ctrlX CORE virtual with a different IP address, user, and password: ```java String connection = RemoteBuilder.create().Ip("192.168.1.100").User("admin").Password("-$_U/{X$aG}Z3/e<").build(); ``` #### Example 2: ctrlX CORE virtual with Port Forwarding (QEMU VM) For a ctrlX CORE virtual with port forwarding running on the same host as the app build environment (QEMU VM): ```java String connection = RemoteBuilder.create().IpVirtual().PortVirtual().build(); ``` **Remarks:** * `10.0.2.2` is the IP address of the host from the point of view of the app build environment (QEMU VM). * `8443` is the host port which is forwarded to the SSL port (=443) of the ctrlX CORE virtual. ### Snap Environment Considerations When building a snap and installing it on a ctrlX CORE, you do not need to change parameter settings. The `RemoteBuilder` utility detects the snap environment and automatically uses inter-process communication (IPC). In this case, the connection string to the ctrlX Datalayer is: ``` ipc:// ``` If you do not want to communicate to localhost (e.g., C2C), build the remote string manually in the following form (sslport is optional): ``` remote := "tcp://{User}:{Password}@{Ip}?sslport={SslPort}"; ``` ### Method Summary #### Static Methods * `static RemoteBuilder create()`: Creator of a System instance. * `String build()`: Builds the connection string: 'ipc' if running inside a snap, otherwise 'tcp'. #### Instance Methods * `RemoteBuilder Ip(String ip)`: Sets the IP address of the ctrlX CORE. * `RemoteBuilder Ipc()`: Uses "ipc://" to connect to a ctrlX CORE virtual, independent running inside a snap. * `RemoteBuilder IpVirtual()`: Uses "10.0.2.2" to connect to a ctrlX CORE virtual with port forwarding. * `RemoteBuilder Password(String pwd)`: Sets the password of the user. * `RemoteBuilder Port(int port)`: Sets the port number for a SSL connection. * `RemoteBuilder Port(String port)`: Sets the port number for a SSL connection. * `RemoteBuilder PortVirtual()`: For ctrlX CORE virtual with port forwarding: Uses the host port (default 8443) forwarded to port 22 of the ctrlX CORE virtual. * `RemoteBuilder User(String user)`: Sets the name of the user. ### Method Details #### `create()` ```java static RemoteBuilder create() ``` **Description:** Creator of a System instance. **Returns:** `RemoteBuilder` #### `build()` ```java String build() ``` **Description:** Builds the connection string: 'ipc' if running inside a snap, otherwise 'tcp'. **Returns:** `String` #### `Ip(String ip)` ```java RemoteBuilder Ip(String ip) ``` **Description:** IP address of the ctrlX CORE. **Parameters:** * `ip` (String) - IP Address **Returns:** `RemoteBuilder` #### `Ipc()` ```java RemoteBuilder Ipc() ``` **Description:** Use "ipc://" to connect to a ctrlX CORE virtual, independent running inside a snap. **Returns:** `RemoteBuilder` #### `IpVirtual()` ```java RemoteBuilder IpVirtual() ``` **Description:** Use "10.0.2.2" to connect to a ctrlX CORE virtual with port forwarding. **Returns:** `RemoteBuilder` #### `Password(String pwd)` ```java RemoteBuilder Password(String pwd) ``` **Description:** Password of the user. **Parameters:** * `pwd` (String) - Password of the user **Returns:** `RemoteBuilder` #### `Port(int port)` ```java RemoteBuilder Port(int port) ``` **Description:** Port number for a SSL connection. **Parameters:** * `port` (int) - Port number **Returns:** `RemoteBuilder` #### `Port(String port)` ```java RemoteBuilder Port(String port) ``` **Description:** Port number for a SSL connection. **Parameters:** * `port` (String) - Port number **Returns:** `RemoteBuilder` #### `PortVirtual()` ```java RemoteBuilder PortVirtual() ``` **Description:** ctrlX CORE virtual with port forwarding: Use the host port (default 8443) forwarded to port 22 of the ctrlX CORE virtual. **Returns:** `RemoteBuilder` #### `User(String user)` ```java RemoteBuilder User(String user) ``` **Description:** Name of the user. **Parameters:** * `user` (String) - Name of the user **Returns:** `RemoteBuilder` ``` -------------------------------- ### Install systemd development files Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-python/logbook/index.html Install the necessary development files for systemd before installing the 'cysystemd' Python package. This is a prerequisite for building and running the logging application. ```bash apt install libsystemd-dev ``` -------------------------------- ### IProvider Interface - Start Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/net/html/interfaceDatalayer_1_1IProvider.html Starts the provider, enabling it to handle data layer operations. ```APIDOC ## POST /api/provider/start ### Description Starts the provider. ### Method POST ### Endpoint /api/provider/start ### Response #### Success Response (200) - **result** (DLR_RESULT) - The result of the operation. #### Response Example ```json { "result": "DLR_SUCCESS" } ``` ``` -------------------------------- ### Makefile for API Installation Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/package-assets.html Makefile to handle copying API JSON files during app installation. ```makefile dirs := $(shell ls -d */) DESTDIR ?= $(PWD)/dist install: install -d -m 755 $(DESTDIR)/static/doc/api cp solutions/public/*.json $(DESTDIR)/static/doc/api ``` -------------------------------- ### Install ctrlX Data Layer Environment Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-python/index.html Path to the script used for installing the ctrlX Data Layer build and runtime environment. ```bash ctrlx-automation-sdk/scripts/install-ctrlx-datalayer.sh ``` -------------------------------- ### App Start Script for Mounting Storage Extension Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/storage-extension.html This script checks for the presence of the storage extension and mounts it for the application before starting. It ensures the extension is ready and handles cases where it's not detected. ```bash #!/usr/bin/env bash # check if storage extension is ready to use (prepared by Device Admin) mount | grep /var/snap/rexroth-deviceadmin/common/storage-extension if [ $? -ne 0 ]; then # No storage extension detected - abort script echo No storage extension found exit 1 fi # storage extension detected, mount for your app snapctl mount -o rw,bind /writable/system-data/var/run/mnt/storage-extension/$SNAP_NAME $SNAP_COMMON/storage-extension/$SNAP_NAME $SNAP/your-app.sh ``` -------------------------------- ### Console Output Example Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-node/datalayer.client.bulkread/index.html This is an example of the console output you can expect when the application is running and successfully reading data from the ctrlX Data Layer. ```text connection string: ipc:// address: framework/metrics/system/cpu-utilisation-percent, value: 27.6, timestamp: 2022-10-18T14:40:15.440Z, result: DL_OK address: framework/metrics/system/memavailable-mb, value: 401.9296875, timestamp: 2022-10-18T14:40:15.440Z, result: DL_OK address: framework/metrics/system/membuffers-mb, value: 12.60546875, timestamp: 2022-10-18T14:40:15.440Z, result: DL_OK address: framework/metrics/system/memcache-mb, value: 400.5859375, timestamp: 2022-10-18T14:40:15.440Z, result: DL_OK address: framework/metrics/system/memfree-mb, value: 25.640625, timestamp: 2022-10-18T14:40:15.440Z, result: DL_OK address: framework/metrics/system/memtotal-mb, value: 975.8125, timestamp: 2022-10-18T14:40:15.440Z, result: DL_OK address: framework/metrics/system/memused-percent, value: 56.3, timestamp: 2022-10-18T14:40:15.440Z, result: DL_OK ``` -------------------------------- ### Install ctrlX Data Layer Environment Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-java/index.html Installs the build and runtime environment for ctrlX Data Layer. This script is essential for working with the data layer functionalities. ```bash ctrlx-automation-sdk/scripts/install-ctrlx-datalayer.sh ``` -------------------------------- ### Initialize and Start debugpy Server Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/remote-debug-python.html This Python script initializes the debugpy package, scans for the debug port parameter, and starts the debug server, pausing execution until a client attaches. It's intended to be called early in the application's startup phase. ```python import debugging debugging.init() debugging.wait_for_client(port=12345) ``` -------------------------------- ### Navigate to Sample Project Directory Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/install-sources-from-github.html Change the current working directory to the location of the C++ data layer provider sample. ```bash cd ~/ctrlx-automation-sdk/samples-cpp/datalayer.provider.all-data ``` -------------------------------- ### GET IsStarted Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/net/html/interfaceDatalayer_1_1IDatalayerSystem.html Checks whether the DatalayerSystem has been started. ```APIDOC ## GET IsStarted ### Description Checks if the DatalayerSystem is started. ### Method GET ### Exceptions - **ObjectDisposedException** - Cannot access a disposed object. ``` -------------------------------- ### Build, Upload, and Log Snap (Command Line) Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples.html This script automates the creation, upload, installation, and log viewing of a snap package. Use the -help flag to see all available parameters and their default values. ```bash ../../scripts/build-upload-log-snap.sh -help ``` -------------------------------- ### Example ctrlx-backup.json Output Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/persist-device-settings.html The resulting structure in ctrlx-backup.json after a snapshot is created. ```json { "apps": { "myApp" : { "settings": { "$path": "apps/myApp/settings/app.snapshot" } } } } ``` -------------------------------- ### Build and Run tpm2.srk Sample Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-go/tpm2.srk/index.html Commands to compile the application and initialize the TPM2 socket environment. ```bash cd samples-go/tpm2.srk go build ./cmd/tpm2 export TPM2_SOCKET="" ./tpm2 create ./tpm2 load ``` -------------------------------- ### Create and Subscribe to a Node Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/net/html/interfaceDatalayer_1_1ISubscription.html Example demonstrates creating a subscription with specific properties and then subscribing to a single node. Ensure FlatBuffers and Variant are properly initialized. ```csharp var builder = new FlatBuffers.FlatBufferBuilder(Variant.DefaultFlatbuffersInitialSize); var properties = comm.datalayer.SubscriptionProperties.CreateSubscriptionProperties( builder: builder, idOffset: builder.CreateString("mySubscription"), keepaliveInterval: 10000, publishInterval: 1000, errorInterval: 10000); builder.Finish(properties.Value); var propertiesFlatbuffers = new Variant(builder); // Create the Subscription var(createResult, subscription) = client.CreateSubscription(propertiesFlatbuffers, userData: null); const string cpuLoad = "framework/metrics/system/cpu-utilisation-percent"; var subscribeResult = subscription.Subscribe(address: cpuLoad); Datalayer.Variant ``` -------------------------------- ### DatalayerSystem Initialization and Lifecycle Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/net/html/classDatalayer_1_1DatalayerSystem.html Methods for initializing, starting, stopping, and disposing of the DatalayerSystem instance. ```APIDOC ## DatalayerSystem() ### Description Initializes a new instance of the DatalayerSystem class. ### Parameters #### Path Parameters - **ipcPath** (string) - Optional - Path for interprocess communication. Leave empty for automatic detection. ## Start() ### Description Starts the DatalayerSystem. ### Parameters #### Request Body - **startBroker** (bool) - Optional - Use true to start a broker. If you are a user of the ctrlX Data Layer, set to false. ## Stop() ### Description Stops the DatalayerSystem. ## Dispose() ### Description Disposes the instance and releases resources. ``` -------------------------------- ### Create and Use Client with DlSystem Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/java/com/boschrexroth/api/Client.html Demonstrates the basic pattern for creating and using a Client instance within a try-with-resources block, ensuring proper resource management. ```java try (com.boschrexroth.api.DlSystem s = com.boschrexroth.api.DlSystem.create("")) { ... try(Client c = s.Factory().createClient(" ... ")) { } ... } ... ``` -------------------------------- ### Sample application console output Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-node/datalayer.client.simple/index.html Example output showing system metrics retrieved from the ctrlX Data Layer. ```text running inside snap: false client remote address: tcp://boschrexroth:boschrexroth@10.0.2.2 framework/metrics/system/cpu-utilisation-percent:{"value":1.9,"type":"double","timestamp":"2021-10-20T13:40:45.892Z"} framework/metrics/system/memavailable-mb:{"value":680.578125,"type":"double","timestamp":"2021-10-20T13:40:45.896Z"} framework/metrics/system/membuffers-mb:{"value":119.00390625,"type":"double","timestamp":"2021-10-20T13:40:45.902Z"} framework/metrics/system/memcache-mb:{"value":514.56640625,"type":"double","timestamp":"2021-10-20T13:40:45.905Z"} framework/metrics/system/memfree-mb:{"value":164.43359375,"type":"double","timestamp":"2021-10-20T13:40:45.909Z"} framework/metrics/system/memtotal-mb:{"value":985.0078125,"type":"double","timestamp":"2021-10-20T13:40:45.913Z"} framework/metrics/system/memused-mb:{"value":187.00390625,"type":"double","timestamp":"2021-10-20T13:40:45.918Z"} framework/metrics/system/memused-percent:{"value":19.4,"type":"double","timestamp":"2021-10-20T13:40:45.923Z"} ``` -------------------------------- ### Example .signature file structure Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/appsigning-oem.html A sample .signature file containing app-revision and app-privileges metadata along with cryptographic signatures. ```text type: app-revision app-name: mockcorp-my-app publisher: com.ctrlx-automation.app.mockcorp organization: Mockcorp Limited timestamp: 2024-11-18T08:15:04Z snap-digest: 52a33b17a7e578a553d46a2bb4f3ce549f15ad06742580dcba2eea138f122eae3255d4842f8ea597a3cab72b9a301791 MEYCIQCNrOfqwizQtTm+UVwx2Q4Ee5uHiMMzQYnmOhNMoODYfwIhAJGloXM7lifS vj1TVgv6DDaIAPuDCwhnKsrS3uuHSByN type: app-privileges app-name: mockcorp-my-app publisher: com.ctrlx-automation.app.mockcorp timestamp: 2024-11-18T08:15:04Z plugs: firewall-control: loop-devices: interface: custom-device custom-device: loop-devices slots: loop-devices-slot: interface: custom-device custom-device: loop-devices devices: - /dev/loop[0-9] - /dev/loop[1-9][0-9] files: read: - /proc/devices MEYCIQCNrOfqwizQtTm+UVwx2Q4Ee5uHiMMzQYnmOhNMoODYfwIhAJGloXM7lifS vj1TVgv6DDaIAPuDCwhnKsrS3uuHSByN ``` -------------------------------- ### Console Output Example Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-net/hello.world/index.html This shows the expected console output from the "Hello World" application, including timestamps. ```text Hello World! 11.03.2021 09:45:05 Hello World! 11.03.2021 09:45:06 Hello World! 11.03.2021 09:45:07 Hello World! 11.03.2021 09:45:08 ``` -------------------------------- ### Start QEMU VM with Direct Internet Access Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/setup_qemu_ubuntu.html Run this script from your QEMU VM instance folder to launch the virtual machine when it has direct internet access. This script is available for both Windows (.bat) and Linux (.sh) hosts. ```batch __launch-amd64-noproxy .bat ``` -------------------------------- ### Start QEMU VM with Proxy Server Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/setup_qemu_ubuntu.html Run this script from your QEMU VM instance folder to launch the virtual machine when it needs to use a proxy server on the host computer. This script is available for both Windows (.bat) and Linux (.sh) hosts. ```batch __launch-amd64-proxy .bat ``` -------------------------------- ### Get IpcPath Property Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/net/html/interfaceDatalayer_1_1IDatalayerSystem.html Gets the interprocess communication path. This property is part of the IDatalayerSystem interface. ```csharp string IpcPath` [get]` ``` -------------------------------- ### Get Factory Property Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/net/html/interfaceDatalayer_1_1IDatalayerSystem.html Gets the Factory to create Clients and Providers. This property is part of the IDatalayerSystem interface. ```csharp IFactory Factory` [get]` ``` -------------------------------- ### Build the Java Project Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-java/datalayer.client.sub/index.html Use the Gradle wrapper to clean and build the project. ```bash ./gradlew clean ./gradlew build ``` -------------------------------- ### Build Application Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-go/datalayer.provider.simple/index.html Standard commands for updating dependencies and building the project executable and snap package. ```bash go mod tidy ``` ```bash go build ./cmd/... ``` ```bash snapcraft ``` -------------------------------- ### Get Converter Property Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/net/html/interfaceDatalayer_1_1IDatalayerSystem.html Gets the Converter for Variant to JSON conversions. This property is part of the IDatalayerSystem interface. ```csharp IConverter Converter` [get]` ``` -------------------------------- ### Bad Example: Mixed Interface Declarations Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-snap/generate-manifest/index.html Avoid mixing global and specific interface declarations in a way that leads to unexpected behavior. In this example, global plugs are only accessible by 'example' app, while 'example2' and 'configure' hook have no declared interfaces. ```yaml apps: example: command: bin/sh plugs: wayland: x11: opengl: example2: command: bin/sh2 hooks: configure: plugs: wayland: x11: ``` -------------------------------- ### Snapcraft Configuration for Daemon Startup Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/numopenfilehandles.html Configure a snapcraft.yaml file to run a script at startup using the 'daemon' entry. This ensures the ulimit setting is applied when the snap starts. ```yaml parts: ulimit-script: plugin: dump source: ./ulimit-snap apps: ulimit: daemon: simple command: increase-ulimit.sh ``` -------------------------------- ### Install ngx-translate and related packages Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/localization.html Use npm to install the necessary libraries for localization, including @ngx-translate/core, @ngx-translate/http-loader, rxjs, and ngx-translate-multi-http-loader. ```bash npm install @ngx-translate/core @ngx-translate/http-loader rxjs --save npm install ngx-translate-multi-http-loader --save ``` -------------------------------- ### Package Manifest Menu Item Example Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/package-assets.html An example of a menu item configuration within a package manifest, including an internationalization tag. ```json "menus": { "sidebar": [ { "id": "myapp", "title": "My App", "description": "A cool app that you should not miss", "icon": "Bosch-Ic-home-outline", "link": "/myapp/home", "i18n": "sidebar.myapp" } ], } ``` -------------------------------- ### Initialize Snap Environment Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-snap/generate-manifest/index.html Command to initialize the snap directory structure. ```bash snapcraft init ``` -------------------------------- ### _create() Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/python/classctrlxdatalayer_1_1subscription__async_1_1SubscriptionAsync.html Sets up a new subscription asynchronously. ```APIDOC ## _create() ### Description Sets up a subscription. ### Parameters #### Path Parameters - **ruleset** (Variant) - Required - Variant that describe ruleset of subscription as subscription.fbs - **publishCallback** (ctrlxdatalayer.subscription.ResponseNotifyCallback) - Required - Callback to call when new data is available - **callback** (ctrlxdatalayer.client.ResponseCallback) - Required - Callback to be called when subscription is created - **userdata** (userData_c_void_p) - Optional - User data - will be returned in callback as userdata. You can use this userdata to identify your request and subscription - **token** (string) - Required - Security access token for authentication as JWT payload ### Response - **Result** - status of function call ``` -------------------------------- ### Create Connection String for ctrlX COREvirtual with Port Forwarding Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/java/com/boschrexroth/api/RemoteBuilder.html This example shows how to create a connection string for a ctrlX COREvirtual with port forwarding. It uses `IpVirtual()` and `PortVirtual()` to specify the host's IP and forwarded port. ```java String connection = RemoteBuilder.create().IpVirtual().PortVirtual().build(); ``` -------------------------------- ### Get Variant Data Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/python/variant_8py_source.html Retrieves the raw byte data from the variant. It first gets the size, then the data pointer, and converts it into a Python bytearray. ```python def get_data(self) -> bytearray: """ Returns the pointer to the data of the variant @returns array of bytes """ length = ctrlxdatalayer.clib.libcomm_datalayer.DLR_variantGetSize( self._variant) c_data = ctypes.string_at( ctrlxdatalayer.clib.libcomm_datalayer.DLR_variantGetData(self._variant), length) return bytearray(c_data) ``` -------------------------------- ### Build and Run ctrlX Data Layer Application Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-java/datalayer.provider.sub/index.html Commands to clean, build, and execute the provider or client components using Gradle. ```bash ./gradlew clean ./gradlew build ./gradlew run --args="provider" ./gradlew run --args="client" ``` -------------------------------- ### Class Members - Functions starting with 'b' Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/net/html/functions_func_b.html This section details the functions within the ctrlX Data Layer .NET API whose names start with the letter 'b'. ```APIDOC ## BrowseAsync() ### Description Asynchronously browses the data layer. ### Method GET ### Endpoint /browse ### Parameters #### Query Parameters - **path** (string) - Required - The path to browse. ### Response #### Success Response (200) - **nodes** (array) - A list of nodes found. ### Response Example ```json { "nodes": [ { "path": "/some/node", "type": "variable", "permissions": "read" } ] } ``` ``` ```APIDOC ## Build() ### Description Builds a metadata or subscription properties object. ### Method POST ### Endpoint /build ### Parameters #### Request Body - **type** (string) - Required - The type of object to build (e.g., 'metadata', 'subscriptionProperties'). - **config** (object) - Optional - Configuration for building the object. ### Request Example ```json { "type": "metadata", "config": { "description": "A sample metadata object" } } ``` ### Response #### Success Response (200) - **result** (object) - The built object. ### Response Example ```json { "result": { "description": "A sample metadata object" } } ``` ``` ```APIDOC ## BulkBrowseAsync() ### Description Asynchronously performs a bulk browse operation on the data layer. ### Method POST ### Endpoint /bulk/browse ### Parameters #### Request Body - **paths** (array) - Required - An array of paths to browse. ### Request Example ```json { "paths": [ "/path/to/node1", "/path/to/node2" ] } ``` ### Response #### Success Response (200) - **results** (array) - An array of browse results corresponding to the input paths. ### Response Example ```json { "results": [ { "path": "/path/to/node1", "nodes": [ { "path": "/path/to/node1/child1", "type": "variable", "permissions": "read" } ] } ] } ``` ``` ```APIDOC ## BulkCreateAsync() ### Description Asynchronously creates multiple nodes in the data layer. ### Method POST ### Endpoint /bulk/create ### Parameters #### Request Body - **nodes** (array) - Required - An array of node objects to create. ### Request Example ```json { "nodes": [ { "path": "/new/node1", "type": "variable", "value": 10, "permissions": "readwrite" }, { "path": "/new/node2", "type": "object", "permissions": "read" } ] } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the bulk creation was successful. ### Response Example ```json { "success": true } ``` ``` ```APIDOC ## BulkReadAsync() ### Description Asynchronously reads multiple nodes from the data layer. ### Method POST ### Endpoint /bulk/read ### Parameters #### Request Body - **paths** (array) - Required - An array of paths to read. ### Request Example ```json { "paths": [ "/path/to/variable1", "/path/to/variable2" ] } ``` ### Response #### Success Response (200) - **values** (object) - An object containing the values of the requested nodes. ### Response Example ```json { "values": { "/path/to/variable1": 100, "/path/to/variable2": "hello" } } ``` ``` ```APIDOC ## BulkReadMetadataAsync() ### Description Asynchronously reads metadata for multiple nodes from the data layer. ### Method POST ### Endpoint /bulk/read/metadata ### Parameters #### Request Body - **paths** (array) - Required - An array of paths for which to read metadata. ### Request Example ```json { "paths": [ "/path/to/node1", "/path/to/node2" ] } ``` ### Response #### Success Response (200) - **metadata** (object) - An object containing the metadata for the requested nodes. ### Response Example ```json { "metadata": { "/path/to/node1": { "type": "variable", "permissions": "read", "description": "A sample variable" } } } ``` ``` ```APIDOC ## BulkRemoveAsync() ### Description Asynchronously removes multiple nodes from the data layer. ### Method DELETE ### Endpoint /bulk/remove ### Parameters #### Request Body - **paths** (array) - Required - An array of paths to remove. ### Request Example ```json { "paths": [ "/path/to/remove1", "/path/to/remove2" ] } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the bulk removal was successful. ### Response Example ```json { "success": true } ``` ``` ```APIDOC ## BulkWriteAsync() ### Description Asynchronously writes values to multiple nodes in the data layer. ### Method POST ### Endpoint /bulk/write ### Parameters #### Request Body - **values** (object) - Required - An object where keys are paths and values are the data to write. ### Request Example ```json { "values": { "/path/to/variable1": 200, "/path/to/variable2": "world" } } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the bulk write operation was successful. ### Response Example ```json { "success": true } ``` ``` -------------------------------- ### SSH Public Key Authentication Hints Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/remote-debug-python.html Provides hints for setting up SSH public key authentication, including standard file names, file permissions, and configuration for multiple SSH connections. ```bash - Use standard file names: "id_rsa" for the private and "id_rsa.pub" for the public key file. - On the host computer set the (UNIX) permissions attributes for "id_rsa" to 600 (-rw-------) - On the host computer use the file "~/.ssh/config" to configure several ssh connections to different ctrlX CORE devices. ``` -------------------------------- ### Install Java VS Code Extensions Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-java/index.html Installs necessary Java extensions for Visual Studio Code. This script must be executed within a VS Code terminal. ```bash ./install-vcode-extensions-java.sh ``` -------------------------------- ### Example CycloneDX JSON BOM File Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/foss.html This is an example of a CycloneDX BOM file in JSON format. It includes metadata about the main component and a list of its dependencies, specifying license information for each. ```json { "bomFormat": "CycloneDX", "specVersion": "1.2", "version": 1, "metadata": { "component": { "type": "library", "name": "@acme/component", "components": [ { "type": "library", "name": "@acme/component1", "version": "1.0.0", "copyright": "Copyright (c) 2001 ACME Inc", "manufacturer": { "url": [ "https://example.com/manufacturer" ] }, "licenses": [ { "license": { "name": "MIT License", "text": { "content": "The MIT License\n\nCopyright (c) 2001 ACME Inc\n\nPermission is hereby granted, ..." } } } ] } ] } }, "components": [ { "type": "library", "name": "@acme/component2", "version": "2.0.0", "copyright": "Copyright (c) 2002 ACME Inc", "supplier": { "url": [ "https://example.com/supplier" ] }, "licenses": [ { "license": { "name": "MIT License", "text": { "content": "The MIT License\n\nCopyright (c) 2002 ACME Inc\n\nPermission is hereby granted, ..." } } } ] } ] } ``` -------------------------------- ### Debug on QEMU VM Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/dotnet.html Start debugging your .NET application on the QEMU VM using the .NET Core Launch configuration in VS Code. ```bash Run -> .NET Core Launch (console) -> Press Play ``` -------------------------------- ### Build ctrlX Data Layer Client Project Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-java/datalayer.client.bulk/index.html Use these Gradle commands to clean and build the project. Ensure you have Java and Gradle set up. ```bash ./gradlew clean ./gradlew build ``` -------------------------------- ### Build the project using Gradle Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/samples-java/datalayer.provider.simple/index.html Execute these commands to clean and build the Java project. ```bash ./gradlew clean ./gradlew build ``` -------------------------------- ### Class Members - Get Functions Source: https://boschrexroth.github.io/ctrlx-automation-sdk/latest/api/python/functions_g.html This section lists and describes the 'get' functions available for interacting with the ctrlX Data Layer. These functions are used to retrieve various types of data, properties, and information from the data layer. ```APIDOC ## Class Members - Get Functions ### Description This section details the various 'get' functions available within the ctrlX Data Layer API for Python. These functions allow users to retrieve specific data types, array data, authentication tokens, and other relevant information from the ctrlX Data Layer. ### Functions - **get_address()** : Response, _Request, NotifyItem - Description: Retrieves the address associated with a data layer item. - **get_array_bool8()** : Variant - Description: Retrieves an array of boolean values (8-bit). - **get_array_datetime()** : Variant - Description: Retrieves an array of datetime values. - **get_array_float32()** : Variant - Description: Retrieves an array of single-precision floating-point values. - **get_array_float64()** : Variant - Description: Retrieves an array of double-precision floating-point values. - **get_array_int16()** : Variant - Description: Retrieves an array of 16-bit signed integer values. - **get_array_int32()** : Variant - Description: Retrieves an array of 32-bit signed integer values. - **get_array_int64()** : Variant - Description: Retrieves an array of 64-bit signed integer values. - **get_array_int8()** : Variant - Description: Retrieves an array of 8-bit signed integer values. - **get_array_string()** : Variant - Description: Retrieves an array of string values. - **get_array_uint16()** : Variant - Description: Retrieves an array of 16-bit unsigned integer values. - **get_array_uint32()** : Variant - Description: Retrieves an array of 32-bit unsigned integer values. - **get_array_uint64()** : Variant - Description: Retrieves an array of 64-bit unsigned integer values. - **get_array_uint8()** : Variant - Description: Retrieves an array of 8-bit unsigned integer values. - **get_auth_token()** : Client - Description: Retrieves the authentication token for the client. - **get_bool8()** : Variant - Description: Retrieves a single boolean value (8-bit). - **get_bulk_request()** : _AsyncCreator - Description: Initiates a bulk request operation. - **get_count()** : Variant - Description: Retrieves the count of items. - **get_data()** : Response, _Request, NotifyItemPublish, NotifyItem, Variant - Description: Retrieves the data associated with a request or notification. - **get_datetime()** : Response, Variant - Description: Retrieves a datetime value. - **get_event_type()** : NotifyInfoPublish - Description: Retrieves the type of the event for a publish notification. - **get_flatbuffers()** : Variant - Description: Retrieves data in FlatBuffers format. - **get_float32()** : Variant - Description: Retrieves a single-precision floating-point value. - **get_float64()** : Variant - Description: Retrieves a double-precision floating-point value. - **get_handle()** : _BulkCreator, Client, Converter, Factory, ProviderNode, System, Variant - Description: Retrieves a handle for various objects like bulk creators, clients, converters, etc. - **get_id()** : ProviderSubscription - Description: Retrieves the unique identifier for a provider subscription. - **get_info()** : NotifyItemPublish - Description: Retrieves information about a publish notification item. - **get_int16()** : Variant - Description: Retrieves a 16-bit signed integer value. - **get_int32()** : Variant - Description: Retrieves a 32-bit signed integer value. - **get_int64()** : Variant - Description: Retrieves a 64-bit signed integer value. - **get_int8()** : Variant - Description: Retrieves an 8-bit signed integer value. - **get_node()** : NotifyInfoPublish - Description: Retrieves the node associated with a publish notification. - **get_notes()** : ProviderSubscription - Description: Retrieves notes or metadata associated with a provider subscription. - **get_notify_info()** : NotifyItemPublish - Description: Retrieves detailed notification information for a publish item. - **get_notify_type()** : NotifyInfoPublish - Description: Retrieves the type of notification for a publish item. - **get_props()** : ProviderSubscription - Description: Retrieves properties associated with a provider subscription. - **get_ptr()** : _CallbackPtr - Description: Retrieves a pointer to a callback function. - **get_registered_node_paths()** : Provider - Description: Retrieves a list of registered node paths on the provider. - **get_registered_type()** : Provider - Description: Retrieves the registered type of the provider. - **get_rejected_node_paths()** : Provider - Description: Retrieves a list of rejected node paths on the provider. - **get_response()** : _ResponseMgr, Bulk - Description: Retrieves the response from a manager or bulk operation. - **get_result()** : Response - Description: Retrieves the result of a response. - **get_schema()** : Converter - Description: Retrieves the schema information from a converter. - **get_sequence_number()** : NotifyInfoPublish - Description: Retrieves the sequence number of a publish notification. - **get_size()** : Variant - Description: Retrieves the size of a variant data type. - **get_source_name()** : NotifyInfoPublish - Description: Retrieves the source name of a publish notification. - **get_string()** : Variant - Description: Retrieves a string value. - **get_timestamp()** : NotifyInfoPublish, ProviderSubscription - Description: Retrieves the timestamp associated with a notification or subscription. - **get_token()** : Client, Provider - Description: Retrieves an authentication token for a client or provider. - **get_type()** : NotifyItem, Variant - Description: Retrieves the data type of an item or variant. - **get_uint16()** : Variant - Description: Retrieves a 16-bit unsigned integer value. - **get_uint32()** : Variant - Description: Retrieves a 32-bit unsigned integer value. - **get_uint64()** : Variant - Description: Retrieves a 64-bit unsigned integer value. - **get_uint8()** : Variant - Description: Retrieves an 8-bit unsigned integer value. - **get_unique_id()** : ProviderSubscription - Description: Retrieves the unique identifier for a provider subscription. ```