Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Passthrough functions in IVI COM

Bilal

Thanks - I discounted the (IO488) message as I am using a LAN connection but I will investigate this further. The nature of your response tells me that I am in the right area at least.

Cheers
DWW
0 Kudos
Message 11 of 20
(2,419 Views)
I meet the same problem!, I should use Agilent N5530S to do a auto-testing program,but I only have its IVI COM driver ,I don't kown how to use it in Lab windows/cvi, Could you give some advice .
Thank you a lot.
0 Kudos
Message 12 of 20
(2,381 Views)

Adam

Bilal got it right. I used the following code to set the phase (I presume you have created the CVI drivers from the COM Type library using the Active X Controller Wizard)

static int RFSigGen_SetPhase(CAObjHandle driverObj, double phase)
{
ERRORINFO errorInfo;
CAObjHandle systemObj = 0;
CAObjHandle IOObj = 0;
int error = 0;
char buffer[256] = {0};
 
  
0 Kudos
Message 13 of 20
(2,379 Views)

Adam

Bilal got it right. I used the following code to set the phase (I presume you have created the CVI drivers from the COM Type library using the Active X Controller Wizard)

static int RFSigGen_SetPhase(CAObjHandle driverObj, double phase)
{
ERRORINFO errorInfo;
CAObjHandle systemObj = 0;
CAObjHandle IOObj = 0;
int error = 0;
char buffer[256] = {0};
 
      
0 Kudos
Message 14 of 20
(2,379 Views)

Adam

Bilal got it right. I used the following code to set the phase (I presume you have created the CVI drivers from the COM Type library using the Active X Controller Wizard)

static int RFSigGen_SetPhase(CAObjHandle driverObj, double phase)
{
ERRORINFO errorInfo;
CAObjHandle systemObj = 0;
CAObjHandle IOObj = 0;
int error = 0;
char buffer[256] = {0};
 
   
0 Kudos
Message 15 of 20
(2,379 Views)

Adam

Bilal got it right. I used the following code to set the phase (I presume you have created the CVI drivers from the COM Type library using the Active X Controller Wizard)

static int RFSigGen_SetPhase(CAObjHandle driverObj, double phase)
{
ERRORINFO errorInfo;
CAObjHandle systemObj = 0;
CAObjHandle IOObj = 0;
int error = 0;
char buffer[256] = {0};
 
 
0 Kudos
Message 16 of 20
(2,379 Views)

Adam

Bilal got it right. I used the following code to set the phase (I presume you have created the CVI drivers from the COM Type library using the Active X Controller Wizard)

static int RFSigGen_SetPhase(CAObjHandle driverObj, double phase)
{
ERRORINFO errorInfo;
CAObjHandle systemObj = 0;
CAObjHandle IOObj = 0;
int error = 0;
char buffer[256] = {0};
 
    
0 Kudos
Message 17 of 20
(2,379 Views)

Adam

Bilal got it right. I used the following code to set the phase (I presume you have created the CVI drivers from the COM Type library using the Active X Controller Wizard)

static int RFSigGen_SetPhase(CAObjHandle driverObj, double phase)
{
ERRORINFO errorInfo;
CAObjHandle systemObj = 0;
CAObjHandle IOObj = 0;
int error = 0;
char buffer[256] = {0};
 
       
0 Kudos
Message 17 of 20
(2,379 Views)

Adam

Bilal got it right. I used the following code to set the phase (I presume you have created the CVI drivers from the COM Type library using the Active X Controller Wizard)

static int RFSigGen_SetPhase(CAObjHandle driverObj, double phase)
{
ERRORINFO errorInfo;
CAObjHandle systemObj = 0;
CAObjHandle IOObj = 0;
int error = 0;
char buffer[256] = {0};
 
     
0 Kudos
Message 19 of 20
(2,379 Views)

Adam

Sorry about the last attempt to answer, I keep hitting some button which closes the reply/edit window before I'm ready.

Bilal got it right. I used the following code to set the phase (I presume you have created the CVI drivers from the VISACOM and Instrument Type libraries using the Active X Controller Wizard):

static int RFsigGen_SetPhase (CAObjHandle driverObj, double phase)
{

ERRORINFO errorInfo;
CAObjHandle systemObj = 0;
CAObjHandle IOObj = 0;
int error = 0;
char buffer[256] = {0};

 sprintf(buffer,":PHAS %lfDEG", phase);
 
 AxErrChk(AgilentRfSigGenLib_IAgilentRfSigGenGetSystem (driverObj, &errorInfo, &systemObj));
 AxErrChk(AgilentRfSigGenLib_IAgilentRfSigGenSystemGetIO (systemObj, &errorInfo, &IOObj));
 AxErrChk(VisaComLib_IFormattedIO488WriteString (IOObj, &errorInfo, ":PHAS:REF", VTRUE));
 AxErrChk(VisaComLib_IFormattedIO488WriteString (IOObj, &errorInfo, buffer, VTRUE));

Error: 
 if (systemObj) {CA_DiscardObjHandle(systemObj); systemObj = 0;}
 
 if (IOObj) {CA_DiscardObjHandle(IOObj); IOObj = 0;}
 
 return error;
}

AXErrChk is just an error checking macro and driverObj is the top level driver handle from

 AxErrChk(AgilentRfSigGenLib_NewIAgilentRfSigGen (NULL, 1, LOCALE_NEUTRAL, 0, &driverObj));
 
 AxErrChk(AgilentRfSigGenLib_IAgilentRFSigGenInitialize (driverObj, &errorInfo, resourceName, VFALSE, VFALSE, ""));


The inmportant bit is the VisaComLib_IFormattedIO488WriteString call


You'll note that I've just called the drivers direct but you may prefer to use the class drivers for your instrument

Hope this helps

DWW

0 Kudos
Message 20 of 20
(2,378 Views)