Giga-tronics 2400/2500 Microwave Synthesizer Series
4. Programming Interfaces
Programming Manual, Part Number 34783, Rev A, July 2009
13
4.3.2.3 Programming Example; List Operation Using Visual C++
Step
Description
1.
Perform steps 1 through 5 of Table 6 to create a Visual C++ project.
2.
Write the following code:
#include <windows.h>
#include <stdio.h>
#include "gt2400.h"
#define SUCCESS 0
//This routine can load any list file to 2400/2500 synthesizer
//and set up repeat type and trigger type at user choice.
void main(void)
{
long status;
char listFileName[80];
char statusText[256];
unsigned long instrumentHandle;
short tmp;
status = GT2400_OpenConnection(0, 6, 0, &instrumentHandle);
if(status < SUCCESS )
{
GT2400_GetErrorMessage(status, statusText);
printf("Status Message %s\n",statusText);
}
printf("Please enter the file name to be loaded:\n ");
scanf("%s",&listFileName);
status = GT2400_LoadListFromFile(listFileName, statusText);
if ( status < SUCCESS )
//Error during loading
{
GT2400_GetErrorMessage(status, statusText);
printf("Status Message %s\n",statusText);
}
status = GT2400_DownloadList(instrumentHandle, listFileName);
printf("Enter Repeat Type (0 = single step; 1 = single sweep; 2 = continuous) =");
scanf("%d",&tmp);
status = GT2400_SetRepeatType(instrumentHandle, tmp);
printf("Enter Trigger Type (0 = External trigger; 1 = Software trigger or GET) =");
scanf("%d",&tmp);
status = GT2400_SetTriggerType(instrumentHandle, tmp);
status = GT2400_SetRF(instrumentHandle, 1);
status = GT2400_CloseAllConnections();
}
Continued next page