Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Can VISA be used to download binary data over GPIB?

I am trying to download binary data from an instrument (Stanford Research Systems SR830 DSP Lock-in Amplifier). Under 5.1 I was told that this was not possible because the GPIB software used a binary '10' as an EOI. Has this been changed in 6.1, and if so, can it be used with VISA, or just standard GPIB commands. Also, if the answer to the above question is 'yes', the instrument also returns IEEE format binary floating point numbers that can be read directly into floating point arrays; does LabView 6.1 have anything to handle this?
If Binary data transfer is not available under LabView 6.1, are there plans to incorporate it in future versions?

Thanks,
Marty
0 Kudos
Message 1 of 7
(4,643 Views)
Marty:

I think someone gave you incomplete information. It is true that for text (ASCII) transfers, a 488.2 instrument must complete its response with a \n (10 decimal) and set EOI on that byte.

However, GPIB instruments have always been able to send back binary data that may include a byte with this same value. The instrument should just not set EOI on that byte.

Make sure that in software you do not set TermCharEnabled for these transfers. By default it is off, but some users normally set TermCharEnabled to true for ASCII transfers for older GPIB instruments that might not set EOI. But I don't think that's your problem.

You can safely do both ASCII and binary transfers in any version of LabVIEW with either NI-488 or NI-VISA.

I am not an ex
pert with data formatting in LabVIEW. If you are using C, you could call viScanf with %z, %Z, %bz, or %bZ. This function is not available to LabVIEW programmers but I am sure some LabVIEW experts may know how to do this.

Dan Mondrik
Senior Software Engineer, NI-VISA
National Instruments
0 Kudos
Message 2 of 7
(4,643 Views)

I am controlling the Network Analyzer E5072A. I want to get the binary data from the VISA output, not the default string format. In this case, I guess the speed will be faster since we get the machine language directly so that the CPU does not need to convert Binary to String.
I followed the instruction from the *E5072A help*: in *Reading Data in Binary Format* , it indicates to add the command ":FORM:DATA REAL", I added it, but what I got was not binary values, but a string of "#6000128à ¢?L¥?àFRháù“?à ?7FXw?àelí=?‰ à y??ó“ @N???¨ ?à r· U àP§% Nà ?? ?áˉ@e ?ê?° à 86? H?@EyTü uà ¢é????àU (K à Cs ù@b±?Sbμ—", then Hex display, I only got the Hex Format of those string characters, not the binary value I wanted.
Thank you for your help!

0 Kudos
Message 3 of 7
(4,052 Views)
The hex values are binary and are what you need to convert to floating point per the directions in the manual.

What programming language are you using? There are drivers for other ENA series instruments and you could look at the code for one of those.
Message 4 of 7
(4,044 Views)

Thank you, Dennis~ I use the SCPI language. My teacher solved my problem yesterday. Just as you said, the hex value is exactly the binary data I want. After the VISA Read, my teacher added "Instrument Control Parsing.vi", and the very important step is to choose the "big-endian, network order" of the "Unflatten from string" in the "Instrument Control Parsing.vi". Then I got what I wanted.

Thank you very much!

0 Kudos
Message 5 of 7
(4,027 Views)
SCPI is not a programming language. LabVIEW, C, etc. are and that is the information I was asking.
0 Kudos
Message 6 of 7
(4,018 Views)

Ok, Labview:-)

0 Kudos
Message 7 of 7
(4,001 Views)