You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2023/02/03 16:59:49 UTC

[plc4x] branch featrue/cdutz/arrays-with-special-variables updated: fix(plc4j/examples/ads): Fixed some wrongly named constants

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch featrue/cdutz/arrays-with-special-variables
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/featrue/cdutz/arrays-with-special-variables by this push:
     new 795fc77c93 fix(plc4j/examples/ads): Fixed some wrongly named constants
795fc77c93 is described below

commit 795fc77c93b9845d27a6ffa9d5e3d76366de28ec
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Fri Feb 3 17:59:40 2023 +0100

    fix(plc4j/examples/ads): Fixed some wrongly named constants
---
 .../java/examples/helloads/telemetry/DeviceManagerConstants.java      | 2 +-
 .../plc4x/java/examples/helloads/telemetry/HelloAdsTelemetry.java     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/plc4j/examples/hello-ads-telemetry/src/main/java/org/apache/plc4x/java/examples/helloads/telemetry/DeviceManagerConstants.java b/plc4j/examples/hello-ads-telemetry/src/main/java/org/apache/plc4x/java/examples/helloads/telemetry/DeviceManagerConstants.java
index e0d8e09259..e463b2efcb 100644
--- a/plc4j/examples/hello-ads-telemetry/src/main/java/org/apache/plc4x/java/examples/helloads/telemetry/DeviceManagerConstants.java
+++ b/plc4j/examples/hello-ads-telemetry/src/main/java/org/apache/plc4x/java/examples/helloads/telemetry/DeviceManagerConstants.java
@@ -29,7 +29,7 @@ public enum DeviceManagerConstants {
     SMB(0x00000007),
     TwinCat(0x00000008),
     Software(0x0000000A),
-    COU(0x0000000B),
+    CPU(0x0000000B),
     Memory(0x0000000C),
     FirewallWinCE(0x0000000E),
     FileSystemObject(0x00000010),
diff --git a/plc4j/examples/hello-ads-telemetry/src/main/java/org/apache/plc4x/java/examples/helloads/telemetry/HelloAdsTelemetry.java b/plc4j/examples/hello-ads-telemetry/src/main/java/org/apache/plc4x/java/examples/helloads/telemetry/HelloAdsTelemetry.java
index 02a29c68ae..da11b0524a 100644
--- a/plc4j/examples/hello-ads-telemetry/src/main/java/org/apache/plc4x/java/examples/helloads/telemetry/HelloAdsTelemetry.java
+++ b/plc4j/examples/hello-ads-telemetry/src/main/java/org/apache/plc4x/java/examples/helloads/telemetry/HelloAdsTelemetry.java
@@ -71,8 +71,8 @@ public class HelloAdsTelemetry {
                 logger.info("TwinCat Version: {}.{}.{}", twinCatMainVersion, twinCatMinorVersion, twinCatBuildVersion);
             }
             // Read the CPU Frequency and Utilization.
-            if(moduleTypeIdMap.containsKey(DeviceManagerConstants.COU.typeNumber)) {
-                Integer mdpId = moduleTypeIdMap.get(DeviceManagerConstants.COU.typeNumber);
+            if(moduleTypeIdMap.containsKey(DeviceManagerConstants.CPU.typeNumber)) {
+                Integer mdpId = moduleTypeIdMap.get(DeviceManagerConstants.CPU.typeNumber);
                 int addrCpuFrequency = (mdpId << 20) | 0x80010001;
                 int addrCpuUsage = (mdpId << 20) | 0x80010002;
                 int cpuFrequency = connection.readRequestBuilder().addTagAddress("value", String.format("0x0000F302/0x%8X:UDINT", addrCpuFrequency)).build().execute().get().getInteger("value");