-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathBufferedExchangeProgram.cpp
More file actions
40 lines (35 loc) · 1.17 KB
/
BufferedExchangeProgram.cpp
File metadata and controls
40 lines (35 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/******************************************************************************
*
* Copyright (c) Phoenix Contact GmbH & Co. KG. All rights reserved.
* Licensed under the MIT. See LICENSE file in the project root for full license information.
*
******************************************************************************/
#include "BufferedExchangeProgram.hpp"
#include "Arp/System/Commons/Logging.h"
#include "Arp/Base/Core/ByteConverter.hpp"
namespace BufferedExchange
{
void BufferedExchangeProgram::Execute()
{
//implement program
if (count % 1000 == 0)
{
log.Info("---------------- Execute: {0} ", count);
}
count++;
//Watch out this is blocking!
if(!error_LastCycle || retry )
{
if (!bufferedExchangeComponent.wD.SetData( count))
{
// ensure the log does not get flooded.
if(!error_LastCycle){
log.Warning("-------------- Instance:{1} DataLost: {0} ", count, this->GetFullName());
error_LastCycle = true;
}
}else{
error_LastCycle = false;
}
}
}
} // end of namespace BufferedExchange