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

Simulink serial send receive and configure block

780 views
Skip to first unread message

Suleman Shafqat

unread,
Jun 13, 2011, 4:35:04 AM6/13/11
to
How to do hardware in loop simulation. i am trying to use serial send receive and configure blocks but i do not get the desired ans.
Description: from hardware COM22 i am sending serial data '123456789' through a microcontroller, in command window i can get the same result when i scanf the serial object but why not in simulink (i got all zeros in simulink)

zhang

unread,
Aug 11, 2011, 10:15:33 PM8/11/11
to
"Suleman Shafqat" <msulema...@gmail.com> wrote in message <it4i3o$eji$1...@newscl01ah.mathworks.com>...

> How to do hardware in loop simulation. i am trying to use serial send receive and configure blocks but i do not get the desired ans.
> Description: from hardware COM22 i am sending serial data '123456789' through a microcontroller, in command window i can get the same result when i scanf the serial object but why not in simulink (i got all zeros in simulink)

Hi Suleman Shafqat,
I try to do hardware in loop simulation like you.and I am confused with the same problem that I used the serial receive block but got all zeros.Have you solved this problem yet? How to configure this block to make it work?
many thanks!

Suleman Shafqat

unread,
Aug 12, 2011, 1:17:13 AM8/12/11
to
Hi,
Instead of serial send and serial receive blocks use "query instrument" and "to instrument" blocks.

i didnt used them yet but i know they will work.
when u use them u will have to change some settings, please tell me also about that.

Regards,
Suleman

zhang

unread,
Aug 12, 2011, 10:22:30 PM8/12/11
to
"Suleman Shafqat" <msulema...@gmail.com> wrote in message <j22d0p$j04$1...@newscl01ah.mathworks.com>...

thanks for your reply?

but the block "query instrument" seems only can work in "nomal simulation mode",when I change to the "external mode“ for rtwin target in Real-Time Workshop, the build procedure for my model aborted due to the error that "no rule to make target “QueryInstrument.obj".

but I find a block named“Packet Input" in "Real-time windows target" is easily to configure and now I can use this block in the real-time environment to recieve serial data.

Regards,

Yao Zhang

0 new messages