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
93
if (sP1Id == DataRecApiNoId) { /* create profile */
strcpy(info.name, scProfileName);
info.size = 1000;
info.maxVarCnt = 5;
info.bufType = DataRecApiBufTypeContinuous;
info.level = DataRecApiLevelApplRt;
info.autoStart = 0;
rc = DataRecApiCreateProfile(&info, &sP1Id);
ReturnIfNot(rc == DataRecApiResultOk && sP1Id != DataRecApiNoId);
snprintf(varPath, sizeof varPath, "APPL.MEM.%s", scVarNameTemp);
rc = DataRecApiAddVar(sP1Id, varPath, 0, &sTempId);
ReturnIfNot(rc == DataRecApiResultOk && sTempId != DataRecApiNoId);
snprintf(varPath, sizeof varPath, "APPL.MEM.%s", scVarNamePres);
rc = DataRecApiAddVar(sP1Id, varPath, 0, &sPresId);
ReturnIfNot(rc == DataRecApiResultOk && sPresId != DataRecApiNoId);
{
DataRecApiContext ctx;
ctx.intervalUs = 2000000;
ctx.priority = 16;
ctx.affinity = -1;
rc = DataRecApiSetRecContext(sP1Id, &ctx);
ReturnIfNot(rc == DataRecApiResultOk);
}
} else { /* profile restored */
rc = DataRecApiStopRecording(sP1Id);
}
sRun = 1;
sStarted = 0;
sTerminated = 0;
sTaskHdl = CreateTask("LowPriorTask", LowPriorTask, 0, 24, 4096);
ReturnIfNot(sTaskHdl != 0);
}
/
****************************************************************************/
static void StartRecording() {
DataRecApiResult rc;
int ok;
rc = DataRecApiStartRecording(sP1Id);
ReturnIfNot(rc == DataRecApiResultOk);
ok = ResumeTask(sTaskHdl); ReturnIfNot(ok);
sStarted = 1;
}
/
****************************************************************************/
static void StopRecording() {
DataRecApiResult rc;
DataRecApiPos pos;
sRun = 0; /* tell LowPriorTask to terminate */
rc = DataRecApiStopRecording(sP1Id);
ReturnIfNot(rc == DataRecApiResultOk);
}
/
****************************************************************************/
static void ExitRecording() {
if (sStarted) {
while (!sTerminated) {
LogApiTrace(traceid, "waiting for LowPriorTask to terminate...");
sleep(1/*secs*/);
}
}
}
/
****************************************************************************/