Specifications

RIGOL
Programming Guide for DS1000B Series
3-4
Example 3 Storaging and Setting the File
#define BUFFER_SETUP_SIZE 1636
void SetupUpload()
{
BYTE *bufSetup = new BYTE[BUFFER_SETUP_SIZE];
FILE *fp;
/*Judge the buffer validity */
if (bufSetup == NULL)
{
return;
}
/*Make a statement for the VISA status*/
ViStatus sta;
/*Send the command :SYSTEM:SETUP? to save the file to buffer*/
sta=viQueryf(g_vi,":SYSTEM:SETUP?\n","%#b\n",BUFFER_SETUP_SIZE,
bufSetup);
/*Judge whether the command is sent successfully*/
if(sta != VI_SUCCESS)
{
return;
}
/*Save the setup file to PC*/
fp = fopen("C:\\scope\\setup.dat","wb");
if(fwrite(bufSetup,sizeof(BYTE),BUFFER_SETUP_SIZE,fp)!=BUFFER_SETUP
_SIZE)
{
fclose(fp);
return ;
}
fclose(fp);
}