EasyManua.ls Logo

Quantum Data 881 - Page 567

Quantum Data 881
1144 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
882 Video Test Instrument User Guide (Rev. A.35) 189
timinglog.cpp
This example demonstrates the ability to output data to a file. It uses the new functions
related to file output: fopen(); fclose(); fprint().
#include <stdio.h>
#include <QDScriptContext.h>
extern int fopen();
extern int fclose();
extern int fprintf();
// set up delay between timing measurements as 5000 milliseconds
UINT32 delay = 5000;
bool Script_timinglog( QDScriptContext& sc )
{
INT32 num = 1;
// open a text file to write to
FILE* outfile = fopen("/card0/timing_log.txt","w");
fprintf( outfile, "Start of timing analyzer log\n\n" );
fprintf( outfile, "Delay between timing measurements: %d milliseconds\n", delay );
sc.Exec("DATE?");
fprintf( outfile, "Measurement start date and time: %s, ", sc.GetResponse());
sc.Exec("TIME?");
fprintf( outfile, "%s\n\n", sc.GetResponse());
fprintf( outfile,
"Number\tSCAN\tPRAT\t\t\tHRAT\tVRAT\t\tHTOT\tHRES\tHSPD\tHSPW\tHSPP\tVTOT\tV
RES\tVSPD\tVSPW\tVSPP\tHVPD\n" );
fprintf( outfile,
"====\t====\t====\t====\t====\t====\t====\t====\t====\t====\t====\t====\t====\n" );
// infinite loop until you press Stop on top right
while (true)

Table of Contents

Related product manuals