AnsweredAssumed Answered

Help, can't get digital waves from MSO6054B

Question asked by KevinM on Aug 4, 2009
Latest reply on Aug 5, 2009 by KevinM
I'm unable to get data from a MSO6054 to a LabWindows CVI program.

Objective:
Use the MSO as a logic analyzer for a 13-bit data bus.
1) data appears on scope screen as 13-bits, and as a bus
2) can read and write scope to set it up with GPIB
3) can not transfer data from the scope buffer to program space on the host computer.

Please help.
I've read the manuals several times. I've been stuck for two days.

int MSO_logic_first(void)
{
int status=0,i=0;
char text_message[64];
char giant_message[1600];

ViStatus Vstatus;
ViSession defaultRM,Scope6;
ViUInt32 retCount;

  //Prepare to control GPIB
  Vstatus = viOpenDefaultRM(&defaultRM);
  if(Vstatus<VI_SUCCESS){printf("\nGPIB Error: address 0");}
  Vstatus= viOpen(defaultRM, "GPIB0::6::INSTR", VI_NULL, VI_NULL, &Scope6); 
  if(Vstatus<VI_SUCCESS){printf("\nGPIB Error: address 6");}

  //reset
  sprintf(text_message,"*RST\n");
  Vstatus = viWrite(Scope6,text_message,strlen(text_message),&retCount);
  Delay(0.1);
 
  //bit threshold
  sprintf(text_message,":DIG THR 800mV\n");
  Vstatus = viWrite(Scope6,text_message,strlen(text_message),&retCount);
  Delay(0.1);
 
  //digital on BUS1
  for(i=0;i<14;i++)
  {
    sprintf(text_message,":BUS1:BIT%d ON\n",i);
    Vstatus = viWrite(Scope6,text_message,strlen(text_message),&retCount);
     Delay(0.02);
  }
  sprintf(text_message,":DISP:VECT ON\n");
  Vstatus = viWrite(Scope6,text_message,strlen(text_message),&retCount);
 
  //autoscale
  sprintf(text_message,":AUT\n");
  Vstatus = viWrite(Scope6,text_message,strlen(text_message),&retCount);
  Delay(0.1);

   //can see bits on screen

  //record digital data
  sprintf(text_message,":ACQ:TYPE NORM\n");  Vstatus = viWrite(Scope6,text_message,strlen(text_message),&retCount);
  sprintf(text_message,":ACQUIRE:COMPLETE 100\n");  Vstatus = viWrite(Scope6,text_message,strlen(text_message),&retCount);
  sprintf(text_message,":WAV:SOUR BUS1\n");  Vstatus = viWrite(Scope6,text_message,strlen(text_message),&retCount);
  sprintf(text_message,":WAV:FORM ASC\n");  Vstatus = viWrite(Scope6,text_message,strlen(text_message),&retCount);
  sprintf(text_message,":WAV:POINTS 160\n"); Vstatus = viWrite(Scope6,text_message,strlen(text_message),&retCount);
  sprintf(text_message,":DIG BUS1\n");            Vstatus = viWrite(Scope6,text_message,strlen(text_message),&retCount);
  Delay(10.0);

   //can see bus on screen
 
  //get digital data
  sprintf(text_message,":WAV:DATA?\n");      Vstatus = viWrite(Scope6,text_message,strlen(text_message),&retCount);
  sprintf(giant_message,"");                 Vstatus= viRead(Scope6,giant_message,strlen(giant_message),&retCount); //strlen(giant_message)
  if(retCount) giant_message[retCount-1]='\0'; 

  //debug print
  printf("\nData from MSO (string length = %u):\n%s",retCount,giant_message);

//empty zero-length string returned. No data for me.

  //resume
  sprintf(text_message,"*CLS\n");            Vstatus = viWrite(Scope6,text_message,strlen(text_message),&retCount);
  Delay(0.1);
  sprintf(text_message,"RUN\n");             Vstatus = viWrite(Scope6,text_message,strlen(text_message),&retCount);
  Delay(0.1);
 
  //drop gpib handles
  Vstatus = viClose(Scope6);                   
  Vstatus = viClose(defaultRM);
  return 0;

}  

Outcomes