Products > Test Equipment
Open source EEZ Studio for accessing your (SCPI) instruments
<< < (27/32) > >>
kawal:
trying to make a graph
So far a was able to create an array of frequency steps and an array of data points for the corresponding  frequencies.
Trying to make a graph from the data but the scope examples are confusing.
Is the scope data organized  as [x1,y1,X2 y2.......Xn,Yn]?
If I need interleaved data I can easily do that inside the js.

here is the js code so far

connection.acquire();

    connection.command("FORMat real 64");
   
    var StartF = await connection.query("SENSe1:FREQuency:STARt?");
    var StopF = await connection.query("SENSe1:FREQuency:STOP?");
    var PointsF = await connection.query("SENSe1:SWEep:POINts?");
    var StepF = ((StopF-StartF)/(PointsF-1));
//    notify.info(`steps ${StepF/1000000}MHz`);
    var freq = [];
    var level = await connection.query("TRAC? CH1FDATA");
    var level_array = level.split(',');
    for (var i =0; i < PointsF; ++i){
        freq.push(StartF + i * StepF);
        //notify.info(freq);
    }
//   notify.info(freq[0]/1000000);
//   notify.info(freq[PointsF-1]/1000000);
//   notify.info(level_array[1]);
   

mvladic:
If you mean the example of "Waveform data" for the Keysight oscilloscope, then know that in that example the data is not sent as [x1, y1, x2, y2, ...] but as [y1, y2, ...], and the x values are defined with sampleRate, i.e. x values are implicitly calculated, so they are not sent.
kawal:
thanks for your reply . Yes .... that should be easily adapted to my needs as the VNA 8714ET also sends only Y values. I calculated all the X  values and the x step.  But its still complicated for me to understand how to get the data to display.  I  found that the instrument also generates prn files that are easily imported to excel so thats  my fall back. I would love to get the instrument working as the scope example.

here is an example prn file.

The array here provides the y values:

  var level = await connection.query("TRAC? CH1FDATA");
  var level_array = level.split(',');

here I calculate the step size between the samples on the x axis
    var StartF = await connection.query("SENSe1:FREQuency:STARt?"); // read start frequency (5MHz)
    var StopF = await connection.query("SENSe1:FREQuency:STOP?"); // read stop frequency (55MHZ)
    var PointsF = await connection.query("SENSe1:SWEep:POINts?");  //read number of points (401)
    var StepF = ((StopF-StartF)/(PointsF-1));                                          // calculate the step size 0.125MHz 

My graph is not rolling data but should be from 5Mhz to 55Mhz with a 0.125Mhz in between every sample

The issue is what next ? 

There is the preamble stuff that is confusing me.



Maciej

mvladic:
Here is the example how to add a chart where data is in CSV format. The source code is in the attached zip file.

Some screenshot:

kawal:
mvladic
I appreciate it . Thank you.
kawal
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod