I am trying to write Marker values (frequency and amplitude) as they show on the screen into a file. I have managed to do it for a single sweep but not a sequence of values corresponding to continuous sweeps (eg. a file with one line per sweep). Also, in case that is possible, any ideas on the maximum number of values that fit into the memory or a method of streaming the values to an external drive?
Unfortunately CXA does not support this feature at present. CXA can log the measurement traces (up to 300) as spectrogram and store in a data file (one of the feature of option EDP), but it does not have marker information.
Thanks for the help. Yes, the Marker Logging feature looks like what I need. The spectrogram also contains the information I need, but 300 traces are too few for my application.
I have a sinusoidal signal that drifts in amplitude and frequency. The CXA can track the signal ("Signal Track" in Span menu) and the marker on the screen continuously indicates the amplitude and frequency of the peak. All I'm trying to do is to write the values that appear on the screen into a file. Typically I would like 1 value every 10 ms, for about 300 s, but I can settle for less if necessary.
Do you think I can program the CXA to do that? More generally, any idea on how to extract the frequency and amplitude values of the signal as a function of time?
PS: The signal is around 20 MHz, it comes from a beatnote of two lasers and has a very low Signal/Noise ratio limited by photon shot noise (quantum limit) to about 40 dB in a 1 kHz Bandwidth. To track it I operate the CXA at 1 kHz BW with a span of 10 kHz, the signal moves up and down within that span at about 1 kHz/s or so.
To get the Frequency/Amplitude data of a Marker/Trace can be done by using the instrument SCPI command. You can refer to the instrument Programmer’s Reference Manual for details of the format of the command. There is also a command to retrieve the system time of the instrument, however, it’s only in Sec, not ms. To get the more precise time of each event, user may need to use the specific function in their program to query the system time of the PC. The entire process would be:
1. Set the instrument to single sweep mode (INIT:CONT 0).
2. Initiate a new sweep (:INIT:IMM). And use *OPC? command to determine if the sweep is completed.
3. Query the marker/trace value by using the corresponding commands.
4. Use specific function (depends on the programming environment) to get the system time.
5. Log the marker/trace value along with the system time.
6. Turn to step 2.
Thanks for the help, we have written the program and it works well. I include the core part (in C) below for anyone who might need something similar. Depending on the required BW/span/precision the speed is varying, for our application the fastest we can do is about 1 point/7 ms (without tracking the signal).
/*Get start time*/
starts = tmb.time;
startm = tmb.millitm;
/*Loop of scans*/
for(i=1; i <= Nscan; i=i+1)
/* Initiate a sweep and wait for it to complete*/
/* Do a peak search */
/* Save frequency and amplitude of Mark1 into variables */
viQueryf(viMXA, "CALC:MARK1:Y?\n", "%lf", &dMaxA);
viQueryf(viMXA, "CALC:MARK1:X?\n", "%lf", &dMaxf);
/* Write the freq and amplitude at Marker 1*/
fprintf(out, "%lf\t %lf\n", dMaxf, dMaxA);
//printf("%lf\t %lf\n", dMaxf, dMaxA);
/* Center the display, only required if you need to track the signal*/
viPrintf(viMXA, "FREQ:CENT %lf Hz\n", dMaxf);
/*Get stop time, calculate time it took*/
stops = tmb.time;
stopm = tmb.millitm;
tdiff = (stops-starts)*1000 + (stopm - startm);
printf("timediff = %ld (milliseconds)\n", tdiff);
/*close output file*/