You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
println("ERROR: Symbol ${element.symbol} has invalid datatype during IfEqual execution")
122
+
logger.error("Symbol ${element.symbol} has invalid datatype during IfEqual execution")
117
123
}
118
124
119
125
}else {
120
-
println("ERROR: Symbol ${element.symbol} not found during IfEqual execution")
126
+
logger.error("Symbol ${element.symbol} not found during IfEqual execution")
121
127
throwCancellationException("Error - IfEqual")
122
128
}
123
129
} else {
@@ -132,7 +138,7 @@ class PlcSimulation(
132
138
if (variable.datatype =="FLOAT32") {
133
139
var currentValue = memory.readHoldingRegister(variable.address.toInt(), 2)
134
140
if(currentValue.isEmpty()){
135
-
println("ERROR: Add Operation - Unable to get value of ${element.symbol} address ${variable.address}")
141
+
logger.error("Add Operation - Unable to get value of ${element.symbol} address ${variable.address}")
136
142
throwCancellationException("Error - Add")
137
143
}
138
144
val intValue = (( currentValue[1].toInt() shl 16) or (currentValue[0].toInt() and0xFFFF))
@@ -153,7 +159,7 @@ class PlcSimulation(
153
159
} else {
154
160
var currentValue = memory.readHoldingRegister(variable.address.toInt(), 1)
155
161
if(currentValue.isEmpty()){
156
-
println("ERROR: IfEqual Operation - Unable to get value of ${element.symbol} address ${variable.address}")
162
+
logger.error("IfEqual Operation - Unable to get value of ${element.symbol} address ${variable.address}")
157
163
throwCancellationException("Error - IfEqual")
158
164
}
159
165
//compare
@@ -172,7 +178,7 @@ class PlcSimulation(
172
178
AddressType.INPUT_REGISTER-> {
173
179
val currentValue = memory.readInputRegister(variable.address.toInt(), 1)
174
180
if(currentValue.isEmpty()){
175
-
println("ERROR: IfEqual Operation - Unable to get value of ${element.symbol} address ${variable.address}")
181
+
logger.error("IfEqual Operation - Unable to get value of ${element.symbol} address ${variable.address}")
176
182
throwCancellationException("Error - IfEqual")
177
183
}
178
184
//compare
@@ -188,11 +194,11 @@ class PlcSimulation(
188
194
}
189
195
AddressType.COIL-> {
190
196
if ( (element.value !="0"&& element.value !="1")) {
191
-
println("ERROR: Invalid value format on IfEqual. Symbol ${element.symbol} is of BOOL type and supports only values 0 or 1 not ${element.value} for comparison")
197
+
logger.error("Invalid value format on IfEqual. Symbol ${element.symbol} is of BOOL type and supports only values 0 or 1 not ${element.value} for comparison")
192
198
}
193
199
var currentValue = memory.readCoilStatus(variable.address.toInt(), 2)
194
200
if(currentValue.isEmpty()){
195
-
println("ERROR: IfEqual Operation - Unable to get value of ${element.symbol} address ${variable.address}")
201
+
logger.error("IfEqual Operation - Unable to get value of ${element.symbol} address ${variable.address}")
0 commit comments