Packet Input (Simulink) returning 0s

2 views (last 30 days)
John
John on 21 Aug 2014
Commented: Jan Houska on 25 Aug 2014
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.

Answers (1)

Jan Houska
Jan Houska on 22 Aug 2014
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 Comments
John
John on 22 Aug 2014
Edited: John on 22 Aug 2014
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 on 25 Aug 2014
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?

Sign in to comment.

Categories

Find more on Real-Time Simulation and Testing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!