Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Read to File

Hi, I'm using "Serial communication.vi". It works weel to write to and read from the device. Since I want to read to a file, I modified "read" part in "serial communication.vi" and use "VISA Read To File" to read. When I run it, I got a file with something not readable (seems like machine code). In the help of "VISA Read to File", it said "the file specified in filename is opened in binary mode". I wonder if "in binary mode" is related to the problem? How can I read it to a text file or a file I can read? Thank for help.
0 Kudos
Message 1 of 2
(3,287 Views)
Hi,

The fact that VISA opens the fiel in binary mode doesn't affect the data saved. This only means that the VISA VI will write to the file exactly what is read from the bus. If the instrument returns ASCII data, you can open the file directly in notepad and read the instrument's response.

Try using a simple query like *IDN?. the instrument will return an ASCII string with this command.

DiegoF.
National Instruments.
0 Kudos
Message 2 of 2
(3,287 Views)