Transferring data between two computers by mouse clicking a pushbutton using MATLAB GUI
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Maurice Rohracker
el 23 de Mzo. de 2017
Respondida: Anoop Somashekar
el 31 de Mzo. de 2017
Hi I want to transfer data consitantly by mouse clicking a pushbutton in MATLAB GUI. Therefor I created a server (Server.m) and a client function (Verbraucher.m). The client function should open when the data is available and the server function has to open and close all secenonds, because in the same code is again a live-plot in a MATLAB GUI. But for some reasons the code doesn't work. Although I transfered data between two computers using the Server and Verbraucher file manually. For better understanding a added the functions and files.
2 comentarios
Geoff Hayes
el 24 de Mzo. de 2017
Maurice - can you clarify what you mean but the code doesn't work. Which portion of the code is failing? Transferring the data from one machine to another? Updating the live plot?
If you are observing any errors, please copy and paste the full error message to this question.
Respuesta aceptada
Anoop Somashekar
el 31 de Mzo. de 2017
I ran the attached code and was able to send /receive the data between client and server. I was also able to recreate the error 'SIZE must be greater than 0' by passing an empty vector to the function Verbraucher i.e. Verbraucher([]). Since an empty vector is also a double, the BytesAvailable property at the server side will be greater than zero. You could add an extra check before performing an 'fread' as shown below:
if elements > 0
data = fread(reader,elements,'double');
end
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!