Page 1 of 1
Flowcode Arrays
Posted: Fri Nov 16, 2007 1:40 pm
by Gnu
Can you please tell me the maximum number of elements I can use in an integer array. Are 2-dimensional arrays permitted ?
Posted: Fri Nov 16, 2007 1:58 pm
by Benj
Hello Gnu
Two dimensional arrays are not permitted in Flowcode but you can implement them via the C code flowchart icons.
The maximum size of an array is 64 bytes. This represents an entire page in memory. This means that for an integer array the maximum you can have is 32 elements.
Posted: Fri Nov 16, 2007 2:24 pm
by Gnu
Thanks Benj.
Posted: Fri Nov 16, 2007 2:47 pm
by Steve
It may be more that 64 bytes. This is from the BoostC manual:
Arrays can have any number of dimensions. The only constraint is that an array must fit into a single RAM bank.
So in reality it depends on the chip and what other variables you are using (18F devices have up to 256 bytes available in each RAM bank, so the theoretical maximum is 256 array elements).[/code]
Flowcode Arrays
Posted: Mon Nov 19, 2007 1:57 pm
by Gnu
Thanks for this supplementary information, Steve. I am using a 16F88 at the moment, but this isn't set in stone. Ideally I need to store 75 integers in the array; however, I can probably get round the problem by using more than one array.
Gnu.
Posted: Mon Nov 19, 2007 3:55 pm
by Steve
Hi Gnu,
Even with the 16F88, you should be able to have an array of up to 96 elements.
Flowcode Arrays
Posted: Mon Nov 19, 2007 4:01 pm
by Gnu
Thanks Steve. I'll try it out.
Gnu
Flowcode Arrays
Posted: Mon Nov 19, 2007 4:39 pm
by Gnu
Sorry to keep plaguing you! However, I have just tried a few simulations, and the Flowcode V3 progam crashes if the array declaration is greater than [35].
Gnu
Posted: Mon Nov 19, 2007 4:52 pm
by Benj
Hello Gnu
If you are creating an integer array then each integer location will take up two bytes. This means that an int array declared as 35 will actually have 70 byte locations. You should be able to create your program using two arrays. Then you can do a decision eg depending on a index variable to choose which array your looking at.