Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Memory Conservation


JBecker Apr 28, 2009 01:01 PM

Dear all,

I got a question regarding the maximum number of variables that can be used in a CR Basic program running on a CR1000 OS15.

Our programs are quite big. In the CR1000 Manual section 12.5 "Memory Conservation" is written, that approx. 720 Variables would fill all available memory. My question is: what kind of variables is this number related to?

We are using a Dim variable
WriteString As String*1400
that is used during email sending and to handle a protocol- file.

There are of course a lot of other variables for measurement. What would happen, if all memory is filled?

We are strictly following your rules and have declared most of the variables as part of an array and aliased the single entries.
We also reduce the public variables to the minimum number needed.
There are indeed no problems yet, but we would like to know if there is any "indicator" that shows us, e.g. how much CPU Time and RAM is needed by our programs?

thank you in advance,

Johannes B.


Dana Apr 28, 2009 04:34 PM

Our programs are quite big. In the CR1000 Manual section 12.5 "Memory Conservation" is written, that approx. 720 Variables would fill all available memory. My question is: what kind of variables is this number related to?

I believe this assumes a default Public variable, which would be formatted as a float.

Each variable, whether scalar or array, uses approx 250 bytes of memory. In addition, up to five buffers are kept for various data retrieval functions:

* Two data retrieval buffers
* One record retrieval buffer (getdatarecord, tablename.fieldname syntax)
* A display buffer (i.e., for displaying public variables)
* A buffer for TableFile instruction (if it is used)

So... there are a lot of factors that can affect the maximum number of variables that can be used in a program.

The bottom line is that this particular memory is allocated at compile time. If you are going to overflow this kind of memory, it will happen when the program is first sent and compiled in the datalogger.

I hope this is helpful.

Regards,

Dana W.


JBecker Jun 3, 2009 08:05 AM

Thank you dana for the fast response!

Log in or register to post/reply in the forum.