Light Sensor Dashboard

The ADP example sets up a dashboard for the I/O1 Xplained Pro light sensor and LED that looks something like the screenshot below.

Note: The appearance of screenshots will vary with operating system version and configuration.

The light sensor dashboard is configured by the messages detailed in the tables below.

First, the dashboard itself must be set up.

Table 1. MSG_CONF_DASHBOARD
Field Values Description
Token 0xFF  
Message ID 0x2A  
Data length 38  
ID 0x0000 Dashboard ID
Label “Light Sensor Example Dashboard\0” Dashboard label
Background color 0xFFFFFF (transmitted as 0xFFFFFFFFFFFF as each 0xFF character must be transmitted as 0xFFFF, see Message Format) Background color of dashboard
Height 300 Height (in pixels) of dashboard

Next, Label elements are added to the dashboard.

Table 2. MSG_CONF_DASHBOARD_ELEMENT, ELEMENT_TYPE_LABEL
Field Values Description
Token 0xFF  
Message ID 0x2B  
Data length 47 Depending on element type
Dashboard ID 0x0000 ID of light sensor dashboard
Element ID 0x0000 Unique ID of label element
Z-Index 0 Order index, 0 places the element the farthest to the back
X-coordinate 5 X-coordinate of element location. 0 is topmost position on dashboard.
Y-coordinate 5 Y-coordinate of element location. 0 is topmost position on dashboard.
Width 300 Width of element (pixels)
Height 35 Height of element (pixels)
Element type 0x00 ELEMENT_TYPE_LABEL
Font size 24  
Attribute 0x00 Bold = OFF, Italic = OFF
Horizontal alignment 1 Center
Vertical alignment 1 Center
Background transparency 0  
Background color 0xFFFFFF (transmitted as 0xFFFFFFFFFFFF as each 0xFF character must be transmitted as 0xFFFF, see Message Format) RGB color of background
Foreground transparency 255 (transmitted as 0xFFFF as each 0xFF character must be transmitted as 0xFFFF, see Message Format)  
Foreground color 0x000000 RGB color of background
Label text “Light Sensor Example\0”  
Table 3. MSG_CONF_DASHBOARD_ELEMENT, ELEMENT_TYPE_LABEL
Field Values Description
Token 0xFF  
Message ID 0x2B  
Data length 45 Depending on element type
Dashboard ID 0x0000 ID of light sensor dashboard
Element ID 0x0001 Unique ID of label element
Z-Index 0 Order index, 0 places the element the farthest to the back
X-coordinate 5 X-coordinate of element location. 0 is topmost position on dashboard.
Y-coordinate 60 Y-coordinate of element location. 0 is topmost position on dashboard.
Width 129 Width of element (pixels)
Height 25 Height of element (pixels)
Element type 0x00 ELEMENT_TYPE_LABEL
Font size 14  
Attribute 0x01 Bold = ON, Italic = OFF
Horizontal alignment 0 Left
Vertical alignment 1 Center
Background transparency 0  
Background color 0xFFFFFF (transmitted as 0xFFFFFFFFFFFF as each 0xFF character must be transmitted as 0xFFFF, see Message Format) RGB color of background
Foreground transparency 255 (transmitted as 0xFFFF as each 0xFF character must be transmitted as 0xFFFF, see Message Format)  
Foreground color 0x000000 RGB color of background
Label text “Light Sensor Value\0”  
Table 4. MSG_CONF_DASHBOARD_ELEMENT, ELEMENT_TYPE_LABEL
Field Values Description
Token 0xFF  
Message ID 0x2B  
Data length 38 Depending on element type
Dashboard ID 0x0000 ID of light sensor dashboard
Element ID 0x0002 Unique ID of label element
Z-Index 0 Order index, 0 places the element the farthest to the back
X-coordinate 5 X-coordinate of element location. 0 is topmost position on dashboard.
Y-coordinate 100 Y-coordinate of element location. 0 is topmost position on dashboard.
Width 82 Width of element (pixels)
Height 25 Height of element (pixels)
Element type 0x00 ELEMENT_TYPE_LABEL
Font size 14  
Attribute 0x01 Bold = ON, Italic = OFF
Horizontal alignment 0 Left
Vertical alignment 1 Center
Background transparency 0  
Background color 0xFFFFFF (transmitted as 0xFFFFFFFFFFFF as each 0xFF character must be transmitted as 0xFFFF, see Message Format) RGB color of background
Foreground transparency 255 (transmitted as 0xFFFF as each 0xFF character must be transmitted as 0xFFFF, see Message Format)  
Foreground color 0x000000 RGB color of background
Label text “Night Light\0”  
Table 5. MSG_CONF_DASHBOARD_ELEMENT, ELEMENT_TYPE_LABEL
Field Values Description
Token 0xFF  
Message ID 0x2B  
Data length 38 Depending on element type
Dashboard ID 0x0000 ID of light sensor dashboard
Element ID 0x0003 Unique ID of label element
Z-Index 0 Order index, 0 places the element the farthest to the back
X-coordinate 5 X-coordinate of element location. 0 is topmost position on dashboard.
Y-coordinate 230 Y-coordinate of element location. 0 is topmost position on dashboard.
Width 80 Width of element (pixels)
Height 25 Height of element (pixels)
Element type 0x00 ELEMENT_TYPE_LABEL
Font size 14  
Attribute 0x01 Bold = ON, Italic = OFF
Horizontal alignment 0 Left
Vertical alignment 1 Center
Background transparency 0  
Background color 0xFFFFFF (transmitted as 0xFFFFFFFFFFFF as each 0xFF character must be transmitted as 0xFFFF, see Message Format) RGB color of background
Foreground transparency 255 (transmitted as 0xFFFF as each 0xFF character must be transmitted as 0xFFFF, see Message Format)  
Foreground color 0x000000 RGB color of background
Label text “LED Control\0”  

A stream needs to be set up to receive light sensor data.

Table 6. MSG_CONF_STREAM
Field Values Description
Token 0xFF  
Message ID 0x20  
Data length 18  
ID 0x0001 ID of the light sensor data stream
Type 12 Stream type float
Mode 2 Out from target
State 0 Stream state ON
Label “Light sensor\0” Label of the data stream

And a Progress bar to show the light sensor data is added.

Table 7. MSG_CONF_DASHBOARD_ELEMENT, ELEMENT_TYPE_PROGRESS
Field Values Description
Token 0xFF  
Message ID 0x2B  
Data length 29 Depending on element type
Dashboard ID 0x0000 ID of the light sensor dashboard
Element ID 0x0004 Unique ID of the progress bar element
Z-Index 0 Order index, 0 places the element the farthest to the back
X-coordinate 140 X-coordinate of element location. 0 is topmost position on dashboard.
Y-coordinate 60 Y-coordinate of element location. 0 is topmost position on dashboard.
Width 145 Width of element (pixels)
Height 25 Height of element (pixels)
Element type 0x03 ELEMENT_TYPE_PROGRESS
Minimum value 0  
Maximum value 4  
Initial value 0  
Color 0x008000 RGB color of progress bar

Eventually, the light sensor data stream is connected to the Progress bar element.

Table 8. MSG_CONF_ADD_STREAM_TO_ELEMENT
Field Values Description
Message ID 0x2C  
Data length 6  
Dashboard ID 0x0000 ID of the light sensor dashboard
Element ID 0x0004 ID of the progress bar element
Stream ID 0x0001 ID of the light sensor data stream

Next, a Graph element is added to the dashboard.

Table 9. MSG_CONF_DASHBOARD_ELEMENT, ELEMENT_TYPE_GRAPH
Field Values Description
Token 0xFF  
Message ID 0x2B  
Data length 53 Depending on element type
Dashboard ID 0x0000 ID of the light sensor dashboard
Element ID 0x0007 Unique ID of graph element
Title color 0xFFFFFF (transmitted as 0xFFFFFFFFFFFF as each 0xFF character must be transmitted as 0xFFFF, see Message Format) RGB color of title
Background color 0x000000 RGB color of graph frame
Graph background color 0x000000 RGB color of graph
Title text “Light level\0”  
Plot count 1  
Xmin 0  
Xmax 10  
Ymin 0  
Ymax 5  
Mode 0x00

Mouse interaction OFF

Fit graph to right edge of canvas OFF

And the light sensor data stream is connected to the Graph.

Table 10. MSG_CONF_ADD_STREAM_TO_ELEMENT
Field Values Description
Message ID 0x2C  
Data length 6  
Dashboard ID 0x0000 ID of the light sensor dashboard
Element ID 0x0007 ID of the graph element
Stream ID 0x0001 ID of the light sensor data stream

A separate stream is set up to signal Night mode.

Table 11. MSG_CONF_STREAM
Field Values Description
Token 0xFF  
Message ID 0x20  
Data length 16  
ID 0x0029 ID of the Night mode stream
Type 2 Stream type uint_8
Mode 2 Out from target
State 0 Stream state ON
Label “Night Mode\0” Label of the data stream

A Signal element is added to the dashboard for the Night mode signal.

Table 12. MSG_CONF_DASHBOARD_ELEMENT, ELEMENT_TYPE_SIGNAL
Field Values Description
Token 0xFF  
Message ID 0x2B  
Data length 22 Depending on element type
Dashboard ID 0x0000 ID of the light sensor dashboard
Element ID 0x0005 Unique ID of the signal element
Z-Index 0 Order index, 0 places the element the farthest to the back
X-coordinate 140 X-coordinate of element location. 0 is topmost position on dashboard.
Y-coordinate 100 Y-coordinate of element location. 0 is topmost position on dashboard.
Width 25 Width of element (pixels)
Height 25 Height of element (pixels)
Element type 0x04 ELEMENT_TYPE_SIGNAL
On transparency 255 (transmitted as 0xFFFF as each 0xFF character must be transmitted as 0xFFFF, see Message Format)  
On color 0x008000 RGB color for ON state
Off transparency 255 (transmitted as 0xFFFF as each 0xFF character must be transmitted as 0xFFFF, see Message Format)  
Off color 0x000000 RGB color for OFF state

And the Night mode stream is connected to the Signal element.

Table 13. MSG_CONF_ADD_STREAM_TO_ELEMENT
Field Values Description
Message ID 0x2C  
Data length 6  
Dashboard ID 0x0000 ID of the light sensor dashboard
Element ID 0x0005 ID of the signal element
Stream ID 0x0029 ID of the night mode stream

Next, a incoming stream (in to target) is set up to transfer the Button status to the target.

Table 14. MSG_CONF_STREAM
Field Values Description
Token 0xFF  
Message ID 0x20  
Data length 16  
ID 0x0030 ID of the button stream
Type 2 Stream type uint_8
Mode 0 In to target
State 0 Stream state ON
Label “LED Toggle\0” Label of the stream

A Button is added to the dashboard to toggle the target LED.

Table 15. MSG_CONF_DASHBOARD_ELEMENT, ELEMENT_TYPE_BUTTON
Field Values Description
Token 0xFF  
Message ID 0x2B  
Data length 26 Depending on element type
Dashboard ID 0x0000 ID of the light sensor dashboard
Element ID 0x0006 Unique ID of the signal element
Z-Index 0 Order index, 0 places the element the farthest to the back
X-coordinate 110 X-coordinate of element location. 0 is topmost position on dashboard.
Y-coordinate 230 Y-coordinate of element location. 0 is topmost position on dashboard.
Width 75 Width of element (pixels)
Height 50 Height of element (pixels)
Element type 0x01 ELEMENT_TYPE_BUTTON
Font size 10  
Button text “LED Toggle\0”  
Toggle button
  • 0x00 = Normal button
  • 0x01 = Toggle button
Normal button

And the button stream is connected to the Button element.

Table 16. MSG_CONF_ADD_STREAM_TO_ELEMENT
Field Values Description
Message ID 0x2C  
Data length 6  
Dashboard ID 0x0000 ID of the light sensor dashboard
Element ID 0x0006 ID of the button element
Stream ID 0x0030 ID of the button stream