This is my codes for base workspace in MATLAB. the codes turns ON the pump. BUT it does not work when i used this is GUI. can anyone help me on what modification should i do in order to make the pump to turn ON when it is controlled using GUI?
s = serial ('COM7');
set (s,'Baudrate',1200,'Parity','even');
set (s,'DataBits',8);
set (s,'Stopbits',1);
fopen(s);
txdata = ['E9';'01';'06';'58';'4C';'00';'C8';'01';'01';'DB'];
txdata_dec = hex2dec(txdata);
fwrite(s,txdata_dec,'unit8')
Its still not working. I think there might be smtg wrong with the commands, because the hex codes are the protocols for the pump.it is fixed.There are different commands for MATLAB GUI. they are not the same with base workspace commands. But i cant figure out which line. :-(
I did this ... I can send and recieve it.
s = serial ('/dev/ttyUSB0');
s.BaudRate = 9600;
s.Terminator = 'LF/CR';
fopen(s);
fprintf(s,'ls');
out = fscanf(s);
fclose(s)
delete(s)
clear s
I did this ... I can send and recieve it.
s = serial ('/dev/ttyUSB0');
s.BaudRate = 9600;
s.Terminator = 'LF/CR';
fopen(s);
fprintf(s,'ls');
out = fscanf(s);
fclose(s)
delete(s)
clear s[/Q
can i use these codes in GUI? But there is no any commands for converting hex codes using GUI?