Skip to content

Commit

Permalink
fix(plc4j/examples/ads): Fixed some wrongly named constants
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdutz committed Feb 3, 2023
1 parent e139d4d commit 795fc77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public enum DeviceManagerConstants {
SMB(0x00000007),
TwinCat(0x00000008),
Software(0x0000000A),
COU(0x0000000B),
CPU(0x0000000B),
Memory(0x0000000C),
FirewallWinCE(0x0000000E),
FileSystemObject(0x00000010),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public static void main(String[] args) {
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");
Expand Down

0 comments on commit 795fc77

Please sign in to comment.