-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathCppDataTypeTestProgram.cpp
More file actions
107 lines (85 loc) · 3.43 KB
/
CppDataTypeTestProgram.cpp
File metadata and controls
107 lines (85 loc) · 3.43 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/******************************************************************************
*
* 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.
*
* CppDataTypeTestProgram.cpp
*
* Created on: 21.02.2019
* Author: Eduard Münz, Oliver Warneke, Martin Boers
*
******************************************************************************/
/******************************************************************************/
/* INCLUDES */
/******************************************************************************/
#include "CppDataTypeTestProgram.hpp"
#include "Arp/System/Commons/Logging.h"
#include "Arp/System/Core/ByteConverter.hpp"
namespace CppDataTypeTest
{
void CppDataTypeTestProgram::Execute()
{
//implement program
if(outBoolean == true)
outBoolean = false;
else
outBoolean = true;
outInt8++; //SINT
outUint8++; //USINT
outStruct.outInt8++; //StructElement
outStruct.outUint8++; //StructElement
outInt16++; //INT
outUint16++;//UINT
outStruct.outInt16++; //StructElement
outStruct.outUint16++; //StructElement
outInt32++; //DINT
outUint32++;//UDINT
outStruct.outInt32++; //StructElement
outStruct.outUint32++; //StructElement
outInt64++; //LINT
outUint64++;//ULINT
outStruct.outInt64++; //StructElement
outStruct.outUint64++; //StructElement
outFloat32++;//REAL
outFloat64++;//LREAL
outStruct.outFloat32++; //StructElement
outStruct.outFloat64++; //StructElement
outByte++; //Byte
outWord++; //Word
outDword++; //DWORD
outLword++; //Lword
outStruct.outByte++; //StructElement
outStruct.outWord++; //StructElement
outStruct.outDword++; //StructElement
outStruct.outLword++; //StructElement
outString = "This is a standard IEC 61131 string (max. 80 char).";
outString420 = "This is a custom length string - in this case, with a maximum of 420 chars, but can be up to 32766 chars.";
outStruct.outString = "This is a standard IEC 61131 string (max. 80 char)."; //StructElement
outWString = "This is a standard IEC 61131 wide string (max. 80 char).";
outWString420 = "This is a custom length wide string - in this case, with a maximum of 420 chars, but can be up to 32766 chars.";
outStruct.outWString = "This is a standard IEC 61131 wide string (max. 80 char)."; //StructElement
for(int i=0; i < 10;i++)
{
if(outarrayBoolean[i] == true)
outarrayBoolean[i] = false;
else
outarrayBoolean[i] = true;
outarrayInt8[i]++; //SINT
outarrayUint8[i]++; //USINT
outarrayInt16[i]++; //INT
outarrayUint16[i]++; //UINT
outarrayInt32[i]++; //DINT
outarrayUint32[i]++; //UDINT
outarrayInt64[i]++; //LINT
outarrayUint64[i]++; //ULINT
outarrayFloat32[i]++; //REAL
outarrayFloat64[i]++; //LREAL
outarrayByte[i]++; //Byte
outarrayWord[i]++; //Word
outarrayDword[i]++; //DWORD
outarrayLword[i]++; //Lword
outarrayString[i] = "This is a standard IEC 61131 string (max. 80 chars).";
outarrayWString[i] = "This is a standard IEC 61131 wide string (max. 80 chars).";
}
}
} // end of namespace CppDataTypeTest