Today is...
Tuesday, May 22, 2018
Welcome to Control.com, the global online
community of automation professionals.
Featured Video...
A demonstration of EtherCAT control of linear motors using the CTC EtherCAT master.
Help keep our servers running...
Converting Integer Data Type to Celsius or Fahrenheit
Simple conversion escapes me

How do I convert an integer data type to Celsius or Fahrenheit? For example 0-32767

1 out of 2 members thought this post was helpful...

What temperature value does your count of 32767 represent? C or F?
What temperature value does your count of 0 represent? C or F?

0 out of 1 members thought this post was helpful...

32767 = 3400F
It is for scaling a temperature sensor in liquid steel bath.

>What temperature value does your count of 32767 represent?
>C or F?
>What temperature value does your count of 0 represent? C or
>F?

By pvbrowser on 19 June, 2017 - 9:44 am
1 out of 1 members thought this post was helpful...

`case C2FAHRENHEIT:      ret = (val * 9.0f / 5.0f) + 32.0f;      break;    case FAHRENHEIT2C:      ret = (val - 32.0f) * 5.0f / 9.0f;      break;`

1 out of 1 members thought this post was helpful...

Starting with the raw value stored in a register called "integer" and assuming that 0-32767 = 0-3400F:

DegF = (integer/32767) * 3400

DegC = (DegF - 32)*5/9