07-03-2008 07:25 PM
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
07-07-2008 12:17 PM
05-21-2015 05:47 PM
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);
}
05-21-2015 05:57 PM
Hello jovertoom,
Let's try the command as: HCSU instead of HSCU and see if that works.
Regards,
Leonard Brown
Applications Engineer
Teledyne LeCroy
1-800-553-2769
05-24-2015 05:06 PM
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.
05-26-2015 03:58 PM
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
06-02-2015 03:53 PM
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);
}
06-02-2015 04:15 PM
Hello Jovertoom,
I am glad you got it working!
Regards,
Leonard Brown
Applications Engineer
Teledyne LeCroy
1-800-553-2769