Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how find the "readtofile" command

Hi,

I use the example from your web site : http://zone.ni.com/devzone/cda/epd/p/id/798.

I want use the "ReadToFile" command, but I don't find this command in this example.

 

My goal is to capture the screen to a file.

 

Please, could you help me?

 

Thanks

Gilles

0 Kudos
Message 1 of 5
(3,764 Views)

Where is this command supposed to come from? Excel? What screen are you talking about?

0 Kudos
Message 2 of 5
(3,748 Views)

Hi Dennis,

 

I saw the "readToFile" command in the NI doc ( http://digital.ni.com/public.nsf/allkb/37E8AC1DCD69A0D5862571410083C194 )

"Screen" is the screen of my instrument (spectrum analyser).

For information, it is a old instrument and I want to capture the screen without old moving disk (3'1/2).

 

Regards

Gilles

0 Kudos
Message 3 of 5
(3,745 Views)

The function viReadToFile is documented in the NI-VISA Help. You certainly do not need that in your vba code. You can read from the instrument to a buffer and then write to a file with a vba function. The function is simply a one step process instead of two. If you want to try the function, I would suggest you use VISA commands for everything. I think the example vba code uses nothing but lower level GPIB commands.

 

Your first task, however, is determining if there is a command to print the screen, then if there is a command to print the screen to the GPIB port instead of a floppy.

0 Kudos
Message 4 of 5
(3,741 Views)

I agree : I managed to read from the instrument to a buffer and write to a file (*.wmf) but when i want to open it, it fail.

My first error was to define a too small buffer.

Now I think that my instrument didn't send the whole file (it seems truncated). I asked help to the instrument supplier, I'm waiting its answer.

 

I don't find a command to print the screen to the GPIB port. This "screen capture" command creates a wmf file in the "c:\" internal disk.

 

Thanks for your help.

0 Kudos
Message 5 of 5
(3,735 Views)