4 Programming example
4.2 Advanced operation example
105
//Enable Service Request ESR
//Set the event enable bit, the operation is completed
status = viEnableEvent(vi3986, VI_EVENT_SERVICE_REQ, VI_QUEUE, VI_NULL);
//Enable SRQ event
status = viWrite(vi3986, (ViBuf) ":INIT ", 18, (ViPUInt32)&retCnt);
status = viWrite(vi3986, (ViBuf)"*OPC", 18, (ViPUInt32)&retCnt);
//Start sweep synchronously with OPC
status = viWaitOnEvent(vi3986, VI_EVENT_SERVICE_REQ, 10000, &etype, &eevent) ;
//Wait for service request
status = viReadSTB(vi3986, (ViPUInt16) &stat);
status = viClose(eevent); //Close event handle
//Disable the SRQ event
status = viDisableEvent(vi3986, VI_EVENT_SERVICE_REQ, VI_QUEUE);
//Continue running the main program……
}
4.2 Advanced operation example
Setting Point Frequency for LAN Interface and Query
Setting VISA Mode for LAN Interface
Setting Point Frequency for GPIB Interface and Query
4.2.1 Setting Point Frequency for LAN Interface and Query (SOCKET)
/*********************************************************************************************************************
To use the following examples correctly, you must match your host address with the IP address of the
signal source. (The network design example in this manual uses WINSOCK components to establish
socket implementation under VS2010).
*********************************************************************************************************************/
#include "stdafx.h"
#include <afxsock.h>
#include <stdio.h>
#include <stdlib.h>
CSocket sockClient;
void ShowMsg(PCHAR lpszText)
{
#ifdef _UNICODE
AfxMessageBox((CString)lpszText);
#else
AfxMessageBox(lpszText);
Содержание 3986 Series
Страница 1: ...3986 Series Noise Figure Analyzer Programming Manual...
Страница 4: ......
Страница 8: ...3986 Series noise figure analyzer Table of Contents 4...
Страница 107: ...3 SCPI 3 3 Instrument specific Commands 99...
Страница 119: ...4 Programming example 4 2 Advanced operation example 111...