Referencing a ROM table in a C block

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
Brendan
Posts: 243
Joined: Tue Nov 27, 2012 12:53 pm
Location: Cambridge, UK
Has thanked: 140 times
Been thanked: 118 times
Contact:

Referencing a ROM table in a C block

Post by Brendan »

First, a happy and prosperous new year to you all :)

Hopefully a quick question...

Having declared a 16 x 16-bit ROM look-up table using the usual LUT component, I'm trying to establish the appropriate way to reference values in a C block? e.g... FCV_THISUINT = FCV_THISTABLE[indexval] is clearly incorrect.

Many thanks,
Brendan

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

Re: Referencing a ROM table in a C block

Post by mnf »

Hi Brendan,

The easiest way to check this is to define some code that does it and then look at the C generated..

For example in a calculation I do :

Code: Select all

.x = lut1::GetInt(2)
This 'expands to' (using customize C code or view C)

Code: Select all

FCL_X = FCD_00fb1_lut1__INTLIST(2);
Martin

Brendan
Posts: 243
Joined: Tue Nov 27, 2012 12:53 pm
Location: Cambridge, UK
Has thanked: 140 times
Been thanked: 118 times
Contact:

Re: Referencing a ROM table in a C block

Post by Brendan »

Hi Martin.

Many thanks for your time to reply - Greatly appreciated :D

Best regards,
Brendan

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

Re: Referencing a ROM table in a C block

Post by mnf »

No problem...

Martin

Post Reply