Sync from remote server: 2025-10-12 18:56:41
This commit is contained in:
21
RSN/datainiziale.m
Executable file
21
RSN/datainiziale.m
Executable file
@@ -0,0 +1,21 @@
|
||||
% Funzione che scarica la data iniziale per quell'installazione
|
||||
function [date,time,unitID] = datainiziale(DTcatena,unitID,conn,FileName)
|
||||
|
||||
text = 'datainiziale function started';
|
||||
fileID = fopen(FileName,'a');
|
||||
fmt = '%s \r';
|
||||
fprintf(fileID,fmt,text);
|
||||
|
||||
unitID = num2str(cell2mat(unitID));
|
||||
comando = ['select prod_date from tools where unit_ID like ''' unitID ''' and name like ''' DTcatena ''' '];
|
||||
data_ini = fetch(conn,comando);
|
||||
stringa = cell2mat(data_ini);
|
||||
[lS] = length(stringa);
|
||||
date = stringa(1,1:10);
|
||||
time = stringa(1,12:lS);
|
||||
|
||||
text = ['Starting date for the download of data: ' date ' ' time '. datainiziale function closed.'];
|
||||
fprintf(fileID,fmt,text);
|
||||
fclose(fileID);
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user