Home AMX Forum NetLinx Studio
Options

Proper Use of FLOAT

Greetings,

I am working on a project in which I am monitoring analog to digital convertors. The convertor resolution is 12-bit (4,095 possible values).

In the process of calculation, I need to arrive at a decimal value less than one. I always thought that this would be the place for a FLOAT variable.

DEFINE_VARIABLE
FLOAT fVOLTS
....EVENT....
fVOLTS=(((cTRANS_MESSAGE[9]*256)+(cTRANS_MESSAGE[10]))/4095)

Removing the /4095 will return a 12-bit range integer value for fVOLTS, but trying to divide that value by 4095 gives zero. I am observing the zero value in debug as well as with an FTOA sent to a touchpanel.

Any help appreciated. Thank you.

Comments

Sign In or Register to comment.