Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
udp packet send and receive through real-time windows target

Subject: udp packet send and receive through real-time windows target

From: Pratik Chhatbar

Date: 29 Jan, 2009 19:08:02

Message: 1 of 4

i am trying to make an xpc and a real-time windows target talk.. xpc machine is sending out udp packets (which would be uint8 data of certain length) and is also can accept udp packet through another port (again, the uint8 packets, which would get converted into 'double' values and then subsequently used in the model).

i can easily send and receive the udp packets in the command line window by creating udp object, and also in the simulink using the send and receive blocks - thus can talk to xpc without any troubles.

i know real-time windows target has started supporting udp packets since version 3, but unfortunately i have never been successful to send and receive this packets.. i am using 'packet in' block to receive and 'packet out' block to send.. i installed the udp board as per the help file instructions, and there is no problem verifying the correctness of the setup and building or running the model. it is just that i can't see anything being received or sent!

anyone had success sending/receiving the udp packets through real-time windows target? i'll greatly appreciate any inputs. thanks!

Subject: udp packet send and receive through real-time windows target

From: Alex

Date: 16 Mar, 2009 15:04:16

Message: 2 of 4

"Pratik Chhatbar" <prachha@gmail.com> wrote in message <glsuqi$eim$1@fred.mathworks.com>...
> i am trying to make an xpc and a real-time windows target talk.. xpc machine is sending out udp packets (which would be uint8 data of certain length) and is also can accept udp packet through another port (again, the uint8 packets, which would get converted into 'double' values and then subsequently used in the model).
>
> i can easily send and receive the udp packets in the command line window by creating udp object, and also in the simulink using the send and receive blocks - thus can talk to xpc without any troubles.
>
> i know real-time windows target has started supporting udp packets since version 3, but unfortunately i have never been successful to send and receive this packets.. i am using 'packet in' block to receive and 'packet out' block to send.. i installed the udp board as per the help file instructions, and there is no problem verifying the correctness of the setup and building or running the model. it is just that i can't see anything being received or sent!
>
> anyone had success sending/receiving the udp packets through real-time windows target? i'll greatly appreciate any inputs. thanks!
>
Example
 creating udp object: port 9010 = port 9010
 real-time windows target packet input: port 9010 = port 36880 (hex to dec)

good luck!
sorry for my bad english)))

Subject: udp packet send and receive through real-time windows target

From: Talha

Date: 9 Aug, 2011 10:56:10

Message: 3 of 4

@"Pratik Chhatbar" have u been able to read data through packet Input block?
I have also the similar problem. I have Xplane running on one pc and on the other Realtime wondows target. I want to send and receive data via UDP to the PC, on which Xplane is installed. Earlier without running Simulation in Realtime windows target, I wrote a S-function which then call the winsock functions to create a socket. but as Realtime Target does not support windows API. I am not been able to build my model in Realtime windows Target. Thatswhy I thought I take this packet input block to receive data. I tried it but the same problem what u had. I give by local port:5555
remote id: 198.162.1.3
and by remote port: also 5555.

xplane in remote pc send the data through port 5555. I cant see my error. or should i give the port number in decmal numbers?

 I hope u can give me a tip.
Thanx alot
Talha

Subject: udp packet send and receive through real-time windows target

From: Josh

Date: 4 Apr, 2012 00:04:15

Message: 4 of 4

We have the same problem on our project. It appears that the Packet Input block only works when you have a Packet Output block running in the same model for the same Real-Time Windows "board setup".

If you have any communication troubles on the Output it seems that the Input stops working and does not set the Communication Error flag high.

We have not investigated this thoroughly yet, but we are in desperate need of a work around since we do not want all of out models to be sending and receiving, some are just data loggers.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us