Tel: 886.909 602 109 Email: [email protected]
111
// Set the frequency as 128MHz
iStatus = viWrite(iDevHandle, "FREQ 1.28e8\n", strlen("FREQ 1.28e8\n"), &uiRetCnt);
}
5.3.5 Reading of instrument status
/*************************************************************************/
The following example shows how to read the setting status of the instrument.
/*************************************************************************/
void ReadSettings()
{
ViStatus iStatus;
long uiRetCnt;
char rgcBuf[256];
//Query the frequency
iStatus = viWrite(iDevHandle, "FREQ?\n", strlen("FREQ?\n"), &uiRetCnt);
Sleep(10);
iStatus = viRead(iDevHandle, rgcBuf, sizeof(rgcBuf), &uiRetCnt);
//Print debugging information
printf("frequency %s", rgcBuf);
}
5.3.6 Synchronization of command
/*************************************************************************/
The methods for command synchronization are illustrated hereinafter by taking sweep as an example.
/*************************************************************************/
void SweepSync()
{
ViStatus iStatus;
long retCnt;
ViEventType etype;
ViEvent eevent;