From: Kate J. on 18 Jan 2010 13:05 Hi! I am trying to get a simple 2-Simulink-model using xPC Target system set up, which uses a pair of UDP Send and Receive blocks. I am simply trying to pass a sine wave that I generate in my Host model, to the Target model using UDP Send and Receive blocks, and display it on the Target model’s scope. I believe that I have set up my TCP/IP communication correctly, as I have run a demo (udpxpctargetstream.m) and it appears to run ok. However, in my own simple model, I can Pack my sine wave signal and try to pass it to the UDP Send block, and both my Host & Target models run without error, but the expected sine wave that should appear on the Target PC’s monitor (using an xPC Target scope in the Target model), is only a flat signal that never changes (and which appears even before I start my Host model, so I don’t think this is really even a data signal). Does anyone have experience with why, even though both of my models run without error, I still don’t appear to be either passing, or successfully receiving, this signal using UDP Send/Receive blocks?
From: Kate J. on 18 Jan 2010 13:14 A couple of notes that I omitted from the OP, to avoid making it too long: a) I *don’t* have an Unpack block in my Target model, to unpack the data from the UDP Receive block; when I try to insert this block (using the default values) and build the Target model, I get the error message, Error building Real-Time Workshop target for block diagram 'Target_model_UDP_v4'. MATLAB error message: Error using ==> rtwgen --> Error reported by S-function 'xpcbyte2any' in 'Target_model_UDP_v4/Unpack': input signal size does not match output structure size. --> Error in port widths or dimensions. Output port 1 of 'Target_model_UDP_v4/Receive' is a one dimensional vector with 1 elements. The default values of the Unpack block are as follows: Output port dimensions (cell array): {[1]} Output port data types (cell array): {'double'} Byte alignment: 1 _______________ Given that I am passing a single signal (sine wave), I’m not sure which of the above values would need to be changed. b) I reduced the Sample Time of my UDP Send block from 0.01 to 0.005, but this didn’t change the behavior of my system…
From: Kate J. on 26 Jan 2010 12:54 any ideas? Thanks in advance.
From: Kate J. on 27 Jan 2010 12:55 bump
From: Mirko on 1 Feb 2010 12:14 "Kate J." wrote > Hi! I am trying to get a simple 2-Simulink-model using xPC Target system set up, > which uses a pair of UDP Send and Receive blocks. > I am simply trying to pass a sine wave that I generate in my Host model, to > the Target model using UDP Send and Receive blocks, and display it on the > Target model’s scope. I believe that I have set up my TCP/IP communication > correctly, as I have run a demo (udpxpctargetstream.m) and it appears to run ok. Hi, Kate, I'm working on similar things (and I'm facing strange results too). The interesting thing to note is that even if I've been able to get UDP communication with xPC Target, I get strange results hard to understand (for me). For example I'm not getting consistent results even from the udpxpctargetstream demo. Starting from it, how did you set it up, and which hw did you used to test that? I remember in the past some simple kind of UDP communication realized by means of udpsendreceiveA.mdl and udpsendreceiveB.mdl I think that having the same issue we could keep ourselves in contact to investigate more efficiently toward a working solution. Thank you. Mirko.
|
Pages: 1 Prev: Change the variable used for each loop? Next: Doblu-click on a cell in uitable? |