I am just started to use Codesys v3 on Raspberry pi, and now I got stranded on using DLOG_STORE_FILE_CSV.
My code looks like:
PROGRAMPOU_mainVARÂ Â b_EnableStoreCSV:BOOL;Â Â b_SetRTC:BOOL;Â Â fb_StoreCSV:OSCAT_NETWORK.DLOG_STORE_FILE_CSV;Â Â st_DLogData:OSCAT_NETWORK.DLOG_DATA;Â Â Log_test:OSCAT_NETWORK.DLOG_STRING;Â Â Log_counter:OSCAT_NETWORK.DLOG_DINT;Â Â t_DateTime:DT;Â Â counter:DINT;Â Â dtu_getdt:RTCLK.GetDateAndTime;Â Â i_count1:DINT;END_VAR
b_EnableStoreCSV:=TRUE;dtu_getdt();IFi_count1>5THEN
  dtu_getdt.xExecute :=TRUE;
  IFdtu_getdt.xDoneTHEN
   //ohneFehlerabgeschlossen
   t_DateTime :=dtu_getdt.dtDateAndTime;
   dtu_getdt.xExecute :=FALSE;
   i_count1 :=0;
  END_IF
  IFdtu_getdt.xErrorTHEN
   ; // Fehlerbehandlung
   i_count1 :=0;
   dtu_getdt.xExecute :=FALSE;
  END_IFEND_IFi_count1 :=i_count1+1;
 Â
counter:=counter+1; Log_counter(VALUE:=counter,
  COLUMN:='Counter',
  DELTA:=,
  X:=st_DLogData);
      Â
Log_test(STR:='test',
  COLUMN:='result',
  X:=st_DLogData); fb_StoreCSV(ENABLE:=b_EnableStoreCSV,
     TRIG_M:=TRUE,
     TRIG_T:=5,
     FILENAME:='/home/pi/testfile.csv',
     DTI:=t_DateTime,
     SEP:=59, //ASCIIdelimiter
     ERROR_C:=,
     ERROR_T:=,
     X:=st_DLogData);
The code is triggeres every 200 ms in the task configuration, and it do run, but no files is saved anywhere.
When the code is running I can see that triggering is taking place, so is "add data", but my time stamp in DTI is strange, it shows UTC time and not my local time, can this be my problem?
I had try to change this time stamp to reflect the local time zone, but no luck to do so, but there must be a way?
It looks like that DTI is needed to be that correct time, but why? If it is sensitive to the right time stamping it must know the right time already, so why should I supply it with a precision time stamp?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am just started to use Codesys v3 on Raspberry pi, and now I got stranded on using DLOG_STORE_FILE_CSV.
My code looks like:
The code is triggeres every 200 ms in the task configuration, and it do run, but no files is saved anywhere.
When the code is running I can see that triggering is taking place, so is "add data", but my time stamp in DTI is strange, it shows UTC time and not my local time, can this be my problem?
I had try to change this time stamp to reflect the local time zone, but no luck to do so, but there must be a way?
It looks like that DTI is needed to be that correct time, but why? If it is sensitive to the right time stamping it must know the right time already, so why should I supply it with a precision time stamp?