필터 지우기
필터 지우기

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