Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use IVI-COM diver in Lab Windows /CVI

Hello all:
        I need to use Agilent N5530s to do some tests,but it's driver is base on IVI-COM,I kown nothing about it .I have serched in NI website,but  I didn't  find 
its IVI-C driver. Does NI has the driver of N5530S,if no,what should I do with the problem.  
           Look forward to you reply!
           Thank you !
0 Kudos
Message 1 of 15
(5,615 Views)
I am not familiar with the N5530S, but it consists of Agilent PSA and EPM instruments.  There are IVI-C drivers available for these 2 instrument series. 
You can evaluate for yourself if this is a valid solution for you.  Otherwise, your best option is to generate a C wrapper for the IVI-COM driver using the LabWindows/CVI Active X wrapper generator tool.
 
Jason Hobbs
0 Kudos
Message 2 of 15
(5,602 Views)
0 Kudos
Message 3 of 15
(5,595 Views)

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?


 

0 Kudos
Message 4 of 15
(5,590 Views)
The error code 0x80004002 means E_NOINTERFACE.  Your program or CVI-generated wrapper is attempting to acquire wrong COM interface.  This may happen especially when you use pass-through approach to VISA COM IFormattedIO488 interface. 
0 Kudos
Message 5 of 15
(5,569 Views)

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 !

 

0 Kudos
Message 6 of 15
(5,557 Views)

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.)

0 Kudos
Message 7 of 15
(5,550 Views)

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!

0 Kudos
Message 8 of 15
(5,539 Views)
I downloaded and tried the Agilent SA IVI-COM driver (supporting EMC/ESA/PSA spectrum analyzer family?), but it does not seem like an N5530S driver.  What I can find in it are all AgilentSaXXXX interfaces, and there are no "AgilentMr" names.  Is the the driver the one that comes only with the accompany CD-ROM of the hardware?
0 Kudos
Message 9 of 15
(5,527 Views)
Thank you for your advice. Below is N5530S Measuring Receiver Software http://www.home.agilent.com/cgi-bin/pub/agilent/editorial/cp_MiscEditorial.jsp?NAV_ID=-536890808.536894569.02&LANGUAGE_CODE=eng&CONTENT_KEY=511264&ID=511264&COUNTRY_CODE=US I followed the article you have mentioned,and created ActiveX controller,then generated an AgilentMr.fp. But I don't know how to invoke the function in special steps. I will try your advice. Thanks a lot.
0 Kudos
Message 10 of 15
(5,522 Views)