PLUS+1 User Forum

PLUS+1 Tools => PLUS+1 GUIDE => Topic started by: BBarry on July 06, 2022, 12:20:40 AM

Title: Where are my F-(Foating) variables?
Post by: BBarry on July 06, 2022, 12:20:40 AM
 :o
Ok - So the manual seems to suggest that F32 and F64 floats exist. But I do not seem to have access to that as a datatype?
I have to take 2 byte CAN data and i need to scale it by 0.00390625 %/bit. I realize I could just do some rounding and multiply it by 39 and then divide it by 10,000. But I could loose a percent in rounding resolution there.
My other option is use the whole numbers in all my math and just keep the rounded low res for display. I hate doing that to future programmers. (I would then have 2 variables "VariableName" and "VariableNameDivide10K"

Any way to get access to the floats?
Is there a better way?


Title: Re: Where are my F-(Foating) variables?
Post by: SJ Industries on July 06, 2022, 12:20:29 PM
Maybe a direct route to a Structured text POU. ?? I haven't had to deal with floats as such but I do use POUs for more complex maths.
Title: Re: Where are my F-(Foating) variables?
Post by: FluidPowerTom on July 06, 2022, 06:59:40 PM
GUIDE doesn't support floats in the graphical environment at all.  As mentioned by SJ you'll have to just run the signal to a Structured Text POU wherein you can use the 'REAL' data type.