Size of Buffer on Data_Event Issue
Andre Silva
Posts: 19
Hello,
I'm working with a Beyerdynamic equipment, the mcs - d200 and I'm having problems with the size of the string that come back from central unit of the beyerdynamic equipment. Each microphone that its activated is shown in a speak list that is returned as a large string. If I have 5 microphones activated, the lenght of the string is something about 69 characters. If I try to turn on the 6th microphone my string on the notifications tab is broken in 2 lines and all my treatment of the string messes up. It does something wrong, lose itself.
It's possible to expand the receive bufer to receive everything in 1 line? I still have 10 more microphones to treat (something about 110 more characters).
Thanks
I'm working with a Beyerdynamic equipment, the mcs - d200 and I'm having problems with the size of the string that come back from central unit of the beyerdynamic equipment. Each microphone that its activated is shown in a speak list that is returned as a large string. If I have 5 microphones activated, the lenght of the string is something about 69 characters. If I try to turn on the 6th microphone my string on the notifications tab is broken in 2 lines and all my treatment of the string messes up. It does something wrong, lose itself.
It's possible to expand the receive bufer to receive everything in 1 line? I still have 10 more microphones to treat (something about 110 more characters).
Thanks
0
Comments
I believe the most data that you will get with one string event for an RS-232 device is 64 characters.
The data coming in needs to be buffered. When you see that you have one complete response in the buffer, you extract that response, deal with it, and then wait for the next complete response.
As you starting point you can take a look at TN 616 which discusses buffer parsing and there are many posts on this forum that discuss it as well.
HTH
Using the 'create_buffer' method seems to work a little better for slower, chuggier rs232 in some cases. and since you can change the buffer size to whatever you want, you can get rid of truncated string message issues.
In either case, you should almost always plan on queueing this kind of stuff and programming in some string handling routines to ensure you're getting good communications.