What is the maximum buffer size in NetLinx?
Can't put my finger an an exact max value but I have code reading in large files where I implemented 100k strings
stack_var char iBuffer; // You really DON'T want to use a non-volatile local_var here ;-)
The largest I have working is a local var cTmpBuf. Local so it can concatenate incoming strings through multiple data events. Just like with some large structures I can't view in debug because it will crash NS4.
LOCAL_VAR CHAR cTmpBuf;
if you're going to use a local_var for a big buffer like that allocate it out of volatile...
local_var volatile char cTmpBuf; // Yes, you can do this
Believe me, trying to track down why the processor crashed because it ran out of non volatile memory can be a time consuming exercise.
Hmmm, I don’t think I’ve ever designated a local var as volatile. Maybe I always assumed they were that way naturally whereas globals were only assignable and non volatile by default. I can’t think of anywhere at least in my code where a local needs to be non volatile but I guess since I’ve never designated them volatile they are. .
stack_var is allocated out of volatile.
local_var is allocated out of non-volatile by default.
I can personally testify that if you have a common file reading function that allocates 100k local_var buffers and that file is referenced by a dozen or so modules and that when all those modules call that read function simultaneously the master will immediately reboot...