NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
schwabe111
Posts: 15
0 Kudos
Accepted Solution

How do I transfer a jpg File via GPIB?

[ Edited ]

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

Member
schwabe111
Posts: 15
0 Kudos

Re: How do I transfer a jpg File via GPIB?

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

Member
schwabe111
Posts: 15
0 Kudos

Re: How do I transfer a jpg File via GPIB?

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.

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page