11-03-2005 12:56 AM
11-03-2005 09:29 AM
11-03-2005 06:42 PM
The following thread will be helpful.
http://forums.ni.com/ni/board/message?board.id=180&message.id=19138
11-03-2005 11:44 PM
Thank you for your replies.
N5530S include three component: an ESA,an EPM ,an software. What I want to do is control the the software to measure the UUT,
Now I follow the article Makoto mentioned,and I can commuicate with Instrument now,but I meet another problem: When I run the program after a few seconds
,there is a error occurred.It describes like this :
NON-FATAL RUN-TIME ERROR: "AgilentAgilentMr.c", line 6840, col 5, thread id 0x00000318: Function CA_GetInterfaceFromObjHandle: (return value == -2147467262 [0x80004002]). Can't support this interface.
What should I do to deal with the poblem?
11-06-2005 08:44 AM
11-07-2005 02:53 AM
Makoto:
I know your mean ,but I don't know how to solve it ,it can't communicate with machines . Below is part code of mine:
hr = AgilentAgilentMr_NewIAgilentMrApplication (NULL, 1, LOCALE_NEUTRAL, 0, &objectHandle);
AgilentAgilentMr_IAgilentMrTunedRFLevelInitialize (objectHandle, NULL); //before measurment .it should be initialsized
AgilentAgilentMr_IAgilentMrFrequencyCounterRead (objectHandle, NULL, &FREQ); //Read from the machine
**********************************************************************************************************************************
HRESULT CVIFUNC AgilentAgilentMr_IAgilentMrTunedRFLevelInitialize (CAObjHandle objectHandle,
ERRORINFO *errorInfo)
{
HRESULT __result = S_OK;
AgilentAgilentMr_IAgilentMrTunedRFLevel_Interface * __vtblIFacePtr = 0;
int __didAddRef;
int __errorInfoPresent = 0;
__caErrChk (CA_GetInterfaceFromObjHandle (objectHandle,
&AgilentAgilentMr_IID_IAgilentMrTunedRFLevel,
0, &__vtblIFacePtr, &__didAddRef)); ------------------------------------------the program will broken here.
__caErrChk (__vtblIFacePtr->lpVtbl->Initialize_ (__vtblIFacePtr));
Error:
if (__vtblIFacePtr && __didAddRef)
__vtblIFacePtr->lpVtbl->Release (__vtblIFacePtr);
CA_FillErrorInfoEx (objectHandle,
&AgilentAgilentMr_IID_IAgilentMrTunedRFLevel, __result,
errorInfo, &__errorInfoPresent);
if (__errorInfoPresent)
__result = DISP_E_EXCEPTION;
return __result;
}
Hope you can help me : )
Thank you !
11-07-2005 07:28 AM
The code line of the problem (invoking CA_GetInterfaceFromObjHandle() function) is apparently attempting to QueryInterface() behind the scene actually querying the IAgilentMrTunedRFLevel interface but, you said it returned 0x80004002 (E_NOINTERFACE). I would like to know what object/interface the "objectHandle" parameter is pointing to.
Your example (querying the IAgilentMrTunedRFLevel interface) is virtually equivalent to the following C++ code:
HRESULT hr = S_OK;
IAgilentMrTunedRFLevel* __vtblIFacePtr = NULL;
hr = objectHandle->QueryInterface( IID_IAgilentMrTunedRFLevel, (void**)&__vtblIFacePtr);
// hr will be 0x80004002
Likely, your "objectHandle" is pointing to the root object of AgilentMr instrument driver isn't it? If pointing the root, you may not be able to QueryInterface the IAgilentMrTunedRFLevel directly. Possibly there may be a gettable read-only property which returns IAgilentMrTunedRFLevel interface pointer (such as TunedRFLevel read-property or get_TunedRFLevel() method). If it does exit on the root interface (IAgilentMr interface), you can query the target interface through the TunedRFLevel property's return, not through the root interface directly.
(Sorry but I could not find the N5530 IVI-COM driver at Agilent download site, so I did not see the driver's online-help.)
11-07-2005 11:38 AM
I maybe behind the times, but I talked to the Agilent guys at the NCSL show in August and they told me that the N5530 is a stand alone system and would not play nicely with other systems. I asked them about integrating it into existing fixtures, replacing the HP 8902A, and existing CVI software, and they said that would be a future product. I wrote it off as Agilent's arrogance and went to the Rohde box, but that's another story.
You may have already tried it, but I would be pulling the ear of your Agilent Field Engineer to help solve your problem. I'm very interested in your outcome, so please keep us updated.
Good Luck!
11-07-2005 06:07 PM
11-07-2005 08:41 PM