function Unit = centralina(IDcentralina,conn,FileName) text = 'centralina function started'; fileID = fopen(FileName,'a'); fmt = '%s \r'; fprintf(fileID,fmt,text); comando = ['select type_id from units where name = ''' IDcentralina ''' ']; curs = exec(conn,comando); curs = fetch(curs); Type = cell2mat(curs.Data); if Type == 1 Unit = 'GEI G801'; elseif Type == 2 Unit = 'GEI G802'; elseif Type == 3 Unit = 'GEI G201'; elseif Type == 4 Unit = 'GEI G301'; elseif Type == 5 Unit = 'GEI D2W'; elseif Type == 6 Unit = 'ASE GFLOW'; elseif Type == 7 Unit = 'Nesa'; elseif Type == 8 Unit = 'GEI MUSA'; elseif Type == 9 Unit = 'Nesa evolution'; elseif Type == 10 Unit = 'Campbell CRX1000'; elseif Type == 46 Unit = 'Campbell CR500'; elseif Type == 18 Unit = 'SISGEO WR-GW-868'; elseif Type == 39 Unit = 'SwissMetNet'; end text = 'centralina function executed correctly'; fprintf(fileID,fmt,text); fclose(fileID);