Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sending an ASCII string to the serial port in Simulink

280 views
Skip to first unread message

Peter

unread,
Apr 17, 2003, 12:32:48 PM4/17/03
to
I am trying to send an ascii string to the serial port using simulink
(Matlab R13) and am having trouble. Does anyone know how to do this?


Just as some background, I have been trying to use the RS232 Simulink
Blockset that Leonardo posted on this usenet group, but have been
having problems with it. I am using the write_string block from the
blockset and instead of sending the ascii string one time, it sends
the designated ascii string over and over and over. I believe the
problem lies in the fact that the write_string block sends the string
everytime a boolean 1 is inputted to the block. Even though I have
tried using a discrete impulse block from the DSP Blockset, it still
causes the string to be sent multiple times. I have found that if
you vary the sample time of the impulse input block, you can change
the amount of times it sends the string. However, the minimum amount
of times I can get the block to send the string is 4 times.
Decreasing the sample time beyond a certain point will not cause the
write_string block to send any less multiples.


Here is what Matlab Help says about the impulse block:


"The Discrete Impulse block generates an impulse (the value 1) at
output sample D+1, where D is specified by the Delay parameter (D 0).
All output samples preceding and following sample D+1 are zero."


So theoretically, since all samples preceding and following are zero,
it should send the string only once. However, that's not the case.
Does anyone have any ideas? Any help would be greatly appreciated.
Thanks in adv advance!

0 new messages