From: Kate J. on
I have established a connection between my xPC Host and Target PCs. My Target model builds and downloads onto the Target PC successfully. A brief description of my system setup: On my Host, I run a gui that, when its Start button is clicked, starts my Host Simulink model running. (The Host Simulink model is the model that runs on the Host PC.) What runs on the Target PC is what I call my Target model, which receives 6 single-valued data values from the Host PC at every timestep (20 ms) via UDP Receive blocks (these values are sent from the Host model via UDP Send blocks).

The problem: I can successfully start my Target system/model running, and it runs fine until I click Start on my Host’s gui, which starts the Host Simulink model running, and begins passing data to the Target model… around 2 seconds after I click my gui’s Start button, the Target disconnects (i.e., looking at the xPC Target Explorer window, it shows that the Target is no longer connected).

Whether I pass, from the Host model to the Target model, constant values that never change, or whether I pass new values every 20 ms, this disconnecting behavior is the same. (Other behavior does differ between the 2 conditions, but I won’t go into that much detail in this post.)

I’m not sure how to diagnose exactly what is causing this problem, nor how to fix it. Any suggestions? Thanks!
From: Kate J. on
Update: Another interesting phenomenon that I just noticed: While the Target is disconnected (according to the "Connected: No" status in xPC Target Explorer), I can give Matlab the command "-tg" or "tg.stop" numerous times in a row, and each time, the first line always says,

Connected = Yes
(... Status = stopped)

I recall seeing similar behavior in the past, but it has never been a concern until now.

So, how could my Target be disconnected, and yet each time I execute "tg.stop", it still displays that it is connected? Could the "Connected = Yes" above be referring to some other system component than the Target PC?
From: Kate J. on
any suggestions?
From: Kate J. on
Update: I determined that, despite the fact that the xPC Target Explorer gui says that the Target PC is disconnected, I can still start and stop the Target via the Host, and the Target is still able to pass data back to my Host model, so it appears that the Target is actually still connected.

This is reinforced by the "Connected = Yes" status that displays on the Matlab screen when I stop the Target using tg.stop or -tg.

So, this inaccurate Connection status appears to be a bug in the xPC Target Explorer gui (which I plan to just ignore), and not a fundamental problem for my system.
 | 
Pages: 1
Prev: Neural Network inputs
Next: repmat without tiling?