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
95
Information
Upon the creation of free-running tasks by means of CreateTask, the ap-
plication takes over co-responsibility for the stability of the system.
After the recurrence of the exit function (end of the application), make sure
that all created tasks have been terminated or these no longer execute
calls of the offered APIs (among others, DataRecApi)!
14.7.5 Evaluation of recordings
The following code supplements the preceding examples by the evaluation
of recordings that have been carried out. The parameters of the PrintSam-
ples example function specify the buffer area to be read in the vertical (pos,
cnt) and horizontal direction (maxVarCnt).
static void PrintSamples(int maxVarCnt, DataRecApiPos pos, int cnt) {
char *pBuf;
DataRecApiSample *pSample;
DataRecApiVarSample *p;
int actVarCnt, i, k, rc;
pBuf = malloc(DataRecApiUtilGetSampleMemSize(maxVarCnt, cnt));
ReturnIfNot(pBuf != 0);
pSample = (DataRecApiSample *)pBuf;
rc = DataRecApiReadSamples(sP1Id, maxVarCnt, &pos, pSample, &cnt);
ReturnIfNot(rc == DataRecApiResultOk);
for (i = 0; i < cnt; ++i) {
actVarCnt = pSample->header.varSampleCnt;
printf("[%d] recNo=%d, varSampleCnt=%d, timeStampUs=[%s]:\n",
i,
pSample->header.sampleRecNo,
actVarCnt,
TimeStamp2DateStr(pSample->timeStampUs));
for (k = 0, p = pSample->varSamples; k < actVarCnt; ++k, ++p) {
switch (p->type) {
case DataRecApiVarType_SINT32:
printf(" name=%s, value=%d (size=%d)\n", VarIdToName(p->var), p-
>value.valSINT32, p->size);
break;
case DataRecApiVarType_REAL:
printf(" name=%s, value=%f (size=%d)\n", VarIdToName(p->var), p-
>value.valREAL, p->size);
break;
default:
printf(" name=%s, value=%" PRIx64 " (type=%d, size=%d)\n",
VarIdToName(p->var), p->value.valNONE, p->type, p->size);
break;
}
}
pSample = (DataRecApiSample *)&pSample->varSamples[maxVarCnt];
}
free(pBuf);
}
Example call
PrintSamples(5, DataRecApiPosNewest, 1000);