Giga-tronics 2400/2500 Microwave Synthesizer Series
4. Programming Interfaces
Programming Manual, Part Number 34783, Rev A, July 2009
11
4.3.2 Programming Examples Using the DLL
4.3.2.1 CW Operation Using Visual C++
NOTE
: Only bold faced code lines are unique to a specific operation mode. All other lines are supporting
lines shared by both CW and List modes.
Step
Description
1.
Perform steps 1 through 5 in Table 6 on page 10 to add the DLL to a Visual C++ project.
2.
Write the following code:
#include
"GT2400.h"
#include
"stdio.h"
#define
SUCCESS 0
//This routine sets CW frequency and power of a 2400/2500
synthesizer
//at your choice through GPIB at address 6.
void
main(
void
)
{
STATUS status;
unsigned
long
instrumentHandle;
double
Frequency
=
1000
;
double
Power
=
0
;
status
=
GT2400_OpenConnection(
0
,
6
,
0
,&instrumentHandle);
if
(status
<
SUCCESS )
{
char
statusText[
256
];
GT2400_GetErrorMessage(status, statusText);
printf(
"Status Message %s\n"
,statusText);
}
status
=
GT2400_SetRF(instrumentHandle,
1
);
printf(
"Frequency (MHz) ="
);
scanf(
"%lf"
,&Frequency);
printf(
"Power (dBm) ="
);
scanf(
"%lf"
,&Power);
status
=
GT2400_SetCW(instrumentHandle,Frequency,Power,
0
,
0
);
status
=
GT2400_CloseAllConnections();
}
3.
Build the project.
4.
Run the program.
End of Example