help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GPIB test on HP8510C electrical-optical calibration


From: Stefan Mahr
Subject: Re: GPIB test on HP8510C electrical-optical calibration
Date: Sun, 14 Jul 2013 11:28:33 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130623 Thunderbird/17.0.7

> Now,  regarding the gpib_read.
> Probably for something that only gives a few bytes the read in uint8 is
> probably ok.... for huge amount of data in ASCII format
> say a sweep from 45MHz to 67GHz with like 1M points, the current format made
> Xoctave or Octave crash not sure of which one.

[...]

> The equivalent to gpib_read in matlab gives you like complex comma separated
> pairs, and each pair is separated by spaces and LF characters.
> 
> 0.12345678E00,0.87654321E00
> 1.234567EE00,0.123456798E00
> 
> so you can imagine that with 1Mpoints out of the VNA it gets very messy....
> Everything in ASCII codes is sort of inconvenient to process...and this is
> the problematic code
> 
> gpib_write(HP8510C,"OUTPDATA;WAIT;");
> string_data=gpib_read(HP8510C,Buffer_size);
> string_data=char(string_data);
> num_data=strread(string_data,'%f','delimiter',',');
> S11_real=num_data(1:2:end);      %Extract real component
> S11_imag=num_data(2:2:end);      %Extract imaginary component
> fansS11M=S11_real+i*S11_imag;
> 
> gpib_close(HP8510C); 
> 
> The moment I tried the  string_data=char(string_data); everything went to
> hell....
> 
> I also know the matlab equivalent....
> 
> m=strread(d,'%f','delimiter',',');
> mR12=m(1:2:end);      %Extract real component
> mI12=m(2:2:end);      %Extract imaginary component
> 
> works without problems....
> 

I'm confused. Does it crash with gpib_read, by converting to char array,
or when calling strread?

Does it happen with large data only or also when reading less points? If
it crashes only with large data, please try to figure out the limit.


> gpib_write(HP8510C,"OUTPDATA;WAIT;");
> string_data=gpib_read(HP8510C,Buffer_size);

Please report the results of 'whos' and 'char(string_data(1:30))'

Stefan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]