function DatiElabTiltLinkHR = LastElab_bisTLHR(conn,NodoTiltLinkHR,rTLHR,...
    datainiTLHR,tempoiniTLHR,IDcentralina,DTcatena,FileName)

NTiltLinkHR = cell2mat(NodoTiltLinkHR(:,2));   
NodeType = 'Tilt Link HR';
ii = 1; % contatore
col = 16; % contatore colonne
while ii <= rTLHR
      ini_col = col-15;
      nN = num2str(NTiltLinkHR(ii,1));
      % Scarico di dati di spostamenti
      comando = ['select EventDate, EventTime, XShift, YShift, ZShift, X, Y, Z, HShift, HShift_local, HShiftDir, T_node, speed, speed_local, acceleration, acceleration_local from ElabDataView where EventDate = ''' ...
        datainiTLHR ''' and EventTime >= ''' tempoiniTLHR ''' and  UnitName = ''' IDcentralina ''' and ToolNameID = '''...
        DTcatena ''' and NodeType = ''' NodeType ''' and NodeNum = ''' nN ''' '];
      curs = exec(conn,comando);
      curs = fetch(curs);
      DATnodoTLHRd = curs.Data;
      % Scarico di dati di spostamenti
      comando = ['select EventDate, EventTime, XShift, YShift, ZShift, X, Y, Z, HShift, HShift_local, HShiftDir, T_node, speed, speed_local, acceleration, acceleration_local from ElabDataView where EventDate > ''' ...
        datainiTLHR ''' and  UnitName = ''' IDcentralina ''' and ToolNameID = '''...
        DTcatena ''' and NodeType = ''' NodeType ''' and NodeNum = ''' nN ''' '];
      curs = exec(conn,comando);
      curs = fetch(curs);
      DATnodoTLHR = curs.Data;
      [~,c1] = size(DATnodoTLHR);
      [~,c2] = size(DATnodoTLHRd);
      if c1==c2
          DATnodoTLHR = [DATnodoTLHRd; DATnodoTLHR];
      elseif c1 < c2 % solo giorno di riferimento
          DATnodoTLHR = DATnodoTLHRd;
      end
      DatiElabTiltLinkHR(:,ini_col:col) = DATnodoTLHR(:,:);
      col = col+16;
      ii = ii+1;
end

text = 'LastElab_bisTLHR function worked correctly for Tilt Link HR V';
fileID = fopen(FileName,'a');
fmt = '%s \r';
fprintf(fileID,fmt,text);
fclose(fileID);
end