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 = 'G801'; elseif Type == 2 Unit = 'G802'; elseif Type == 3 Unit = 'G201'; elseif Type == 4 Unit = 'G301'; elseif Type == 5 Unit = 'D2W'; elseif Type == 6 Unit = 'GFLOW'; elseif Type == 7 Unit = 'Nesa'; elseif Type == 8 Unit = 'MUSA'; elseif Type == 9 Unit = 'Nesa evolution'; elseif Type == 10 Unit = 'CRX1000'; elseif Type == 11 Unit = 'LoRa 12 V'; elseif Type == 12 Unit = 'LoRa 6 V'; end text = 'centralina function executed correctly'; fprintf(fileID,fmt,text); fclose(fileID);