Autor Thema: DLOG_STORE_FILE_CSV no file written to disk  (Gelesen 8132 mal)

0 Mitglieder und 1 Gast betrachten dieses Thema.

Offline PhilipInc

  • Newbie
  • *
  • Beiträge: 4
    • Profil anzeigen
DLOG_STORE_FILE_CSV no file written to disk
« am: 30. November 2015, 00:22:22 »
Hello,
I try to use the DLOG_STORE_FILE_CSV function to write some log to disk on Raspberry Pi device with Codesys V3. ERROR_T and ERROR_C have '0' in them but no file is written to disk.
Here is a part of my code:

   x1(X:= X, FMT:= '#A-#D-#H-#N:#R:#T', COLUMN:= 'Timestamp');
   x2(X:= X, STR:= log_text, COLUMN:= 'Message');
   x3(X:= X, STR:= 'INFO', COLUMN:= 'Category');
   x4(X:= X, STR:= strProjectName, COLUMN:= 'Project');
   x5(X:= X, STR:= strAppName, COLUMN:= 'POU');
   
   dLOG_CSV(
   X:= X,
   ENABLE:= ENABLE,
   TRIG_M:= TRUE,
   //TRIG_T:= 1,
   FILENAME:= 'log.csv',
   DTI:= curTimeDT,
   SEP:= 44,
   ERROR_C=> ERROR_code,
   ERROR_T=> ERROR_type);

I tried '/root/log.csv' it also doesn't work. I already created the file log.csv with 777 permissions at '/root' directory where Codesys Control works.

Offline PhilipInc

  • Newbie
  • *
  • Beiträge: 4
    • Profil anzeigen
Re: DLOG_STORE_FILE_CSV no file written to disk
« Antwort #1 am: 01. Dezember 2015, 14:39:27 »
Does anybody have any example of DLOG_STORE_FILE_CSV usage?

Offline PhilipInc

  • Newbie
  • *
  • Beiträge: 4
    • Profil anzeigen
Re: DLOG_STORE_FILE_CSV no file written to disk
« Antwort #2 am: 06. Dezember 2015, 23:15:28 »
I find out the problem: it writes after collect 4090 bytes in buffer only.
I cannot understand why. I use TRIG_T:=1 and TRIG_M:=TRUE.

Offline Raspbesys

  • Newbie
  • *
  • Beiträge: 2
    • Profil anzeigen
Re: DLOG_STORE_FILE_CSV no file written to disk
« Antwort #3 am: 09. Februar 2016, 21:52:19 »
Hello community,
I have a similar problem with my project. At the moment I am only running the PLC in simulation mode. Everything seems to be OK. The only thing is, that I do not see any file written to the disc. By the way… where can I find the file if no folder is specified?
Here is my small test program:
Declarations:
PROGRAM PLC_PRG
VAR
   a:REAL:=1;
   f_sin:REAL;
   f_cos:REAL;
     b_EnableStoreCSV:BOOL:=TRUE;
    b_SetRTC:bool;
   fb_StoreCSV:OSCAT_NETWORK.DLOG_STORE_FILE_CSV;
   st_DLogData:OSCAT_NETWORK.DLOG_DATA;
   Log_Sin:OSCAT_NETWORK.DLOG_REAL;
   Log_Cos:OSCAT_NETWORK.DLOG_REAL;
   c_RealTimeClock:OSCAT_BASIC.RTC_2;
   t_DateTime:DT;
END_VAR

Programm:
f_sin:=90*SIN(a);
f_cos:=90*COS(a);
a:=a+0.001;

c_RealTimeClock(SET:=b_SetRTC,
   SDT:=DT#2016-02-22-09:00:00,
   UDT => t_DateTime);

Log_Sin(VALUE:=f_Sin,
   N:=2,
   D:=,
   COLUMN:='Sin_Value',
   DELTA:=,
   X:=st_DLogData);

Log_Cos(VALUE:=f_Cos,
   N:=2,
   D:=,
   COLUMN:='Sin_Value',
   DELTA:=,
   X:=st_DLogData);

fb_StoreCSV(ENABLE:=b_EnableStoreCSV,
   TRIG_M:=,
   TRIG_T:=1,
   FILENAME:='TestCSV.csv',
   DTI:=t_DateTime,
   SEP:=44,
   ERROR_C:=,
   ERROR_T:=,
   X:=st_DLogData);

Offline peewit

  • Moderator
  • *****
  • Beiträge: 2 378
    • Profil anzeigen
Re: DLOG_STORE_FILE_CSV no file written to disk
« Antwort #4 am: 10. Februar 2016, 08:08:30 »
can you see an error code (ERROR_C , ERROR_T)

it may be that no files can be written in the simulation ?????

Offline Raspbesys

  • Newbie
  • *
  • Beiträge: 2
    • Profil anzeigen
Re: DLOG_STORE_FILE_CSV no file written to disk
« Antwort #5 am: 10. Februar 2016, 21:55:43 »
(Un)fortunately no error codes... I've also been thinking that it may not work in simulation mode. I will test it on the raspberry when I find some time for that.