From 6009d656ba3011374cdbf6defca5927d91739469 Mon Sep 17 00:00:00 2001 From: "parallelbgls@outlook.com" Date: Wed, 29 Apr 2015 10:29:42 +0800 Subject: [PATCH] 2015-04-29 update 1 Fix the bug in AddressFormater again --- Modbus.Net/ModBus.Net/AddressFormater.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modbus.Net/ModBus.Net/AddressFormater.cs b/Modbus.Net/ModBus.Net/AddressFormater.cs index 0dd9754..45dfa7d 100644 --- a/Modbus.Net/ModBus.Net/AddressFormater.cs +++ b/Modbus.Net/ModBus.Net/AddressFormater.cs @@ -15,7 +15,8 @@ namespace ModBus.Net { public override string FormatAddress(string area, int address) { - if (area.ToUpper().Substring(0,2) == "DB") + if (area.Length > 1 && + area.ToUpper().Substring(0,2) == "DB") { return area.ToUpper() + "." + "DB" + address; }