Send ASCii via RS232 with Stream Output, Why is "Data Error" = 1?

2 views (last 30 days)
Hi,
I have a problem using the "Stream Output" Block correctly. (Win7 64bit, R2012a 64bit)
I am trying to send three numbers via RS232 to a device. The RS232 is actually a simulated serial port which is connected via USB. I can send data to it using other Programs like arduino or processing. The numbers are 4, 2 and 2 digits long and shall be separated with a comma. They are put in as three arrays containing the single digits. (e.g. 1200 -> [1;2;0;0])
The Stream Output Block has the following configuration:
Board: Standard Device/Serial Port, COM5, 19200, 8, N, 1 (Same options like target device)
Sample Time: 0.02
Max missed ticks: 10000 -> doesn't matter for testing
Input port sizes: [4 2 2]
Format String: '%u%u%u%u,%u%u,%u%u,' %I also tryed %d, %c, ect...
[x] Show "Data Ready" port
[x] Show "Data Error" port
My goal is to send a 11-byte ASCii array (8 numbers and 3 comma). Does it work this way or does the %u for example in the "Format String" convert my digit into a 2-byte or 4-byte number before translating into ASCii?
Now if I start the Model, The "Data Error" Port shows 0 for the first timestep and 1 for all following timesteps until the end. The "Data Ready" Port shows 1 all the way through.
Why is there a data error? And is it the reason why no signal arrives at my target device?
Thanks in advance for any advice.
Sincerely, Thomas

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!