Matlab Interactive Brokers Connection Response
조회 수: 3 (최근 30일)
이전 댓글 표시
Here's what I'm trying to achieve
Main Function
# Connect to Interactive Brokers TWS
# Verify that connection has been established
# If connection established, draw gui
end Main Function
Here's a basic code I have for this in Matlab
function main
ib = ibtws('', 7496); %Connect
while ~exist('ibBultInErrMsg', 'var') %Check for response
pause(0.1)
end
drawGUI(); %If you've made it this far, then draw the gui
end
Here's the problem: the variable ibBuiltInErrMsg is only created once the main function is done running. (Matlab automatically creates this variable, and puts it in the same 'workspace' as the variable ib) I am trying to check within the Main Function if the variable ibBuiltInErrMsg does in fact exist. I am doing this as a form of connection verification since the object ib is constructed by Matlab in such a way that it does not provide a 'confirmation' flag for connection.
Essentially from my understanding is that Matlab does not block execution of the main thread to receive 'asynchronous' responses from external software.
Is there a workaround or will I have to use a more powerful language?
Thanks.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!