Scaling a data point
It would be great if it was possible to scale a data point in the data point Properties eg: have a section by the text rendering properties where a device span and engineering span could be put in.
device span : min= 0, max = 4095
engineering span: min= 0 , max= 100
unit = %
This would convert a 12 bit analog signal to a 0 to 100%
currently I am solving the problem by making a meta data source and a data point for each unit I need to scale. I think adding it to the original data point properties will make it a lot easier when doing bulk configurations in excel.
Thanks for the suggestion! I can definitely see adding this as a new type of text renderer. But, that wouldn't store the value as the 0-100%, only convert it for display. If you want it stored as that value, I do think either a meta point or converting it at the edge device is the current solution, as you suggest, or associating the range with it and then handling this logic in the UI.
Presumably you also want this point to convert the set value outbound from 50% to 2047, right?
Thanks for the response. I didn't think about the fact that the rendered text would not be logged and that would only make it a semi useful. Maybe there could be a tick box for which .value should be logged either. There are a number of reasons why I don't like to scale at the edge.. But I also understand that this suggestion is encroaching on what the meta point was made for...
If done that way it would still appear as the rendered value in API queries and whatnot. A virtual point with two point links to and from the scaled point, with links like:
unscaled to scaled:
if(source.time <= target.time) return UNCHANGED; TIMESTAMP=source.time; return ((source.value/4095)*100).toFixed(0);
scaled to unscaled:
if(source.time <= target.time) return UNCHANGED; TIMESTAMP=source.time; return ((source.value/100)*4095).toFixed(0);
Will permit you to set or display whichever point suits the purposes.