Packet Input (Simulink) returning 0s

1 次查看(过去 30 天)
John
John 2014-8-21
评论: Jan Houska 2014-8-25
EDIT: This works in Normal mode, but not External mode!
In External Mode, the Packet Input block in Simulink only returns 0s when connected to my serial port device. The baudrate is set correctly, the device is verified as streaming ASCII by connecting to a terminal and watching the stream.
Block error and Data Ready both stay at 0, and I see the data being streamed from the device when the program is running. This is an FTDI serial port interface.
Thoughts? I'm running Real-Time Windows Target in External Mode.

回答(1 个)

Jan Houska
Jan Houska 2014-8-22
The situation you describe (Data Ready is 0) happens when the incoming data is not accepted by the device, for whatever reason. The fact that the data output stays at the initial value of 0 is only a consequence of that. Please try to enable the Data Error port and check there. If the output of this port goes to 1, something with the incoming data is wrong after all (baud rate, parity, data format, whatever).
  2 个评论
John
John 2014-8-22
编辑:John 2014-8-22
As noted above, everything works in Normal mode, just not External mode. So the formatting must be correct. Also, as mentioned in the post, both block error and data ready outputs are 0s. EDIT: running 115200 RS232 in case that matters.
Jan Houska
Jan Houska 2014-8-25
I have just tested RS232 in both Normal and External modes, both work for me. I have used the rtpacketio example with driver changed to Serial Port and a loopback connector on the port. Do you think you could try something similar to reduce the possibility of some unrelated issue?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Real-Time Simulation and Testing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by