README .NET datalayer.client.bulkread¶
This .NET sample reads values in bulk mode from ctrlX Data Layer.
Introduction¶
The sample demonstrates how to bulk read values from ctrlX Data Layer and write out the values to console. The bulk read is performed every 10 seconds in an endless loop.
Description¶
The implementation include the following steps:
- Create and start the 'DatalayerSystem' service
- Create a client
- Bulk Read values synchron with method client.BulkRead(addresses)
- Bulk Read values asynchron with mehtod client.BulkReadAsync(addresses)
- Bulk Read methods are called in an endless loop every 10s.
Prerequisites¶
Please read the common .NET docs here, first.
Debug and Run¶
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.
- Open the directory datalayer.client.bulkread.
- 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-net-client-bulkread.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-net-client-bulkread.app -f | more
Console Output¶
ctrlX Data Layer system started.
ctrlX Data Layer client created.
# client.BulkRead
address: framework/metrics/system/cpu-utilisation-percent, value: 0,9, timestamp: 29.09.2022 12:38:13, result: DL_OK
address: framework/metrics/system/memavailable-mb, value: 438,60156, timestamp: 29.09.2022 12:38:13, result: DL_OK
address: framework/metrics/system/membuffers-mb, value: 26,777344, timestamp: 29.09.2022 12:38:13, result: DL_OK
address: framework/metrics/system/memcache-mb, value: 433,33594, timestamp: 29.09.2022 12:38:13, result: DL_OK
address: framework/metrics/system/memfree-mb, value: 14,636719, timestamp: 29.09.2022 12:38:13, result: DL_OK
address: framework/metrics/system/memtotal-mb, value: 975,8125, timestamp: 29.09.2022 12:38:13, result: DL_OK
address: framework/metrics/system/memused-percent, value: 52,6, timestamp: 29.09.2022 12:38:13, result: DL_OK
# client.BulkReadAsync
address: framework/metrics/system/cpu-utilisation-percent, value: 0,9, timestamp: 29.09.2022 12:38:13, result: DL_OK
address: framework/metrics/system/memavailable-mb, value: 438,60156, timestamp: 29.09.2022 12:38:13, result: DL_OK
address: framework/metrics/system/membuffers-mb, value: 26,777344, timestamp: 29.09.2022 12:38:13, result: DL_OK
address: framework/metrics/system/memcache-mb, value: 433,33594, timestamp: 29.09.2022 12:38:13, result: DL_OK
address: framework/metrics/system/memfree-mb, value: 14,636719, timestamp: 29.09.2022 12:38:13, result: DL_OK
address: framework/metrics/system/memtotal-mb, value: 975,8125, timestamp: 29.09.2022 12:38:13, result: DL_OK
address: framework/metrics/system/memused-percent, value: 52,6, timestamp: 29.09.2022 12:38:13, result: DL_OK
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