function unitID = IDunit(IDcentralina,conn,FileName)

fileID = fopen(FileName,'a');
fmt = '%s \r';
text = 'IDunit function started';
fprintf(fileID,fmt,text);

comando = ['select id from units where name like ''' IDcentralina ''' '];
unitID = fetch(conn,comando);

text = 'Unit ID downloaded correctly and IDunit function closed';
fprintf(fileID,fmt,text);
fclose(fileID);

end