AnsweredAssumed Answered

DSO9404A cant download waveform data

Question asked by elemaro on Jan 30, 2013
Latest reply on Feb 1, 2013 by elemaro
Hi,
at first, exuse me for a bad english :-) and i am begginer in programming oscilloscope, VISA and programing general. The problem is following: i need make many measurements on this oscilloscope. I am saving measured data to 2D array. After first measurements is all ok, i can download data from oscilloscope and save it, but at second measurement is downloaded array empty. It is giving errors: invalid parameter or invalid format at 

err=viScanf(vi,"%#hb\n",&num_values, data_byte); 

instruction and QUERY INTERRUPTED in Infiinium Application. I am using instructions from Agilent DSO9000 programmers manual (sample programs) in C. Here is simplified code, for 2 measurements:

signed short data_byte [2][25000];     // array to save measured data
int num_values;                                // quantity of measured data

// initialization of oscilloscope: reset, set trigger, scales, timebase... //

main() {
for(j=0;j<2;j++)
{
  viPrintf (vi, ":SINGLE\n");

  // my code (without VISA instructions) //

*/*=================================*
*Download waveform data.*
*==================================*/*

*/* Set the waveform source. */*
*viPrintf(vi,":WAVeform:SOURce CHANnel1\n");*

*/* Choose the format of the data returned: */*
*viPrintf(vi,":WAVeform:FORMat word\n");*

*viPrintf(vi,":WAVeform:DATA?\n");*

*/* Read waveform data. */*
*err=viScanf(vi,"%#hb\n",&num_values, data_byte[ j ]);*

*if(err != VI_SUCCESS) printf("ERROR: ");*
*char err_msg[1024]={0};*
*viStatusDesc(vi,err,err_msg);*
*printf("VISAError:%s\n",err_msg);*
*}                                                            // end of loop*
*}                                                            // end of main*

I am working  in Visual Studio. When i use instead of bold instructions :DISK:SAVE:WAVEFORM CHANNEL1,\"D:\\... it is working good for many measurements. I tried more formats like BYTE, ASCii, but the same behavior,no success. Can someone give some advice please? i know, that my code is probably catastrophic and no optimal. When i am write to bad topic, please remove or delete this topic, thank you. If you want more information about code, i will write it.
Mark

Edited by: elemaro on Jan 30, 2013 1:52 PM  

Outcomes