Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Transfering data from instrument to PC

Solved!
Go to solution

Hi Im a student from taiwan.Recently i had a school projact  to control  vna.

I use lan to connect r&s znb.I check a lot of scpi command for loading and saving data,but i didn't find any about lan option for saving data ,just some command like 

:MMEMory:STORe:TRACe  'C:\Users\Public\Documents\RohdeSchwarz\Vna\Traces\Chn1.s2p'Then I manulay control my vna but in saving dialong surface i can' find about lan option.

Can some one tell me about store data and load data with lan scpi command?

Orz i truly appericate.

0 Kudos
Message 1 of 9
(5,892 Views)
Solution
Accepted by topic author liom88792

That ":MMEM:STORe" command is usually for saving data locally on the VNA.  You want to look at the "MMEM:TRANsfer"  commands and examples.  It doesn't matter if its a LAN, USB or GPIB physical connection, the SCPI commands work the same regardless.

 

If you are using LabVIEW, check to see if R&S has a driver, I'd bet there's an example in there you could use.

 

Craig

Message 2 of 9
(5,832 Views)

Tank you very much.This is very helpful for my project.

And last time you help me solve the problem   #keithley 2611b-l source meter 

the project i have done really appreciate.

I puy my project  photo 

Download All
0 Kudos
Message 3 of 9
(5,815 Views)

Glad I could help. GOod luck with the rest of the project.

Craig

0 Kudos
Message 4 of 9
(5,786 Views)

HI  Craig i got some problem,i send command from the example you told me

 :MMEM:TRANS? 'ttest.s1p'  but i got this response  (i upload the photo )

i think vna can't read some kind of :MMEM:TRANS or i miss someing i gues 

please give me some advise thank you very much ! Orz

0 Kudos
Message 5 of 9
(5,734 Views)

Check your code, it looks like you forgot the ':' at the start.  I say this because the error message states :outp:mmem:... which isn't a valid command and thus the header unsupported error.

 

R&S manual is online here..

https://www.rohde-schwarz.com/webhelp/ZNB_ZNBT_HTML_UserManual_en/ZNB_ZNBT_HTML_UserManual_en.htm

 

From the manual this looks to be the preferred method..

 

https://www.rohde-schwarz.com/webhelp/ZNB_ZNBT_HTML_UserManual_en/Content/668d9dcebd3c454e.htm

 

/ Reset the analyzer
*RST
:SYSTEM:DISPLAY:UPDATE ON
:SENSe1:CORRection:COLLect:METHod:DEFine 'Test', TOSM, 1, 2, 3, 4
:SENSe1:CORRection:COLLect:SAVE:SELected:DEFault 
// Initiate a complete sweep
:INITiate1:CONTinuous OFF; :INITiate:IMMediate;*WAI
:MMEMory:STORe:TRACe:PORTs  1, 'ParserTouchstonePorts.s1p', COMPlex, 2
:MMEMory:STORe:TRACe:PORTs  1, 'ParserTouchstonePorts.s2p', COMPlex, 3, 2
:MMEMory:STORe:TRACe:PORTs  1, 'ParserTouchstonePorts.s4p', COMPlex, 1, 4, 3, 2

 

0 Kudos
Message 6 of 9
(5,705 Views)
0 Kudos
Message 7 of 9
(5,693 Views)

Hi Craig, thak you for replying me . But i still have problem, i put on the photo about mmem scpi command,there is not :mmem:tran?  or sort  of thing.And i found that  about block data , it say Header:Header # 45168XXXXXXXX.

i read the explain but i don't know how to ask my znb header. 

Download All
0 Kudos
Message 8 of 9
(5,681 Views)
Solution
Accepted by topic author liom88792

sorry I'm very annoying Craig. I figure it out 

I send the command "Form:DATA REAL" for change the way instrument transfering data to binary

and then  I make a measurement  and read the data "CALC:DATA:TRAC? 'Trc2',SDATA"

after that i got python erro waring can't decode by "utf-8".

then i do some serching,and i use the read_binary_valus function and i got the right data.

 

 

For people not using pythonvisa or you use read_raw function,  when you read data you wii got some like this

b"#18\x84\xb3'4\xf0\x84c8" you need to parse it  the "1"behind the "#"indicates how many of

the following digits describe the length of the data,in this one is one ,"8"meaning the data is 8 byte
and you need to parse it \x84\xb3'4\xf0\x84c8. I use python it have a function struct.unpack(fmt,x)
in this example i just do one point sweep and i got two float data so sthat struct.unpack (<2f,a)
a=\x84\xb3'4\xf0\x84c8,  in the c#  it got something like that i don't know detaily, you can google it.
Hope that can help someone like 3weeks ago me.
 

 

0 Kudos
Message 9 of 9
(5,608 Views)