How to continue GPIB reading with fscanf after EOI?

15 views (last 30 days)
The Matlab fscanf command stops reading the GPIB bus before the specified number of readings is obtained. My command is: stringdata=fscanf(vmeter,'%c',2*readings); It often gives the error sign: Warning: Unsuccessful read: The EOI line was asserted before SIZE values were available.
Matlab behaves as "fscanf" is specified, but I wonder, is it somehow possible to skip the EOI?
I am trying read digitized voltage samples with the Keysight 3458A multimeter as fast as possible. It is very old (>30 years) and very pre-SCPI, but unfortunately still the only proper precision multimeter available in the market. It does not have any Matlab driver. The fastest reading data formats are so-called single integer (16 bits, two bytes) and double integer (32 bits, 4 bytes). The way to obtain voltage readings are reading characters (2 or 4 * number of voltage readings for single and double integer, respectively). Then data has to be converted by the Matlab program.
Unfortunately, occasionally the 3458A data stream includes characters (depending on the digitized voltage values) that Matlab interpretes as EOI and stops the reading. With the Python, this problem can be solved by editing the Python VISA which is open-source (making our own version of the read_raw command). I would prefer Matlab for many reasons, but if I cannot solve this problem, I have to change to Python.

Answers (2)

Adam Wyatt
Adam Wyatt on 31 Mar 2015
Try using fgetl to read the whole line, and then you can perform some error checking or different parsing rules.
Also, surely the data you are reading are numbers and not characters and so you should use fscanf(vmeter, '%d', 2*readings). If you want a string, then convert those numbers using num2str.
It therefore appears to me that you are telling Matlab to interpret the numbers as ASCII codes, such that 10-->\n, 13-->\r etc.

Vinod
Vinod on 1 Apr 2015
Edited: Vinod on 1 Apr 2015
Have you tried changing the configuration of the EOIMode property .

Categories

Find more on Instrument Connection and Communication in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!