README Node.js datalayer.client¶
This Node.js sample reads values from ctrlX Data Layer.
Introduction¶
The sample demonstrates how to read values from ctrlX Data Layer tree and write out the values to console.
Description¶
The sample datalayer.client demonstrates
-
How easy to create a client for ctrlX Data Layer
-
How to read values from ctrlX Data Layer nodes
-
How to create a subscription to a ctrlX Data Layer node
Prerequisites¶
Please read the common Node.js docs here, first.
Debug and Run¶
- Run 'npm install' in the terminal.
- Launch the app with the debugger attached by pressing F5.
Build and Install¶
- Launch Visual Studio Code
- Click on the Remote Explorer from the menu.
- Choose Open Folder in QEMU VM.
- Open the directory datalayer.client.
- Build and install snap as described here.
-
Check the output using Diagnostics:
-
Login into your ctrlX
- Navigate to Diagnostics -> Logbook
- Click Settings on the right top corner
- Enable Show system messages
- Navigate to Filter -> Units and check your snap.sdk-node-client-simple.app.service
- Now you should the see the app output diagnostics.
-
Press Refresh to update.
-
If you have root permissions, you can also watch the output on any ssh console with the command:
sudo snap logs sdk-node-client-simple.app -f | more
Console Output¶
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"}
Install the App¶
Login into ctrlX and install the App (Apps).
Gratulations - We're finished - Let's start coding¶
Support¶
Developer Community¶
Please join the Developer Community
SDK Forum¶
Please visit the SDK Forum
Issues¶
If you've found an error in these sample, please file an issue
License¶
SPDX-FileCopyrightText: Bosch Rexroth AG SPDX-License-Identifier: MIT