Why cannot the Serial Baud rate value in Packet Input/Output blocks be set to anything greater than 256000 in Real-Time Windows Target 3.2 (R2008b) library?

4 views (last 30 days)
I am using the Packet Input/Output blocks from the Real-Time Windows Target 3.2 (R2008b) library. I need to communicate with serial port from these blocks at a baud rate of 921600, however it appears that the blocks only allow a maximum rate of 256000. Can I use higher baud rates for these blocks? If yes, how?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 25 May 2010
This enhancement has been incorporated in Release 2010a (R2010a). For previous product releases, read below for any possible workarounds:
This limitation of setting the baud rate for the Packet Input/Output blocks exists only if you are using the GUI.
As a workaround, it is possible to change the baud rate to any desired value from the command line using SET_PARAM command. To do so, please use the following code:
% Click on the Packet input or output block in your model
get_param(gcb, 'DrvOptions') % returns current options as [19200 8 0 0 0 0 0]
% baud rate is the first option in the answer from above command
% Change the baud rate and leave the rest intact
set_param(gcb, 'DrvOptions', '[921600 8 0 0 0 0 0]')

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!