AnsweredAssumed Answered

File Screen Transfer MSO7104A

Question asked by gautierd on Feb 5, 2019
Latest reply on Feb 8, 2019 by gautierd



I have a MSO7104A device that I control with LAN. I would like to transfer print screen from oscilloscope to my local computer by LAN connection.


I use the VISA api to read/write data by C/C++ (tekVisa). Until now, I have not been able to find relevent commands to perform the transfer. There is an interesting note "How To Save and Transfer a Screenshot from the 5 or 6 Series MSO" dedicated to the MSO 5 and 6. But I have the 7 I guess. Is there an equivalent note for my oscilloscope. Indeed, the SCPI commands are different and I was not able to use the same commands and to find the corresponding one in the MSO7104A documentation.


Is it possible to perform such a transfer and how ? Is there an existing piece of code ? I look for the way to read screen - by LAN.


I tried the example in the documentation.
With no success, i tried :


/* IMAGE_TRANSFER - In this example we will query for the image
* data with ":DISPLAY:DATA?" to read the data and save the data
* to the file "image.dat" which you can then send to a printer.
viSetAttribute(vi, VI_ATTR_TMO_VALUE, 30000);
printf("Transferring image to c:\\scope\\data\\screen.bmp\n");
img_size = IMG_SIZE;
viQueryf(vi, ":DISPLAY:DATA? BMP8bit, SCREEN, COLOR\n", "%#b\n",
&img_size, image_data);
printf("Read display data query (%d bytes).\n", img_size);
/* 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);
printf("Wrote image data (%d bytes) to file.\n", img_size);
viSetAttribute(vi, VI_ATTR_TMO_VALUE, 5000);
With that, I have a file with data but when i try to open it, data format seems to be not correct and viewer displays an error. Is there a trick ? Then oscilloscope displays a remote action (the print screen) and freezes. It is strange.


Best regards.