OSCAT Forum

oscat.lib => oscat.lib fuer CoDeSys 3 => Thema gestartet von: Elko am 25. Juni 2018, 19:41:57

Titel: DLOG_STORE_FILE_CSV
Beitrag von: Elko am 25. Juni 2018, 19:41:57
Hallo,

ich möchte Prozessdaten aus einer Produkttestanlage in einer Laborumgebung loggen.

Ich habe folgendes Problem.
Eine CSV Datei wird erzeugt nur nach jeder Minute geschlossen und eine neue begonnen. Leider geht der Testvorgang über mehrere Stunden wo alle 10 bis 15 Minuten einmal die aktuellen Daten geloggt werden.

Mach ich ein Fehler, oder gibt es ein Parameter in der diese Funktion eingestellt werden muss?

Danke im Voraus.


[gelöscht durch Administrator]
Titel: Re: DLOG_STORE_FILE_CSV
Beitrag von: peewit am 25. Juni 2018, 22:43:15
hallo

deine mitteilung habe ich nicht so ganz verstanden
aber ich fang mal an...


durch das #r im dateinamen ergibt sich jede neue minute eine neue datei

trig_m dient zum manuellen auslösen einer Datenaufzeichnung
trigt_t dient zum automatischen aufzeichnen nach einer gewissen vergangenen zeit

wenn du innerhalb der minute keine datenaufzeichnung auslöst dann ist die datei logischerweise auch ohne daten

wann löst du denn nun trig_m aus und wie oft ?
 
Titel: Re: DLOG_STORE_FILE_CSV
Beitrag von: Elko am 26. Juni 2018, 17:12:59
Hallo

danke für die Antwort, hat mich bereits weitergebracht.

Das Problem bestand darin, dass jede Minute eine Datei erzeugt wird. "trig_m" setze ich in einer Ablaufsteuerung. Aber es lag an dem #R im Dateiname, dass habe ich in der Bibliothek-Dokumentation überlesen.

Vielen Dank
Titel: Re: DLOG_STORE_FILE_CSV
Beitrag von: juhataipale am 22. August 2018, 16:53:43
Hello,

from where I can find the demo for DLOG_STORE_FILE_CSV or how I can get it to my codesys 3?
I red somewhere that demos are hidden somehow, but I cannot find them anywhere.

Inside OSCAT Network, there is folder DEMO, but there is only demo of WEATHER station or so.

I can not get my CSV writing to work.

Attached is picture of my setup.
I have tried also other filepaths. Structs are there.

For my understanding it should create a csv-file when I trigg manually, but no file is created.

[gelöscht durch Administrator]
Titel: Re: DLOG_STORE_FILE_CSV
Beitrag von: peewit am 23. August 2018, 07:56:55
hello

the oscat_network library of codesys store does not contain the demo programs
you can export the demo programs yourself from the codesys 2.x library or you take them from the attached zip file.


about your problem

did you connect a real running clock to DTI?
you never get an error with ERROR_T and ERROR_C?

the data is first collected in an internal buffer and only written to a file after certain criteria.

disable "enable" after some data recordings (trig_m).
the file should be written in any case

maybe the file will be written to a different location than you think?



[gelöscht durch Administrator]
Titel: Re: DLOG_STORE_FILE_CSV
Beitrag von: juhataipale am 23. August 2018, 19:43:21
hello

the oscat_network library of codesys store does not contain the demo programs
you can export the demo programs yourself from the codesys 2.x library or you take them from the attached zip file.


about your problem

did you connect a real running clock to DTI?
you never get an error with ERROR_T and ERROR_C?

the data is first collected in an internal buffer and only written to a file after certain criteria.

disable "enable" after some data recordings (trig_m).
the file should be written in any case

maybe the file will be written to a different location than you think?

Thank you for the programs and quick response!
I got the programs work with codesys 2.3.

The DTI is ticking yes, though the time is not real time. I have not found yet a way to get systemtime, since Raspberry does not have RTC.
I am now using RTC function block and fixing the time with PDT.

The location.
Oh yes, I found couple files in PlcLogic folder, even I am using only '/' for path.

So, after many try and error I found combination of parameters that made it write.
But now, I changed only the filename and tried again and it is not working again.

TRIG_M I only need to trig, not keep it TRUE all the time?
Will the program write the file immediately, or once the buffer is full?

Do I need the STRUCTS: DLOG_DATA, NW_BUF_LONG, UNI_CIRCULAR_BUFFER_DATA, inside my Application? Or is it enough they just exist in the library and OSCAT NETWORK library is there?

What about GVL Constants (NETWORK_BUFFER_LONG_SIZE, variable). Does it need to be in project or it is enough it is inside library?

-Juha

[gelöscht durch Administrator]
Titel: Re: DLOG_STORE_FILE_CSV
Beitrag von: peewit am 24. August 2018, 10:35:58
hello

TRIG_M
with every positive edge data are stored

STRUCTS: DLOG_DATA, NW_BUF_LONG, UNI_CIRCULAR_BUFFER_DATA, NETWORK_BUFFER_LONG_SIZE
it must only be available within the included library


if you restart the sps or make changes online while the datalogger is active, the current file may remain blocked.
you should always enable = false in front of these actors before. this can probably be one of the reasons