Home/Support/Support Forum/How to dynamically re-allocate serial buffer sizes?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

How to dynamically re-allocate serial buffer sizes?

0 votes
I am using an RCM4100 or RCM4200 processor. For port D, for example, I know I must define the DINBUFSIZE AND DOUTBUFSIZE parameters, to say, 63 bytes. That works fine if I am using defines to alter the way the program compiles, but how do I dynamically change those values based on a DIP switch setting of my communications protocol? For example, what if I want 255 bytes for Modbus or 511 bytes for DF1 as set by a DIP switch input? Can I use malloc to change these and if so how?
asked Jul 19, 2017 in Rabbit Software by DBurghard New to the Community (2 points)

Please log in or register to answer this question.

1 Answer

0 votes
No, that's a compile-time option only. You'll have to use 511 bytes in all cases.
answered Jul 19, 2017 by TomCollins Veteran of the Digi Community (1,368 points)
I was afraid that was the answer.  I'm going to have to investigate why we were using 511 bytes for some protocols and less for others.  I did not originally write this program.  We might be able to get away with much less, but that is another issue.  Thanks for the response.
I would be surprised if the larger buffer caused problems for the protocol that was using a smaller buffer.
...