How to get integer value from LUT FC6??

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
kg300
Posts: 31
Joined: Thu May 31, 2018 6:25 am
Has thanked: 5 times
Been thanked: 1 time
Contact:

How to get integer value from LUT FC6??

Post by kg300 »

In FC-V6 i used LUT component to get integer value, program simulate ok but on physical hardware only get Byte value from LUT. any suggestion plz...
Attachments
LUT.fcfx
(5.81 KiB) Downloaded 200 times

mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: How to get integer value from LUT FC6??

Post by mnf »

That is weird - you would think that changing the storage type to 16 bit (in the lut properties) would fix this - but it doesn't!

Reading an 8 bit number from 0 * 256 + 8 bit read from 1 also doesn't work if data is set to 16 bit.

Setting data to 8 bit - and when storing it in the lut properties as 8 bit (eg 258 would be 1, 2) and then reading it back 8 bits at a time does work.....

This in v7 - modded to use UART
LUT.fcfx
(9.97 KiB) Downloaded 201 times
It doesn't work at all in v8 - one for the bug list?
Edit: This seems to be a symptom of a bug I've mentioned to Matrix in v8 regarding the FAT component.. Some macros don't accept arguments of integer type - although they should!:

So
uart.png
(7.29 KiB) Downloaded 1431 times
Gives the following compiler message:
http://www.matrixtsl.com
Errors when generating C source code:
LUT.c : 1 : error : Incompatible argument: UART1::SendNumber
LUT.c : 679 : error : Incompatible argument: UART1::SendNumber

FINISHED
Martin
Last edited by mnf on Thu May 31, 2018 5:06 pm, edited 1 time in total.

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: How to get integer value from LUT FC6??

Post by LeighM »

The LUT component had a fix back in February, please try the attached, into your Flowcode 6 components directory.
Attachments
lut.fcpx
(6.25 KiB) Downloaded 187 times

Post Reply