フィルターのクリア

an asynchronous write is already in progress ???? simulink

2 ビュー (過去 30 日間)
zikouoo momo
zikouoo momo 2012 年 10 月 1 日
i'im using UDP block receiver and UDP send BLOCK in the same .mdl model
IT RUNS FOR 4 minutes and then there is the ERROR :: (an asynchronous write is already in progress )
help

回答 (1 件)

Ryan G
Ryan G 2012 年 10 月 1 日
Are you sending and receiving data from the same IP address and Port?
How are you running the model (just the play button?) It sounds like eventually it is attempting to write and for whatever reason it's taking longer than normal, so instead of waiting for the write to finish it moves to the next time step, attempts to read, and can't because the write is still in progress.
  3 件のコメント
Ryan G
Ryan G 2012 年 10 月 1 日
Well if it's trying to write while it's already writing that may be the issue. One thing you can try is using a MATLAB function block and create an object for the serial port. From there you can check the transfer status of the port. Something like this might work:
s = serial('COM1');
out1 = get(s,'TransferStatus');
And then the output of the MATLAB function block would be a trigger. If the transfer status says it's busy, don't trigger the UDP send, if it is not busy, send the data.
You can also use something like this pacer for simulink that will slow down the model sim time and allow for the UDP send/receive operations to catch up to the time the sim performs them.
zikouoo momo
zikouoo momo 2012 年 10 月 1 日
thank's a lot (Ryaan) i'll try this solution...

サインインしてコメントする。

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by