Code covered by the BSD License  

Highlights from
Powersupply EA PSI 900 VCP _USB Control Exsample

Powersupply EA PSI 900 VCP _USB Control Exsample

by

 

Control EA PSI 9000 Powersupply with Instrument Toolbox

G=SetI_soll(G)
function G=SetI_soll(G)
%% Set I_soll
% Objekt
OBJ_bin =uint8(51); % Sollwert I

I_bin1    =  uint8(fix(G.I_soll/G.I_nenn*100) );
I_bin2    =  uint8((G.I_soll/G.I_nenn*100 -fix(G.I_soll/G.I_nenn*100))*256);


CS_bin = swapbytes( uint16(G.SD_bin) +uint16(G.DN_bin) +uint16(OBJ_bin)...
         +uint16(I_bin1) +uint16(I_bin2));
     
% Tellegramm SetI_soll
G.T_SetI_soll = uint8([...
                G.SD_bin G.DN_bin OBJ_bin  I_bin1 I_bin2 ...
                typecast(CS_bin, 'uint8') ]);
fwrite(G.s,G.T_SetI_soll);

Contact us