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=Out_ON(G)
function G=Out_ON(G)
%% Set Output_ON
% Objekt
OBJ_bin =uint8(54); % Output ON

% Maske Datenbyte1
Maske_bin =uint8(hex2dec('01'));

% Steuerbyte Datenbyte2
Steuerbyte_bin =uint8(hex2dec('01'));%hex, Output ON 

% checksum
CS_bin = swapbytes( uint16(G.SD_bin) +uint16(G.DN_bin) +uint16(OBJ_bin)...
         +uint16(Maske_bin) +uint16(Steuerbyte_bin) );

% Tellegramm Output ON
G.T_Out_ON = uint8([...
             G.SD_bin G.DN_bin OBJ_bin Maske_bin Steuerbyte_bin ...
             typecast(CS_bin, 'uint8') ]);
fwrite(G.s,G.T_Out_ON);

Contact us