Jump to content

tomas61

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by tomas61

  1. How do I define bi dimensional arrays?

    var peakCounter = [];

    var peakCounter = [][]; ---syntax error

     

    var peakCounter = [,];---doesn't give me a syntax error but it doesn't work, it only follows the index after the comma

    Thanks

  2. Thanks

    how do I format a number to display only two decimal points in print

    print(totalCounter);

    will print this

    2.2000000000000006

    What is the base language you use for script, (java, python, etc)

    This would be so much easier with a good user manual

     

  3. Hi Attila,

     

    Why the  "

    var data = Scope1.Channel2.data;

    if(!Scope1.wait()) throw "Stopped";

    plot1.Y1.data = data;" is different than the data displayed in the scope

     

    how do I plot a bidimensional array

     

    Thanks

    Script plot.png

  4. Thanks

    One more, can you send an example on how to plot data from the script, keep getting parse error when trying "plot1.Y2.data[] = lData;"

    if(!('Scope1' in this)) throw "Please open a Scope instrument";

    Scope1.single();

    if(!Scope1.wait()) throw "Stopped";

    var average = 0;

    var lData = Scope1.Channel1.data;

    plot1.Y2.data[] = lData;

    lData.forEach(function(sample){average += sample;})

    average /= data.length;

    print("Average: "+average+" V");

     

  5. Yep,

    you were right, the bins weren't getting filled because my threshold was too big

    Where do you get the info for commands like "Tool,question..."

    Is there a main language reference book/document

    Thanks

     

     

  6. Thanks Attila,

    But most importantly, why the variable data is not getting updated

     

    It only works with the first set of data 

    for(outLoops=0;outLoops<10;outLoops++)

    {

    // reading 50 times, 5 seconds plus

    for(loops=0;loops<10;loops++)

    {// acquire data

    Scope1.single();

    Scope1.wait();

    data = Scope1.Channel2.data;

    for(index=0;index<8;index++)

    {

    thresholdLow -= 0.01;

    thresholdHigh = thresholdLow - 0.01;

    data.forEach(function(sample){if((sample < thresholdLow)&&(sample > thresholdHigh))counter[index]++;});// build histogram

    } //index

    } // loops

     

     

     

  7. I am trying to run scripts, but I haven't been able to find a good complete set of instructions/reference manual
    Got the ECMA-262 manual and waveform 2015 ref. man. documents but neither tell me how to make a while loop that will stop when I press a key.

    Also, why the data is not getting updated

    for(outLoops=0;outLoops<10;outLoops++)

    {

     

    // reading 50 times, 5 seconds plus

    for(loops=0;loops<10;loops++)

    {

     

    // acquire data

    Scope1.single();

    Scope1.wait();

     

    data = Scope1.Channel2.data;

    for(index=0;index<8;index++)

    {

    thresholdLow -= 0.01;

    thresholdHigh = thresholdLow - 0.01;

    data.forEach(function(sample){if((sample < thresholdLow)&&(sample > thresholdHigh))counter[index]++;});// build histogram

    } //index

     

     

     

    } // loops

     

     

     

×
×
  • Create New...