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
89
****************************************************************************/
void ModuleExit() {
MemApiRemoveVar(scVarNamePres);
MemApiRemoveVar(scVarNameTemp);
MemApiExit();
LogApiTrace(traceid, "TestDataRecApp unloaded");
LogApiRemoveId(traceid);
}
/
****************************************************************************/
void ModuleStart() {
DataRecApiResult rc;
LogApiTrace(traceid, "Starting TestDataRecApp");
rc = DataRecApiStartRecording(sP1Id);
ReturnIfNot(rc == DataRecApiResultOk);
}
/
****************************************************************************/
void ModuleStop() {
DataRecApiResult rc;
LogApiTrace(traceid, "Stopping TestDataRecApp");
rc = DataRecApiStopRecording(sP1Id);
ReturnIfNot(rc == DataRecApiResultOk);
}
/
****************************************************************************/
void ModuleCallback(UserFuncParam *arg, uint32_t provArg) {
DataRecApiResult rc;
rc = DataRecApiSampleValues(sP1Id);
ReturnIfNot(rc == DataRecApiResultOk);
sTemp += 1;
sPres += 0.1;
}
14.7.2 Profile with automatic recording
The following example builds upon the aforementioned by adding two points:
For one thing, recording takes place automatically. For that to happen, a
sampling in 10ms intervals is set with DataRecApiSetRecContext, while fur-
thermore a start delay of 2 seconds and a recording time of 5 seconds is set
with DataRecApiSetRecCount. For another, a callback from the recording
into the application is configured for the purpose of minimum-maximum de-
termination.
void ModuleInit() {
DataRecApiInfo info;
DataRecApiResult rc;
char varPath[80];
DataRecApiContext ctx;
DataRecApiCount cnt;
/* for committed lines see example "manual recording" */
snprintf(varPath, sizeof varPath, "APPL.MEM.%s", scVarNamePres);
rc = DataRecApiAddVar(sP1Id, varPath, 0, &sPresId);
ReturnIfNot(rc == DataRecApiResultOk && sPresId != DataRecApiNoId);
ctx.intervalUs = 10000;
ctx.priority = 16;
ctx.affinity = -1;
rc = DataRecApiSetRecContext(sP1Id, &ctx);
ReturnIfNot(rc == DataRecApiResultOk);
cnt.startDelayCnt = 200;
cnt.durationCnt = 500;
rc = DataRecApiSetRecCount(sP1Id, &cnt);










