2016-01-12 update 2

This commit is contained in:
parallelbgls@outlook.com
2016-01-12 17:13:49 +08:00
parent 3d67116006
commit 4073878581

View File

@@ -55,7 +55,7 @@ namespace ModBus.Net.Siemens
string[] splitString = address.Split(' '); string[] splitString = address.Split(' ');
string head = splitString[0]; string head = splitString[0];
string tail = splitString[1]; string tail = splitString[1];
if (head.Substring(0, 2) == "DB") if (head.Length > 1 && head.Substring(0, 2) == "DB")
{ {
head = head.Substring(2); head = head.Substring(2);
return new KeyValuePair<int, int>(int.Parse(tail), return new KeyValuePair<int, int>(int.Parse(tail),