AnsweredAssumed Answered

Matlab programming of E5071C network analyzer

Question asked by stealthisnick on Sep 10, 2013
Latest reply on Sep 12, 2013 by stealthisnick
I'm trying to program a E5071C network analyzer connected via GPIB to a pc with matlab.
It's the first time I'm programming to remotely control a device so I'm facing some difficulties. My goal is to be able to do 4-port automatized cyclic measurements run by a matlab script after manual setting and calibration.
Reading the web help of the instrument and some exaple online, I was able to do some part of it. Hopefully it does what I am expecting, but anyway I'm not able to save measurements.

After succesfully connect with the device, this is what I'm doing:

fprintf(g, 'ABORT');   /* to abort eventual meaasurements and set the trigger to idle
fprintf(g, 'TRIG:SOUR BUS');   /*to set trigger generation via gpib command
fprintf(g, 'INITIATE:IMMEDIATE');   /* to set the initiation tate
fprintf(g, 'TRIG:SING');   /* to generate trigger and execute measurements
fprintf(g, '*OPC?');   /* query for status of measurements (result bit to be used to continue the script)
fprintf(g, ':MMEMory:STORe:SNP:TYPE:S4P 1, 2, 3, 4');   /*to select 4 port touchstone format
fprintf(g, ':MMEMory:STORe:SNP:FORMat RI');   /* to select real/imaginary format
fprintf(g, ':MMEMory:STORe:SNP:DATA D:\test.s4p');   /* to save data

The last command, to save data, fails. I tried several times changing the way the string containing the file name is written but I always get an error saying wrong format or missing parameter.
Can anyone give me a clue on where I'm doing a mistake? Is the previous part of the code correct?
Thanks in advance for any help.