Error using serial/fopen (line 72) Open failed: Port: COM1 is not available. No ports are available. Use INSTRFIND to determine if other instrument objects are connected to the requested devic

4 views (last 30 days)
ss = serial('COM1','BaudRate',9600); fopen(ss); ss.Terminator = 'CR' tx ='AT'; tx1=char(13); tx2 ='AT+CMGF=1'; tx3 ='AT+CSCS="GSM"'; tx4 =input('format AT+CMGS="+919566344870"'); tx5 ='SubStation 1 Closed'; tx6=char(26);
fprintf(ss,'%s',tx); fprintf(ss,'%s',tx1); pause(1); fprintf(ss,'%s',tx2); fprintf(ss,'%s',tx1); pause(1); fprintf(ss,'%s',tx3); fprintf(ss,'%s',tx1); pause(1); fprintf(ss,'%s',tx4); fprintf(ss,'%s',tx1); pause(1); fprintf(ss,'%s',tx5); pause(1); fprintf(ss,'%s',tx6);
fclose(ss) delete(ss) clear ss

Answers (0)

Categories

Find more on Instrument Connection and Communication in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!