Constant array

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

Moderator: Benj

Post Reply
User avatar
psf
Posts: 45
Joined: Mon Jun 25, 2007 9:44 pm
Location: Italia
Has thanked: 6 times
Been thanked: 2 times
Contact:

Constant array

Post by psf »

Hi, I discover how to declare an array as constant:

rom char* ARRAYCONST = {0x01,0x02,0x03,0x04,0x05,0x06};

into a "c icon", but how to recall the value into flowcode diagram?

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Constant array

Post by kersing »

You will need a C icon to get the value as well when using C code to declare the constants. C icons do not work in simulation, so you will not be able to use simulation.

You can use lookup table to create an ROM array that will simulate using the component macros. It translates to a ROM array when generating the code for you controller. Set the values you want to initialize the array with in the properties.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
psf
Posts: 45
Joined: Mon Jun 25, 2007 9:44 pm
Location: Italia
Has thanked: 6 times
Been thanked: 2 times
Contact:

Re: Constant array

Post by psf »

kersing wrote:You will need a C icon to get the value as well when using C code to declare the constants. C icons do not work in simulation, so you will not be able to use simulation.

You can use lookup table to create an ROM array that will simulate using the component macros. It translates to a ROM array when generating the code for you controller. Set the values you want to initialize the array with in the properties.
Thanks I'll look for this.

Post Reply