Controlling Instruments Using the Serial Port

I am beginner of MATALB.. I am kind of confused with sending a command to power supplier. I want to control the power supplier (set the voltage) by MATLAB
s = serial('COM22');
fopen(s);
I think it is connected, I tried to send a command (command can be found here page 39). It is something like
<nrf> A number in any format. e.g. 12, 12·00, 1·2 e1 and 120 e-1 are all accepted as the
number 12. Any number, when received, is converted to the required precision
consistent with the use then rounded to obtain the value of the command.
<n> The number of the output (1 or 2) or associated status register to which the
command relates. On the XEL30-3DP, 1is the Master (right-hand output) and ‘2’ is
the Slave (left-hand output).
V<n> <nrf> : Set output <n> to <nrf> Volts
V<n>V <nrf> : Set output <n> to <nrf> Volts with verify
So I thought I can just use fprintf, but power supplier does not do anything.
fprintf(s,'*V1V 5')
Anyone can help me a guide or what to look it up? It is quite difficult since I do not have any experience with the MATLAB.

Answers (0)

Asked:

on 26 Jul 2016

Edited:

on 26 Jul 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!