The purpose of this example is to show how to set up the configuration files required to automatically configure a dashboard with a signal showing the state of a pushbutton on the target hardware and a graph showing the value of a counter in the target application. The screenshot below shows the final dashboard.
The target code used in this example can be found in Auto-Configuration Example Code.
Three files are required by the Data Visualizer to enable Auto-Configuration, a .ds file describing the data stream content, a .db file describing the dashboard and a .sc file describing the connections between the data stream content and the dashboard elements. All files should be named "C0FFEEC0FFEEC0FFEEC0FFEE" before the extension to match the Auto Configuration ID sent by the application code.
The example application generates a data stream with two stream components, an unsigned 16-bit value and an unsigned 8-bit value.
D,1,1,count B,2,1,button
The .ds file will create a table with two sources from the data stream. Column 1 row 1 will contain a source with unsigned 16-bit values named "count" and column 2, row 1 will contain a source with unsigned 8-bit values named "button". For more information on the .ds file format see Configuration Format.
The easiest way to set up a dashboard for the Auto-Configuration is to draw it in the Data Visualizer GUI and save the configuration to file.
The .db file content should have content similar to:
{ 0, '\0', 0, 255, 255, 255, 44, 1, }; { 0, // Dashboard ID 0, // Element ID DB_TYPE_LABEL, // Element Type 0, // Z-Index (GUI stack order) 63, 0, // X-coordinate 48, 0, // Y-coordinate 100, 0, // Width 22, 0, // Height 16, // Font Size 1, 0, // Horizontal Alignment 0, // Vertical Alignment 0, 255, 255, 255, // Background Color 255, 0, 0, 0, // Foreground Color 'B', 'u', 't', 't', 'o', 'n', ' ', 'S', 't', 'a', 't', 'e', '\0', // Text }; { 0, // Dashboard ID 1, // Element ID DB_TYPE_SIGNAL, // Element Type 0, // Z-Index (GUI stack order) 98, 0, // X-coordinate 78, 0, // Y-coordinate 25, 0, // Width 25, 0, // Height 255, 0, 255, 0, // Color On 255, 255, 0, 0, // Color Off }; { 0, // Dashboard ID 2, // Element ID DB_TYPE_GRAPH, // Element Type 0, // Z-Index (GUI stack order) 206, 0, // X-coordinate 12, 0, // Y-coordinate 64, 1, // Width 240, 0, // Height 255, 255, 255, // Title color 0, 0, 0, // Background color 20, 20, 20, // Graph background color 'c', 'o', 'u', 'n', 't', ' ', 'v', 'a', 'l', 'u', 'e', '\0', // Title 1, // Number of plots 0,0,0,0, // X Minimum 0,0,160,64, // X Maximum 0,0,0,0, // Y Minimum 0,232,128,71, // Y Maximum 1, 1, };
For more information on the Dashboard elements, see Element Types.
button,1 count,2
The .sc file will connect the stream source named “button” to the Dashboard element with ID 1 (the Signal element) and the stream source named “count” to the Dashboard element with ID 2 (the Graph element).
Then it is time to run the example.
After connecting and detecting the Auto-Configuration ID the Data Visualizer should create a Data Stream Control Panel and a Dashboard I/O looking something like the image below.
The Graph element shows a running sawtooth signal which represents the counter continuously counting up until it wraps. The Signal element shows the state of the push button on the ATtiny104 Xplained Nano board. Pushing the button changes the color of the Signal element from red to green.
Expanding the Data Stream Control Panel by clicking the down arrow to the right in the panel shows the content of the automatically configured Data Stream.
The stream has two sources, one for the counter value and one for the button state.
Expanding the Serial Port Control Panel shows that Data Visualizer detected the baud rate to be 38400.