%% Serial Port Open
s= serial('COM1'); %COM#
set(s, 'BaudRate', 19200);
set(s, 'Terminator', 'LF');
fopen(s);
%% CH_0
fprintf(s,'f0 20'); % Frequency F0 XXX.XXXXXXX ; Maximum setting: 171.1276031 MHz
fprintf(s,'p0 00000'); % Phase P0 00000 ; N*360/16384
fprintf(s,'v0 1000'); % Amplitude V0 ; 0 (off) to 1023 (no decimal point allowed)
%% CH_1
fprintf(s,'f1 20'); % Frequency F1 XXX.XXXXXXX ; Maximum setting: 171.1276031 MHz
fprintf(s,'p1 00000'); % Phase P1 XXXXX ; N*360/16384
fprintf(s,'v1 1000'); % Amplitude V1 XXXX ; 0 (off) to 1023 (no decimal point allowed)
%% CH_2
fprintf(s,'f2 20'); % Frequency F2 XXX.XXXXXXX ; Maximum setting: 171.1276031 MHz
fprintf(s,'p2 00000'); % Phase P2 XXXXX ; N*360/16384
fprintf(s,'v2 1000'); % Amplitude V2 XXXX ; 0 (off) to 1023 (no decimal point allowed)
%% CH_3
fprintf(s,'f3 20'); % Frequency F3 XXX.XXXXXXX ; Maximum setting: 171.1276031 MHz
fprintf(s,'p3 00000'); % Phase P3 XXXXX ; N*360/16384
fprintf(s,'v3 1000'); % Amplitude V3 XXXX; 0 (off) to 1023 (no decimal point allowed)
%% Serial Port Close
fclose(s);