AnsweredAssumed Answered

C and 82357B- Transfer file from Tek scope

Question asked by john_de on May 15, 2012
Latest reply on May 15, 2012 by john_de
I'm using the 82357B and the Agilent VISA library with C# to control a bunch of instruments.  Everything works fine using the FormattedIO488 methods.  

The one thing I'm unable to do is transfer a file from the scope to the PC using the Tektronix FILESystem:READFile command.  I can write that command to the scope seemingly without errors, but reading the data back gives an error no matter how I attempt it.

The Tek manual describes the command as follows:

FILESystem:PRInt , GPIb

"This command (no query form) prints a named file to a named port.
This command is the same as the FILESystem:READFile command.
This command is not IEEE 488.2 compliant for the following reasons:
  The command produces output on the 488.2 bus. Queries, not
commands, are the only message units that should produce output
on the 488.2 bus. Errors may not be recognized if they occur while
data is being output in response to this command. This will be
evident if a command is sent to the instrument before all of the data
generated by this command has been read. In such cases, you
should send a device clear message to the instrument.
  The command does not use a standard 488.2 output format. The
closest defined format is the indefinite format of ARBITRARY
BLOCK PROGRAM DATA encoding. However, this command
output omits the initial ’#0’ characters needed for that format.
  Newlines, ASCII value 10, can be included in the output data.
Output on the bus can be terminated by newlines. The output of
this command is only terminated by .

I've tried writing the command to the scope using various methods, all seem to work OK:

viError = visa32.viOpenDefaultRM(out resourceManager);
                    viError = visa32.viOpen(resourceManager, "GPIB0::"+currentAddress+"::INSTR",
                        visa32.VI_NO_LOCK, visa32.VI_TMO_IMMEDIATE, out session);

                        string file = @":FILES:READF ""C:\TekScope\waveforms\STARTUP.PNG"",GPIb";
                         viError = visa32.viPrintf(session,file);
Now, any method I use to try to read the data on the bus seems to time out or read nothing.  I'm not sure of the correct way to read the data.  The formatted commands seem wrong because I would think I would want to read byte data, not a string or float etc.  I've tried viRead, viBufread, viscanf all with no success.  I'm obviously overlooking something or doing something wrong, so any help would be appreciaated.  (I tried to post on the TEK forum, but it would not allow me to register for some reason.)

Thanks in advance!