User Documentation
Table Of Contents
- Table of contents
- 1 Introduction
- 2 Safety instructions
- 3 System overview
- 4 Operating behavior
- 5 Software installation
- 6 Configuration
- 7 Program development
- 8 Licensing
- 9 Device Administration (DevAdmin)
- 10 Software units
- 11 OPC UA Server
- 12 Node-RED
- 13 LongtermDiagnosticMonitor
- 14 Data recorder
- 15 Diagnostics
- 16 Maintenance
- 17 Technical data
- 18 Directives and standards
- 19 Appendix: Tutorial - creating an IEC project
- 20 Appendix: Addressing in the Ethernet (basics)
- 21 Appendix: Tutorial FoE
- 22 Appendix: Tutorial - call C function from IEC
- Index

Data recorder
System manual
2696790000/02/04.2020
96
Auxiliary functions for the formatting of time stamps and simple determina-
tion of variable names:
static const char *TimeStamp2DateStr(uint64_t timeStamp) {
static char sDateStr[80];
time_t secs, usecs;
struct tm *p;
/* seconds and μs since 1970-01-01 */
secs = (int)(timeStamp / 1000000);
usecs = (int)(timeStamp % 1000000);
p = localtime(&secs);
if (p != 0) {
snprintf(sDateStr, sizeof sDateStr, "%04u-%02u-%02u %02u:%02u:%02u.
%03u", p->tm_year+1900, p->tm_mon+1, p->tm_mday, p->tm_hour, p->tm_min, p-
>tm_sec, (unsigned)usecs);
}
else {
snprintf(sDateStr, sizeof sDateStr, "xxxx-xx-xx xx:xx:xx.xxx");
}
return sDateStr;
}
/
****************************************************************************/
static const char *VarIdToName(DataRecApiVarId varId) {
if (varId == sTempId) {
return scVarNameTemp;
}
if (varId == sPresId) {
return scVarNamePres;
}
return "unknown";
}