working with binary data
Hi I am looking for a little help representing a status register on the dashboard.
The register is a unit16 binary for example bit 12 indicates "on" bit 11"off" bit 13 "hold"
I would like to have one value on the dashboard for status that will indicate what value is true
"inverter status : ON"
I am using dashboard designer
Thanks for your help
Jared Wiltshire last edited by Jared Wiltshire
@tapcon There's a couple of ways to go about this, you can create a meta-point which extracts the values you are interested in from the uint16 value or you can just create a display using the dashboards.
The advantage to creating the meta point is that you can see the value easily elsewhere in Mango and trend it etc. To do so, create a Meta Data Source and add a point like this -
To display the value directly in the dashboard you will need to add a user module and create a filter to extract the bits you are interested in. Unfortunately you can't put this directly into your markup as an angular expression as the binary operators don't work in angular expressions.
See edit below, I released a version of the dashboard with this filter built in yesterday.
Jared Wiltshire last edited by
There is now a filter called
maExtractBitsin the UI module.
You can then use it like this -
<div id="e39fea8a-c64a-4ae6-9e3c-d80d4aa0acb0" style="position: absolute; left: 369px; top: 145px;" ng-switch="point.value | maExtractBits:'0x3800':11"> Inverter status: <span ng-switch-when="1">Off</span> <span ng-switch-when="2">On</span> <span ng-switch-when="4">Hold</span> </div>