displays as unsigned integer why?

6 comentarios

Jan
Jan el 21 de Dic. de 2022
The question does not contain enough information to be answered.
bill buersch
bill buersch el 21 de Dic. de 2022
well the range for a 16 bit integer is
-32,768 to +32,767
however for an unsigned 16 bit integer it is
0 and 65,535 In the picture we see 65535 shown but in fact is -1 because that while the bits are the same, it is being wrongly interpreted by the chart program on the website.
A 16-bit integer can store 216 (or 65,536) distinct values. In an unsigned representation, these values are the integers between 0 and 65,535; using two's complement, possible values range from −32,768 to 32,767.
So i guess my question is there as setting to have 65,535 treated as a signed integer so the chart looks right?
Geoff Hayes
Geoff Hayes el 21 de Dic. de 2022
@bill buersch perhaps you need to show the code that generates this chart.
bill buersch
bill buersch el 21 de Dic. de 2022
i can't because it is thingspeak code that generates the chart. it's the chart you get when you log in. it interprets as unsigned when it should interpret as signed. but i see that there is no way it would know.
bill buersch
bill buersch el 21 de Dic. de 2022
Movida: DGM el 21 de Dic. de 2022
notice that when the outside air temp rises above 0 it's fine.
bill buersch
bill buersch el 21 de Dic. de 2022
Movida: DGM el 21 de Dic. de 2022
data as stored: 2022-12-21 12:36:13 UTC,1,65535,,,,,,,

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Simulink Functions en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 21 de Dic. de 2022

Movida:

DGM
el 21 de Dic. de 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by