Skip to content

Commit

Permalink
chore(plc4j): Accidentally pushed a change to the Java driver
Browse files Browse the repository at this point in the history
  • Loading branch information
hutcheb committed Nov 13, 2023
1 parent 8e4ed85 commit 1e05d3e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ public static ModbusTagCoil of(String addressString) {
throw new IllegalArgumentException("Address must be less than or equal to " + REGISTER_MAXADDRESS + ". Was " + (address + PROTOCOL_ADDRESS_OFFSET));
}

String quantityString = matcher.group("quantity");
int quantity = quantityString != null ? Integer.parseInt(quantityString) : 1;
if ((address + quantity) > REGISTER_MAXADDRESS) {
throw new IllegalArgumentException("Last requested address is out of range, should be between " + PROTOCOL_ADDRESS_OFFSET + " and " + REGISTER_MAXADDRESS + ". Was " + (address + PROTOCOL_ADDRESS_OFFSET + (quantity - 1)));
}
String quantityString = matcher.group("quantity");
int quantity = quantityString != null ? Integer.parseInt(quantityString) : 1;
if ((address + quantity) > REGISTER_MAXADDRESS) {
throw new IllegalArgumentException("Last requested address is out of range, should be between " + PROTOCOL_ADDRESS_OFFSET + " and " + REGISTER_MAXADDRESS + ". Was " + (address + PROTOCOL_ADDRESS_OFFSET + (quantity - 1)));
}

if (quantity > 2000) {
throw new IllegalArgumentException("quantity may not be larger than 2000. Was " + quantity);
Expand Down

0 comments on commit 1e05d3e

Please sign in to comment.