From: Walter Roberson on 18 May 2010 11:14 Jim wrote: > Here's the total output: > > Starting the timer > InstrumentSunscriptionCheckConnection > CQGAPI Started > Data Connection Status Changed to Up > InstrumentSubscriptionCheckConnection > Stopping the timerError writing to output stream. Looking at that output and looking at your source, and looking at what was *not* written, it looks most likely that the problem is in the stop() call, or in CQGAPI_StartUp(); of InstrumentSubscription. You could narrow it down a bit by adding some disp() after the stop() and in InstrumentSubscription.
From: Jim on 18 May 2010 11:40 Walter Roberson <roberson(a)hushmail.com> wrote in message > > Looking at that output and looking at your source, and looking at what > was *not* written, it looks most likely that the problem is in the > stop() call, or in CQGAPI_StartUp(); of InstrumentSubscription. You > could narrow it down a bit by adding some disp() after the stop() and in > InstrumentSubscription. I'll add more 1980-style "Did XYZ" debug prints to the code and see if it is indeed within CQGAPI_StartUp. Here's the code for that (before I litter it with dozens of disp "I got here"-like statemets): ---------------------------------------------------- function CQGAPI_StartUp() global m_CQGAPI try delete(m_CQGAPI); catch end m_CQGAPI = actxserver('CQG.CQGCEL.4'); m_APIConfig = m_CQGAPI.get('APIConfiguration'); % Configure CQGAPI m_APIConfig.set('ReadyStatusCheck', 'rscOff'); m_APIConfig.set('TimeZoneCode', 'tzCentral'); m_APIConfig.set('UsedFromATLClient', true); m_APIConfig.set('CollectionsThrowException', false); m_APIConfig.set('DefaultInstrumentSubscriptionLevel', 'dsQuotesAndBBA'); m_APIConfig.set('SnapShotPeriod', 250); % Register CQGAPI's events % Each CQGAPI Handler must have its own file m_CQGAPI.registerevent({'CELStarted' 'OnCQGAPIStarted'}); m_CQGAPI.registerevent({'DataConnectionStatusChanged' 'OnDataConnectionStatusChanged'}); m_CQGAPI.registerevent({'DataError' 'OnDataError'}); m_CQGAPI.registerevent({'InstrumentSubscribed' 'OnInstrumentSubscribed'}); m_CQGAPI.registerevent({'InstrumentChanged' 'OnInstrumentChanged'}); m_CQGAPI.registerevent({'IncorrectSymbol' 'OnIncorrectSymbol'}); m_CQGAPI.Startup end ---------------------------------------------------- Maybe it's the registerevent calls? I have the code for each of those as well. However, each of those seems to have its own disp logic when/if they get invoked, and the output points to the setup ones running (if I'm reading them above correctly). I don't understand the stop call well enough to determine why it would interact with an output stream. Do threads use pipes for some reason within MATLAB, or some other stream-like construct which could/would cause this? Thanks again! Jim
From: Jim on 18 May 2010 11:57 I added another disp after the stop(T) call and that never displayed, so the exception must be raised from within stop. I read the stop code and stepped through it under a working version within MATLAB twice, but I'm not entirely sure how an output stream could be affected within that code. I guess it could be the call to stop on the reference to TimerTask obj.jobject(lcv)).stop But, that should raise something more along the lines of a NullPointer or ClassCastException, or similar (if that really is Java code). The other alternative is that it is hitting the inval code at the bottom, but those errors are VERY different than the output stream ones too. Those exceptions would have been VERY descriptive from their constructors and definitely would be indicative of getting to that point. Still puzzling. Again, massive thanks! (I probably owe you lunch, particularly if you're in Chicago at some point.) ;-) Jim
From: Walter Roberson on 18 May 2010 12:08 Jim wrote: > I added another disp after the stop(T) call and that never displayed, so > the exception must be raised from within stop. > > I read the stop code and stepped through it under a working version > within MATLAB twice, but I'm not entirely sure how an output stream > could be affected within that code. I've been wondering: when you run within Matlab itself, does that section to stop the timer even get invoked? Is it actually running the same code in both cases, or is it perhaps falsely detecting a current connection in the compiled case but not the interactive case?
From: Jim on 18 May 2010 12:22 Walter Roberson <roberson(a)hushmail.com> wrote in message <CXyIn.7111$304.5066(a)newsfe12.iad>... > Jim wrote: > > I added another disp after the stop(T) call and that never displayed, so > > the exception must be raised from within stop. > > > > I read the stop code and stepped through it under a working version > > within MATLAB twice, but I'm not entirely sure how an output stream > > could be affected within that code. > > I've been wondering: when you run within Matlab itself, does that > section to stop the timer even get invoked? Is it actually running the > same code in both cases, or is it perhaps falsely detecting a current > connection in the compiled case but not the interactive case? It definitely runs within MATLAB. I stepped into it within the debugger as a lazy man's method of actually finding the stop() code in the first place, to be honest. :) I really think this has something to do with either a missing DLL or similar (which is what I've thought all along), since it works within a running version of MATLAB but not as an exe. So, the "output stream" references kept indicating, to me, that some connection like an active-X control or similar is not working. But, with no real indication what's missing, it's a bit like the blind man searching for the needle in the haystack...
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 Prev: How to get a graphics.datatip object Next: find distance along complicated geometric surface |