Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you use the SCREEN_DUMP command for the waverunner scopes?

Hi Alan,

I have solved the screen dump problem in LT344L model. Note that LT344L does not have the HDD modules.

Therefore, i rewrite the program and save the BMP in the PC.

BTW,  the "lcltxxxx" seems it still has the problems for communication in LT344L as i said that in last time.

Thanks for your help !!

Best Regards,

Steve

0 Kudos
Message 11 of 18
(2,565 Views)
Hi Steve,
 
I think I am missing something... Initializing the driver is always the first step, and you describe that you are getting an error.  But you indicate that you have had success communicating... Can you give me a call for further discussion?
 
Best Regards,
Alan
--------------------

Alan Blankman, Software Engineer
Teledyne LeCroy
800-425-2000
http://www.teledynelecroy.com
alan.blankman@teledyne.com
0 Kudos
Message 12 of 18
(2,539 Views)

I am having probelms using VISA to save a Lecroy scope image to a PC.

 

The following code works fine with an Agilent scope (using the commented out Agilent line, instead of the Lecroy commands below).

 

Can anyone suggest where I am going wrong?

 

Here is my code:

 

//
// Get Scope Image Thread
//
// This function downloads a image from the scope and save's it to file
//
UINT ScopeLecroyClass::GetScopeImageThread( LPVOID pParam )
{
    ScopeLecroyClass *p_scope = (ScopeLecroyClass *) pParam;
    
    FILE *fp;
    unsigned char image_data[IMG_SIZE];   // Array for image data.
    int img_size;
    
    viSetAttribute(p_scope->session, VI_ATTR_TMO_VALUE, 30000); //Increase Timeout
    
    img_size = IMG_SIZE;
    // viQueryf(p_scope->session, ":DISPLAY:DATA? BMP8bit, SCREEN, COLOR\n", "%#b\n", &img_size, image_data); //Agilent Scope command


    viPrintf(p_scope->session,"HSCU,DEV,BMPCOMP,PORT,NET\n"); //Lecroy Hardcopy Setup command (Note: PORT,NET sets DEST,REMOTE).
    viQueryf(p_scope->session, "SCDP\n", "%#b\n",&img_size, image_data); //Lecroy Screen Dump
    
    // Write image data to file.
    fp = fopen ("c:\\scope\\data\\screen.bmp", "wb");
    img_size = fwrite(image_data, sizeof(unsigned char), img_size, fp);
    fclose (fp);
    
    return(0);
}

0 Kudos
Message 13 of 18
(2,107 Views)

Hello jovertoom,

 

Let's try the command as:  HCSU instead of HSCU and see if that works.

 

Capture.JPG

 

Regards,

Leonard Brown
Applications Engineer
Teledyne LeCroy
1-800-553-2769

0 Kudos
Message 14 of 18
(2,103 Views)

Thanks for spotting that typo! However I am still having problems saving the image to file. I wonder if the problem is related to the format of the the data sent. Does the Lecroy scope send data in IEEE 488.2 over Ethernet? Does it use Definite Length Arbitrary Block” or “Indefinite Length Arbitrary Block", or does it just send raw binary data?

 

https://docs.google.com/document/preview?hgd=1&id=11AsY2WixTCI0_1at-wT3YP9JeLwjFl7uFuNGxlHI6ec&pli=1

 

Thanks in advance.

 

0 Kudos
Message 15 of 18
(2,053 Views)

Hello jovertoom,

 

Sorry, I should have put the link in my previous post.

 

This is all in the remote control manual for the scope:  Remote Control Manual

 

The command is covered on page 220.

 

The response is IEEE 488.2.  If you have not turned off  the header response, you will need to remove this from the response before you write the file.

 

Send:  CHDR OFF first.

 

Then you can write the entire response to an image file and use it.

 

The response to the SCDP command will be the binary data for the image file.  You need to write this data to a file with the correct extension.  i.e. .bmp, .jpg...

 

Regards,

Leonard Brown
Applications Engineer
Teledyne LeCroy
1-800-553-2769

 

 

0 Kudos
Message 16 of 18
(2,016 Views)

Thanks Leonard.

 

The following code now works:

 

//
// Get Scope Image Thread
//
// This function downloads a image from the Lecroy scope and save's it to file
//
UINT ScopeLecroyClass::GetScopeImageThread( LPVOID pParam )
{
    ScopeLecroyClass *p_scope = (ScopeLecroyClass *) pParam;
    
    FILE *fp;
    unsigned char image_data[IMG_SIZE];   // Array for image data.
    int img_size;
    
    viSetAttribute(p_scope->session, VI_ATTR_TMO_VALUE, 30000); //Increase Timeout
    
    img_size = IMG_SIZE;

 

    viPrintf(p_scope->session,"CHDR OFF\n"); //Turn off Header
    viPrintf(p_scope->session,"HCSU DEV,BMPCOMP,DEST,REMOTE,AREA,DSOWINDOW\n"); //Hardcopy Setup command
    viQueryf(p_scope->session,"SCDP\n", "%#t\n",&img_size, image_data); //Screen Dump
    
    // Write image data to file.
    fp = fopen ("c:\\scope\\data\\screen.bmp", "wb");
    img_size = fwrite(image_data, sizeof(unsigned char), img_size, fp);
    fclose (fp);
    
    return(0);
}

0 Kudos
Message 17 of 18
(1,948 Views)

Hello Jovertoom,

 

I am glad you got it working!

 

Regards,

Leonard Brown
Applications Engineer
Teledyne LeCroy
1-800-553-2769

0 Kudos
Message 18 of 18
(1,941 Views)