Prev: Simulink for a simple model
Next: Serial communication blocks of real-time windows target do notwork in real-time
From: Kate J. on 21 Dec 2009 12:26 Before creating a more complex system, I am trying to establish communication, via UDP Send and Receive blocks, between two very simple Simulink models (one Host model, one Target model which will run on a Target machine using xPC Target). My Host Simulink model just contains a sine wave source block, routed into a UDP Send block (with default Mask Parameters for now). My Target Simulink model contains only a UDP Receive block (with default parameters) and an xPC Target Scope. I am just trying to pass my sine wave from the Host model to the Target model, and view it on the Target PC's monitor scope. When I try to Build the Target model, I get the following error: Error building Real-Time Workshop target for block diagram 'Target_model_UDP_v1'. MATLAB error message: Error using ==> tlc_new Error: Errors occurred - aborting. I have searched for this error message, but so far haven't found any useful info about what might be causing this error. Both models are so simple that I'm not sure what could be changed to eliminate this build error. Any ideas about what might be causing this error? Thanks!
From: Kate J. on 21 Dec 2009 12:40 Another question related to my post above: Is it reasonable to expect the default Mask Parameter values of the UDP Send and Receive blocks to work, or is my using these default values possibly what is causing this Build error? If I *do* need to specify the correct, non-default Mask Parameter values for these UDP Send/Receive blocks, -- I know the IP address of my Host PC, so this is ok -- I was told that the first 3 portions of the Host's IP address should be the same for my Target PC, but I'm unclear about how to find the last 3 digits of the Target PC's IP address, since it doesn't have a Windows OS -- any suggestions? -- How do I know which Remote IP Port to send to/receive from? Will this value be the same for each pair of matched Send/Receive blocks? -- Is it ok to leave the IP Port field at its default -1 value? If not, what value should this have? Thanks for any guidance on these issues.
From: Hans-Joachim Schulpin on 22 Dec 2009 05:47 You should check, whether the right target is selected for this model under Real-Time Workshop configuration. It has to be "xPC Target". On Mon, 21 Dec 2009 17:26:04 +0000 (UTC), "Kate J." <quisquiliae3(a)hotmail.com> wrote: >Before creating a more complex system, I am trying to establish communication, via UDP Send and Receive blocks, between two very simple Simulink models (one Host model, one Target model which will run on a Target machine using xPC Target). > >My Host Simulink model just contains a sine wave source block, routed into a UDP Send block (with default Mask Parameters for now). My Target Simulink model contains only a UDP Receive block (with default parameters) and an xPC Target Scope. I am just trying to pass my sine wave from the Host model to the Target model, and view it on the Target PC's monitor scope. > >When I try to Build the Target model, I get the following error: > > Error building Real-Time Workshop target for block diagram 'Target_model_UDP_v1'. MATLAB error message: > Error using ==> tlc_new > Error: Errors occurred - aborting. > >I have searched for this error message, but so far haven't found any useful info about what might be causing this error. Both models are so simple that I'm not sure what could be changed to eliminate this build error. > >Any ideas about what might be causing this error? Thanks!
From: Kate J. on 22 Dec 2009 15:01 Thanks for the reminder, Hans-Joachim... that is one step I often forget, and I did need to make that change. However, now when I try to build my Target model, I get a different error message: Error building Real-Time Workshop target for block diagram 'Target_model_UDP_v1'. MATLAB error message: Error using ==> callMakeHook at 49 The call to xpctarget_make_rtw_hook, during the exit hook generated the following error: Error using ==> xpcload at 71 Could not find target The build process will terminate as a result. When I try to connect to my Target PC (by right-clicking on the Target name in xPC Explorer, and selecting Connect), I get the error message, error using ==> connectTarget at 7 Connection Failed. Please check your Communication settings. This error message results from my trying to connect to *any* of the Targets listed in xPC Explorer. Do you have any idea about what might be causing these 2 errors? There doesn't appear to be anywhere in my Simulink models' settings where I can specify the name of the desired Target PC... is there any way to specify this in my Host model and/or Target model? Thanks!
From: Gordon Weast on 23 Dec 2009 10:31
Kate, Have you been able to run xpctest on your host/target combination? If that doesn't work, then there is something you haven't set up correctly yet. The 'could not find target' error is thrown for just about any target communication error during the build. You can set the target name on the models configuration parameters dialog on the xPC Target page once you've selected xPC Target as the RTW target type. However, the normal mode is to just let the model download to the 'default' target as selected in xpcexplr. The target name should appear in bold, if not then right click with the mouse over the target name and select 'Set as Default'. That's on the same menu where you can connect explorer to the target. If that doesn't work, then something else, such as Hans has suggested may be wrong. I typically use a second network card in the host with one of the unroutable IP addresses, such as 10.10.10.10. Then I use addresses such as 10.10.10.11 for the target. Windows handles the routing quite nicely. We have seen some problems with Kaspersky if you're using that for your antivirus. It doesn't like the traffic to the target. I haven't dug into that yet, but it appears that it is possible to apply some custom configuration to Kaspersky to get it to work. If you continue to have trouble, you should contact MathWorks tech support. Next week, you'll have some trouble getting anyone here to help since many of us will be on vacation, but I'll be back on Monday the 4th. Gordon Weast xPC Target Development The MathWorks Hans-Joachim Schulpin wrote: > If the targets are online and the IP addresses are ok, maybe something > blocks the communication. You should check, whether the Windows > firewall is enabled. If yes, disable it. > > If there are other firewalls in the network, open port "22222", which > is used for communication with the targets by default. You can change > the "TCP/IP target port" in xPC Explorer to something else, but you > have to rebuild the boot disk of the target before you can use the new > port. > > You can try an "ping" at the Windows command line, too. If this works, > delete the target in xPC Explorer and create it again, Sometimes this > helps. > > > On Tue, 22 Dec 2009 20:01:20 +0000 (UTC), "Kate J." > <quisquiliae3(a)hotmail.com> wrote: > >> Thanks for the reminder, Hans-Joachim... that is one step I often forget, and I did need to make that change. >> >> However, now when I try to build my Target model, I get a different error message: >> >> Error building Real-Time Workshop target for block diagram 'Target_model_UDP_v1'. MATLAB error message: >> Error using ==> callMakeHook at 49 >> The call to xpctarget_make_rtw_hook, during the exit hook generated the following error: >> Error using ==> xpcload at 71 >> Could not find target >> The build process will terminate as a result. >> >> When I try to connect to my Target PC (by right-clicking on the Target name in xPC Explorer, and selecting Connect), I get the error message, >> >> error using ==> connectTarget at 7 >> Connection Failed. Please check your Communication settings. >> >> This error message results from my trying to connect to *any* of the Targets listed in xPC Explorer. >> >> Do you have any idea about what might be causing these 2 errors? There doesn't appear to be anywhere in my Simulink models' settings where I can specify the name of the desired Target PC... is there any way to specify this in my Host model and/or Target model? Thanks! |