

delete(gcf);

fclose('all');

clear all
close all

Cmd = 2; %Close Trefoil

canch1 = canChannel('PEAK-System', 'PCAN_USBBUS1');

configBusSpeed(canch1, 125000);

start(canch1)

EID = AssembleCanID(4, 10, 0); 

messageout = canMessage(EID, true, 2);

pack(messageout,1, 0, 8, 'LittleEndian');
pack(messageout,Cmd, 8, 8, 'LittleEndian');

transmit(canch1, messageout);