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