function DatiElabTiltLinkHRH = LastElab_bisTLHRH(conn,NodoTiltLinkHRH,rTLHRH,...
    datainiTLHRH,tempoiniTLHRH,IDcentralina,DTcatena,FileName)

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

NTiltLinkHRH = cell2mat(NodoTiltLinkHRH(:,2)); 
NodeType = 'Tilt Link HR H';
ii = 1; % contatore
col = 13; % contatore colonne
while ii <= rTLHRH
     ini_col = col-12;
     nN = num2str(NTiltLinkHRH(ii,1));
     % Scarico di dati di spostamenti
     comando = ['select EventDate, EventTime, YShift, ZShift, Y, Z, AlfaX, AlfaY, T_node, speed, speed_local, acceleration, acceleration_local from ElabDataView where EventDate = ''' ...
         datainiTLHRH ''' and EventTime >= ''' tempoiniTLHRH ''' and  UnitName = ''' IDcentralina ''' and ToolNameID = '''...
         DTcatena ''' and NodeType = ''' NodeType ''' and NodeNum = ''' nN ''' '];
     curs = exec(conn,comando);
     curs = fetch(curs);
     DATnodoTLHRHd = curs.Data;  
     % Scarico di dati di spostamenti
     comando = ['select EventDate, EventTime, YShift, ZShift, Y, Z, AlfaX, AlfaY, T_node, speed, speed_local, acceleration, acceleration_local from ElabDataView where EventDate > ''' ...
         datainiTLHRH ''' and  UnitName = ''' IDcentralina ''' and ToolNameID = '''...
         DTcatena ''' and NodeType = ''' NodeType ''' and NodeNum = ''' nN ''' '];
     curs = exec(conn,comando);
     curs = fetch(curs);
     DATnodoTLHRH = curs.Data; 
     [~,c1] = size(DATnodoTLHRH);
     [~,c2] = size(DATnodoTLHRHd);
     if c1 == c2
         DATnodoTLHRH = [DATnodoTLHRHd; DATnodoTLHRH];
     elseif c1 < c2 % solo giorno di riferimento
         DATnodoTLHRH = DATnodoTLHRHd;
     end
     DatiElabTiltLinkHRH(:,ini_col:col) = DATnodoTLHRH(:,:);              
     col = col+13;
     ii = ii+1;
end

text = 'LastElab_bisTLHRH function worked correctly for Tilt Link HR H';
fprintf(fileID,fmt,text);
fclose(fileID);
end