Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I transfer a jpg File via GPIB?

Solved!
Go to solution

Hello everyone,

 

I would like to transfer a screenshot, which I have stored on my scope (a Tektronix TDS5104B scope) into my program. The way I am approaching this right now is neitherelegant nor working.

Can anyone point me into the right direction.

 

Here is what I am trying right now:

1. Copying the file into the GPIB buffer:

 Session.Write("FILES:READF " + Path + FileName + ", GPIb");

 

2.  Write the GPIB buffer as a file:

Session.ReadToFile(Path + FileName);

 

While the file is being created, it is empty and the ReadToFile command returns an TimeOut error.

Moreover, I would be glad, if I could avoid writing the picture as a file and then re-import it. (Eventually, I require a memory stream which contains the file).

 

Thanks for you support in advance,

Ben

0 Kudos
Message 1 of 3
(4,672 Views)

Hi all,

 

I am getting there. I have been missing the quotation signs in the first command. Now that I have added them, it works - to some extend.

 

After 16 kB the transfer is interrupted and the "rest" of the file is grey...

 

Does anyone know how I can increase the buffersize or why the transmision is stopped?

 

Thanks,

Ben

0 Kudos
Message 2 of 3
(4,664 Views)
Solution
Accepted by topic author schwabe111

Ok, I have solved it now entirely: I've used the ReadBytes Command  and used 512000 as length.  The other positive thing now is, that I have already a byte array which I can put into a Memorystream directly. So, I don't need to save the picture somewhere locally.

0 Kudos
Message 3 of 3
(4,662 Views)