MATLAB: Does MATLAB crash when starting a Bloomberg connection in a timer function

Datafeed Toolbox

I am running a timer function that feeds data from Bloomberg, it works fine for a couple of minutes before crashing. How can I fix this?

Best Answer

First, make sure you are not creating multiple Bloomberg connections. 
Try one the following:
1. Use a single Bloomberg connection and pass a reference of it to the timer function.
2. Use the 'realtime' function with a custom 'eventhandler' field to obtain real time data for the connection: <https://www.mathworks.com/help/datafeed/blp.realtime.html>