Wrong description type variables lut component

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
Jorg_Guldner
Posts: 47
http://meble-kuchenne.info.pl
Joined: Wed Dec 23, 2020 9:55 am
Been thanked: 4 times

Wrong description type variables lut component

Post 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 2205 times

Regards
Jorg

mnfisher
Valued Contributor
Posts: 1110
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 113 times
Been thanked: 584 times

Re: Wrong description type variables lut component

Post 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

Jorg_Guldner
Posts: 47
Joined: Wed Dec 23, 2020 9:55 am
Been thanked: 4 times

Re: Wrong description type variables lut component

Post 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

Post Reply