function BridgeDC_Callback(src,eventdata)

global BridgeDC LoadDC canch1 mode;

if(mode == 2)
  BridgeDC = src.Value;
  messageout = canMessage(AssembleCanID(SourceID(), 10, 0), true, 3);
  pack(messageout, 221, 0, 8, 'LittleEndian');
  pack(messageout, round(4096*BridgeDC), 8, 16, 'LittleEndian');
  transmit(canch1, messageout); 
  
  disp(['Bridge DC = ' num2str(BridgeDC) '    Load DC = ' num2str(LoadDC)]);
else
    src.Value = 1;
end

end

