Packet Input (Simulink) returning 0s

2 Ansichten (letzte 30 Tage)
John
John am 21 Aug. 2014
Kommentiert: Jan Houska am 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.

Antworten (1)

Jan Houska
Jan Houska am 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 Kommentare
John
John am 22 Aug. 2014
Bearbeitet: John am 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 am 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?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Real-Time Simulation and Testing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by