05-18-2017 10:44 AM
I have a system with an Arduino microcontroller that displays thermocouple temperature (in degF, degC, R, or K) depending on the desire of the local user. Currently, the microcontroller broadcasts to a monitor computer a string of ([temperature]: [temperature unit]: [time s]) which is to be parsed, written to a file (probably kept in a cluster array as well?), and displayed to the user on a time graph.
If I want the monitor to be able to quickly change the displayed graph from one temperature value to another (degF, degC, R, or K) what is the best way to get the best response time?
My instinct says to always convert the input temperature to the most commonly used unit (degC) log it, and then convert the display for the monitor when they want a different unit, but idk if there's a better way since the relationships between each unit is constant.
05-18-2017 01:47 PM
I would just have the user select which units they want and convert to that unit. If they change units, convert all of the data in your graph (or clear the chart). I would just store the units with the measurement in the log file (ie no temperature conversion). So just convert for display purposes.
05-20-2017 01:47 PM
A fairly crude but perhaps effective alternative might be to change the multiplier and offset for the Y-scale based on the display choice. This only works if you can get all of your data in the same units though, so you'd want to be careful either to always acquire in one unit, or to record in one unit after conversion, and display the recorded/processed (not directly live) data.