Tutorial examples¶
The Dracal installer includes the service and ready-to-run tutorial examples by default. Each tutorial comes with full source code and a pre-built executable — so you can test your installation immediately, without building anything first.
The tutorials are located at:
C:\Program Files\Dracal\Tutorials
/usr/share/dracal/tutorials
macOS
Tutorial examples are not yet available on macOS.
The following examples are included:
- example_1: Check if the Dracal Device Service is running
- example_2: List available devices
- example_3: Retrieve information about a specific device
- example_4: Retrieve all data from an RTD300 device
Pre-built executables use latest in their name (e.g., dracal-cpp-latest-example-1). When you build from source, the executable includes the version number instead (e.g., dracal-cpp-3.6.0-example-1).
Pre-built executables are in C:\Program Files\Dracal\Tutorials\CPP\Examples
The executables are installed in /usr/bin and are available in your $PATH, so you can run them from any directory.
Test installation
The pre-built examples are ideal for testing your installation since they work out of the box with no additional configuration.
Example 1: Check service status¶
C:\Program Files\Dracal\Tutorials\CPP\Examples>dracal-cpp-latest-example-1.exe
{
"service_name": "dracal-device-service",
"status": "ok",
"version": {
"major": 3,
"minor": 5,
"patch": 0,
"tag": "v3.6.0-r1",
"tweak": 0
}
}
Dracal Device Service is running
Press enter to close this window...
$ ./dracal-cpp-latest-example-1
{
"service_name": "dracal-device-service",
"status": "ok",
"version": {
"major": 3,
"minor": 5,
"patch": 0,
"tag": "v3.6.0-r1",
"tweak": 0
}
}
Dracal device service is running
Example 2: List available devices¶
C:\Program Files\Dracal\Tutorials\CPP\Examples>dracal-cpp-latest-example-2.exe
Dracal devices found:
VCP-BAR20-CAL with serial E23892
Press enter to close this window...
$ ./dracal-cpp-latest-example-2
Dracal devices found:
VCP-BAR20-CAL with serial E23892
Example 3: Get device information¶
C:\Program Files\Dracal\Tutorials\CPP\Examples>dracal-cpp-latest-example-3.exe
First Dracal device found:
VCP-BAR20-CAL with serial E23892
Channels
altitude : timestamp: 2025-12-03T18:52:29.178Z value: -2808795.75 mm
internal_temperature : timestamp: 2025-12-03T18:52:29.178Z value: 25.34 °C
pressure : timestamp: 2025-12-03T18:52:29.178Z value: 139.94 kPa
Press enter to close this window...
$ ./dracal-cpp-latest-example-3
First Dracal device found:
VCP-BAR20-CAL with serial E23892
Channels
altitude : timestamp: 2025-12-03T18:52:29.178Z value: -2808795.75 mm
internal_temperature : timestamp: 2025-12-03T18:52:29.178Z value: 25.34 °C
pressure : timestamp: 2025-12-03T18:52:29.178Z value: 139.94 kPa
Example 4: Get information from an RTD300 device¶
This example uses the RTD300, one of our most popular products.
C:\Program Files\Dracal\Tutorials\CPP\Examples>dracal-cpp-latest-example-4.exe
First Dracal RTD300 device found:
Product: VCP-RTD300-CAL, Serial: E22377
Temperature:
timestamp: 2025-12-12T01:27:54.087Z
value : 120.68 °C
Press enter to close this window...
$ ./dracal-cpp-latest-example-4
First Dracal RTD300 device found:
Product: VCP-RTD300-CAL, Serial: E22377
Temperature:
timestamp: 2025-12-12T01:27:54.087Z
value : 120.68 °C
Building Examples¶
See tutorials for detailed instructions on building the tutorials yourself.
Copy tutorial files before building
You must copy the tutorial files to another directory to avoid:
- Altering the original tutorial files
- Permission issues when building in protected system directories