Borrar filtros
Borrar filtros

When debugging, global websocket feed data doesn't show up

2 visualizaciones (últimos 30 días)
Martin
Martin el 22 de Abr. de 2020
Comentada: Mehmed Saad el 22 de Abr. de 2020
I use a websocket package named MatlabWebSocket-master to get live data from a website. In a function I am storing that data in a global variable (since I need this live-data everywhere). I am declearing the global variable in all funtions in the system.
In the global variable "feed" I store the client as stucture feed.Client which says: URL: www.....com, Secure: 1, Status, 1, ClientObj: 1x1 MatlabWebSocketSSLClient.
This works fine.
The data I recieve i store like this: evalin('base',['feed.data=',num2str(data{end}),';']);
This usually also works fine.
However sometimes when the whole system is running, the feed.data do not exist, but if I terminate the system, it will show up instant! If it dosnt show up when the system is running I also tried to dubug it, but it still doesnt exist in the variable space (feed.data) in this case. For some reason Matlab can not handle this when the system is running, but as soon as it is terminated its there.
Do I misunderstand global variable, websocket feed or do anyone have an idea?
- Best
  1 comentario
Mehmed Saad
Mehmed Saad el 22 de Abr. de 2020
The data I recieve i store like this:
evalin('base',['feed.data=',num2str(data{end}),';']);
as you are using global variable it is better to use
global feed
feed.data = num2str(data{end});

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by