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=Local(G)
function G=Local(G)
%% Local
% Objekt
OBJ_bin =uint8(54); % Remote / Local

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

% Steuerbyte Datenbyte2
Steuerbyte_bin =uint8(hex2dec('00')); %hex, Remote Aus 

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

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

Contact us