Community news, upcoming events and general discussions
Threads: 36 Posts: 88
Get technical support from the community
Threads: 1427 Posts: 7608
Threads: 18 Posts: 64
Tell us how to make XDK better!
Threads: 36 Posts: 119
Share and discuss community member projects
Threads: 81 Posts: 350
I'm trying to understand the udp-example and read the data in Matlab. In the xdk-code I entered the IP of my computer and the port 55056. If I create a udp object in Matlab with these properties and try "fopen" and "fscanf", I don't get any values.
Is this a problem with Matlab or am I doing something wrong with the xdk?
Kind regards, Johannes
I know, that I need to be in the same Wi-Fi network and I'm sure, I am.
If I create a UDP object with u=udp('RemoteHost', RemotePort), which is my PC's IP and the port 55056, I can connect the object to the host with fopen(u).
According to mathworks homepage, " A = fscanf(obj) reads data from the instrument connected to obj, and returns it to A. The data is converted to text using the %c format."
A = fscanf(obj)
I can check, if data is available with u.BytesAvailable, but this is always 0. I dont't know, why that happens.
Is there an othe way to recieve, display and store the upd-Data from the xdk on my PC?
the fscanf function can not just read data from a text file but also from an instrument (see this link).
I also tried different settings for my udp object (e. g. like in this example, but with the port 55056).
How do I setup the XDK as a client or why can't I setup the XDK as a server?
Kind regards Johannes
s = serial('COM1');