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=SetP_soll(G)
function G=SetP_soll(G)
%% Set I_soll
% Objekt
OBJ_bin =uint8(52); % Sollwert P

P_bin1    =  uint8(fix(G.P_soll/G.P_nenn*100) );
P_bin2    =  uint8((G.P_soll/G.P_nenn*100 -fix(G.P_soll/G.P_nenn*100))*256);


CS_bin = swapbytes( uint16(G.SD_bin) +uint16(G.DN_bin) +uint16(OBJ_bin)...
         +uint16(P_bin1) +uint16(P_bin2));
     
% Tellegramm SetP_soll
G.T_SetP_soll = uint8([...
                G.SD_bin G.DN_bin OBJ_bin  P_bin1 P_bin2 ...
                typecast(CS_bin, 'uint8') ]);
fwrite(G.s,G.T_SetP_soll);

Contact us