We are trying to communicate to the HP 436A over IEEE 488 using MATLAB. We want to be able to set the units the power is measured in, and read out the power measurements. We have 2 simple lines of code:
fprintf(power1_obj, '9D+T'); % controls power meter - sets it to read in dB and puts it in trigger mode
power_1 = str2double(fscanf(power1_obj)); % read the power *** this line does not work
the first line works, we are able to change D to A or other ascii characters to change the units of the power meter. However we are unable to read the power out. I think it has something to do with the "eol" command sent by the power meter (I read a couple posts about this but not too sure what it is or how to look for it) because when we run the program the power meter portion always times out. Any suggestions on how to fix this?
I am fairly non experienced in this area so can if you know how to help me please try to break down the problem into its simplest form. Thanks for your time.
Matt Deibel
fprintf(power1_obj, '9D+T'); % controls power meter - sets it to read in dB and puts it in trigger mode
power_1 = str2double(fscanf(power1_obj)); % read the power *** this line does not work
the first line works, we are able to change D to A or other ascii characters to change the units of the power meter. However we are unable to read the power out. I think it has something to do with the "eol" command sent by the power meter (I read a couple posts about this but not too sure what it is or how to look for it) because when we run the program the power meter portion always times out. Any suggestions on how to fix this?
I am fairly non experienced in this area so can if you know how to help me please try to break down the problem into its simplest form. Thanks for your time.
Matt Deibel
I'm too familiar with Matlab but what might be a good way to break it down is to try sending SCPI command equivalents to the instrument. You can do this by using the Agilent I/O Library Suites. Any drivers or functions in Matlab that you use eventually breaks down to low level SCPI commands so if the commands work by itself, you can monitor the data coming back via the BUS using the I/O monitor and see whether the Matlab program is parsing/interpreting the data in the right way.
Steven