|
Hi all,
I am moderately experienced with MATLAB, but I'm brand new to the Instrument Control Toolbox and the world of automated instrument/test equipment control.
What I am trying to do is use SCPI (Standard Commands for Portable Instruments) commands in conjunction with MATLAB to control an Agilent/HP E3631 triple output power supply.
Specifically what I need to do is set an initial voltage out of the +25V output and then increment that voltage using a loop.
The standard command for setting the output I'm referring to is
Apply (P25V, <voltage>,<current>); using SCPI in conjunction with MATLAB you use the command fprintf(obj1, 'Apply P25v,<voltage>,<current>'); so what you are doing is printing a string as far as MATLAB is concerned.
I get that and it works fine, but it's expecting specific numeric values for <voltage> and <current>. What I need to do is make <voltage> a variable that I can increment in a loop.
I tied the following as an experiment; it assumes that communication with the power supply has been established and that the power supply is obj1 which all works fine. It is supposed to initially set the output of the +25V output to 0VDC and then incrementally increase that voltage to 7.5V in (15) .5V steps.
i=1
x=0
for i = 1:15;
%fprintf(obj1, 'Apply P25v,x,1.0');
x=x+.5
i=i+1
end
The “for-loop” in and of itself works fine, so the question becomes, “Can I substitute a variable for one of the parameters in the SCPI command?”
The power supply does not like the x where it is expecting a numeric value for <voltage>.
Can anyonegive me guidance or at least point me in an approriate direction?
|