Page 1 of 1

Wrong description type variables lut component

Posted: Fri Jul 12, 2024 9:24 am
by Jorg_Guldner
Hello!
I choose 16bit uint in the setup box of the lut. The return and index value is set to ulong? Is here the advice wrong?
Please have a look to the attached picture. It works with a return variable uint.
LUT_ulong.jpg
LUT_ulong.jpg (72.97 KiB) Viewed 3558 times

Regards
Jorg

Re: Wrong description type variables lut component

Posted: Fri Jul 12, 2024 1:55 pm
by mnfisher
It shouldn't cause any issues - as long as the type is for the same or a larger type then everything will work.
Note that having a long for the index means that the lookup table can have up to 2^32.entries (unlikely on an mcu).

The returned value will be the same (and correct) as long as you use a suitable variable for the result

Re: Wrong description type variables lut component

Posted: Sat Jul 13, 2024 8:52 am
by Jorg_Guldner
Hello!
The maths works, thats OK!. Confusing at first is the description "Return Value(U_Long)", because i do the setup for uint 16bit. Is it not beter for more understanding to write here: "Return Value type (Choosed in Properties) and something like that for the index?
Sometimes users see points with other eyes, like you do.


Regards
Jorg