05-24-2005 01:10 AM
11-03-2005 12:34 AM
11-03-2005 01:11 AM
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)
11-03-2005 01:11 AM
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)
11-03-2005 01:11 AM
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)
11-03-2005 01:11 AM
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)
11-03-2005 01:11 AM
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)
11-03-2005 01:11 AM
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)
11-03-2005 01:11 AM
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)
11-03-2005 01:37 AM
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