FAQs from Rohde & Schwarz

Loading an S-parameter file from a PC into a memory trace

Question

I have an S-parameter file on my PC and want to load it into a memory trace of my network analyzer.

How can I do this via remote control?

Answer

You need the attached program written in VisualBasicApplication under EXCEL.

If you have an NI-VISA driver installed and a GPIB or TCP/IP connection to the network analyzer, you can run the program yourself.

The program searches for the TEST.S1P file in 'C:\Work\'

The important part is the following:

Rem Open the S-parameter file Test.S1P and read the content

Set fs = CreateObject("Scripting.FileSystemObject")

Set f = fs.GetFile("C:\work\Test.S1P")

Rem s is the number of bytes with data Test.S1P file

s = f.Size

Open "C:\work\Test.S1P" For Input As #1

Do While Not EOF(1)

Text1 = Input(s, #1)

Loop

Close #1

Rem Create the data to send to the ZVL

Rem l is the number of bytes needed for the length information of the data

l = Len(s)

Text2 = "#" + CStr(l) + CStr(s) + Text1

Rem Send the data in a file to the ZVL

commandStr = "MMEMory:DATA 'C:\Temp\Test.S1P', " + Text2

countsend = Len(commandStr)

status = viWrite(vinstr, commandStr, countsend, count)

Rem Open the file in a memory trace

commandStr = "MMEM:LOAD:TRAC 'TRC1','c:\temp\test.s1p'"

countsend = Len(commandStr)

status = viWrite(vinstr, commandStr, countsend, count)

Name
Type
Version
Date
Size
XLS_VISA_LAN_GPIB_ZVL_Transmit_S1P_From_PC-MEM.xls
Type
FAQ
Version
Date
05-Dec-2012
Size
242 kB
Test.s1p
Type
FAQ
Version
Date
05-Dec-2012
Size
15 kB