# CSVLogger

## `CSVLogger` (FB)

FUNCTION\_BLOCK CSVLogger

InOut:

| Scope       | Name                 | Type          | Initial       | Comment                                                                                                         |
| ----------- | -------------------- | ------------- | ------------- | --------------------------------------------------------------------------------------------------------------- |
| Input       | `xBlockSaveLogFile`  | `BOOL`        |               | Use this trigger to interrupt the write process of the file                                                     |
| Input       | `xDoSaveLogFile`     | `BOOL`        |               | <p>Trigger a write process to store the recorded files,<br>independent of the save intervall</p>                |
| Input       | `dtTimestamp`        | `DT`          |               | Timestamp to attach to the filename                                                                             |
| Input       | `pColumnData`        | `CAA.PVOID`   |               | Column Header Data                                                                                              |
| Input       | `pRowData`           | `CAA.PVOID`   |               | Row data entry                                                                                                  |
| Input Const | `tRecordIntervall`   | `TIME`        | TIME#1m0s0ms  | <p>The recording intervall defines the time of how often a<br>input should be saved</p>                         |
| Input Const | `tSaveIntervall`     | `TIME`        | TIME#10m0s0ms | The file save intervall of the recoreded entries                                                                |
| Input Const | `sFileExtension`     | `STRING`      | ‘.csv’        | The file extension name                                                                                         |
| Input Const | `sLogFileDirectory`  | `STRING(255)` | ‘./’          | File directory location                                                                                         |
| Input Const | `sLogFileNamePrefix` | `STRING`      | ‘DataLog’     | Prefix of the filename                                                                                          |
| Output      | `sLogFilePath`       | `STRING(255)` |               | The path to the filename                                                                                        |
| Output      | `xBusy`              | `BOOL`        |               | <p>Is <code>TRUE</code> if there is any file processing like opening or<br>writing/saving to the store file</p> |
| Output      | `eError`             | ERROR         |               |                                                                                                                 |
