4 Programming example
4.2 Advanced operation example
118
flag=sockClient.Send(―FREQ 1GHz\n‖
,
12
,
0)
;
//Set frequency to 1 GHz
if(!flag)
{
MessageBox("Sending failed"
,
"ERROR"
,
MB_OK)
;
exit(0)
;
}
cout<<‖Display Point Frequency Value‖<<end1
flag=sockClient.Send(―FREQ?\n‖
,
6
,
0)
;
//Check current frequency
if(!flag)
{
MessageBox("Sending failed"
,
"ERROR"
,
MB_OK)
;
exit(0)
;
}
flag= sockClient.Receive(buff
,
100
,
0)
;
//Insert query value into array
if(!flag)
{
MessageBox("Receive Failed!"
,
"ERROR"
,
MB_OK)
;
Exit(0)
;
}
sockClient.Close()
;
}
4.2.2 Setting and checking the frequency of GPIB interface
/*************************************************************************/
This example uses the functions of the VISA library to set the point frequency of the signal source
outputting 500 MHZ signals and the power of -2 dBm, and query the current frequency and power.
Start VC6.0, add the required files, and enter the following code into your .cpp file
/************************************************************************/
#include ―stdAfx.h‖
#include <visa.h>
#include <iostream>
#include <stdlib.h>
#include <conio.h>
void main()
{
ViSession defaultRM
,
vi
;
//Declare VISession type variables
ViStatus vistatus = 0
;
//For device communication
Char buff[256]
;
//Declare variables that store character data
int num
;
//Declare variables that store integer data
vistatus = viOpenDefaultRM(&defalutRM); //Open GPIB task, address 19
Содержание 1465 Series
Страница 1: ...1465 series Signal Generator Programming Manual...
Страница 2: ......
Страница 5: ......
Страница 39: ......
Страница 127: ......