|
"Marc " <marcpiggott@gmail.com> wrote in message
news:hdape2$ofv$1@fred.mathworks.com...
> Just curious to see if there's a difference between starting a model using
> the play button in the model window versus tg.start at the command line?
>
> I'm getting different behaviour for these two methods: tg.start everything
> works perfectly (can run the model arbitrarily long uninterrupted), but
> when I run using the play button my app will appear to freeze every few
> seconds and then resume correct display some seconds later (although no
> messages about tcp/ip errors etc are given)
>
> My model is a simple loopback test of general standards cards, displaying
> the signals on the input on an xpc target scope.
>
When you run the model by pressing the play button in the model window, you
must be using the external mode. If that's the case, then when you press
play, Simulink needs to connect to the target, checks the checksum is
correct (i.e. what's on the target is the same as your model on the host),
and then start the execution of the model on the target, so I would say it's
normal that it takes a bit of time before the model starts. When using
tg.start, you are just starting the execution of the model on the target
using the MATLAB API. That doesn't require doing all the steps that Simulink
performs when running in external mode (in fact, the Simulink model doesn't
even need to be open).
http://www.mathworks.com/access/helpdesk/help/toolbox/xpc/ref/starttargetapplicationobject.html
http://www.mathworks.com/access/helpdesk/help/toolbox/rtw/ug/f1000932dfi4.html
http://www.mathworks.com/access/helpdesk/help/toolbox/xpc/ug/f6-79480.html#bqnlfj_-1
http://www.mathworks.com/access/helpdesk/help/toolbox/xpc/ug/f6-31896.html#f6-76992
HTH,
Arnaud
|