Sync from remote server: 2025-10-12 18:56:41
This commit is contained in:
45
RSN/LastElab_bisTrL.m
Executable file
45
RSN/LastElab_bisTrL.m
Executable file
@@ -0,0 +1,45 @@
|
||||
function DatiElabTriggerLink = LastElab_bisTrL(conn,NodoTriggerLink,rTrL,datainiTrL,tempoiniTrL,IDcentralina,DTcatena,FileName)
|
||||
|
||||
text = 'LastElab_bisTrL function started';
|
||||
fileID = fopen(FileName,'a');
|
||||
fmt = '%s \r';
|
||||
fprintf(fileID,fmt,text);
|
||||
|
||||
NTriggerLink = cell2mat(NodoTriggerLink(:,2));
|
||||
NodeType = 'Trigger Link';
|
||||
ii = 1; % contatore
|
||||
col = 3; % contatore colonne
|
||||
while ii <= rTrL
|
||||
ini_col = col-2;
|
||||
nN = num2str(NTriggerLink(ii,1));
|
||||
% Scarico di dati di spostamenti - giorno X
|
||||
comando = ['select EventDate, EventTime, X from ElabDataView where EventDate = ''' ...
|
||||
datainiTrL ''' and EventTime >= ''' tempoiniTrL ''' and UnitName = ''' IDcentralina ...
|
||||
''' and ToolNameID = ''' DTcatena ''' and NodeType = ''' NodeType ''' and NodeNum = ''' nN ''' '];
|
||||
curs = exec(conn,comando);
|
||||
curs = fetch(curs);
|
||||
DATnodoTrLd = curs.Data;
|
||||
% Scarico di dati di spostamenti - giorni successivi a X
|
||||
comando = ['select EventDate, EventTime, X from ElabDataView where EventDate >= ''' ...
|
||||
datainiTrL ''' and UnitName = ''' IDcentralina ''' and ToolNameID = ''' DTcatena ...
|
||||
''' and NodeType = ''' NodeType ''' and NodeNum = ''' nN ''' '];
|
||||
curs = exec(conn,comando);
|
||||
curs = fetch(curs);
|
||||
DATnodoTrL = curs.Data;
|
||||
[~,c1] = size(DATnodoTrL);
|
||||
[~,c2] = size(DATnodoTrLd);
|
||||
if c1 == c2
|
||||
DATnodoTrL = [DATnodoTrLd; DATnodoTrL];
|
||||
elseif c1 < c2 % solo giorno di riferimento
|
||||
DATnodoTrL = DATnodoTrLd;
|
||||
end
|
||||
DatiElabTriggerLink(:,ini_col:col) = DATnodoTrL(:,:);
|
||||
col = col+3;
|
||||
ii = ii+1;
|
||||
end
|
||||
|
||||
text = 'LastElab_bisTrL function worked correctly';
|
||||
fprintf(fileID,fmt,text);
|
||||
fclose(fileID);
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user