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

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

Answers (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 Comments

thank's (RyanG ) im not sending and receiving data from the same IP adress .
for the solver configuration i put :: descret time (my model should run on descret time ) and for the step time i put (auto)
there is a solution for that in solver or should i change somthing else like step time ..??
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.
thank's a lot (Ryaan) i'll try this solution...

Sign in to comment.

Products

Tags

Asked:

on 1 Oct 2012

Community Treasure Hunt

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

Start Hunting!