Bug Fix
This commit is contained in:
@@ -85,6 +85,8 @@ namespace Modbus.Net
|
|||||||
{
|
{
|
||||||
if (Protocals.ContainsKey(protocalName))
|
if (Protocals.ContainsKey(protocalName))
|
||||||
protocalUnitReturn = Protocals[protocalName];
|
protocalUnitReturn = Protocals[protocalName];
|
||||||
|
else
|
||||||
|
{
|
||||||
//自动寻找存在的协议并将其加载
|
//自动寻找存在的协议并将其加载
|
||||||
var protocalUnit =
|
var protocalUnit =
|
||||||
Activator.CreateInstance(type.GetTypeInfo().Assembly.GetType(protocalName)) as TProtocalUnit;
|
Activator.CreateInstance(type.GetTypeInfo().Assembly.GetType(protocalName)) as TProtocalUnit;
|
||||||
@@ -93,6 +95,7 @@ namespace Modbus.Net
|
|||||||
protocalUnit.Endian = Endian;
|
protocalUnit.Endian = Endian;
|
||||||
Register(protocalUnit);
|
Register(protocalUnit);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return protocalUnitReturn ?? Protocals[protocalName];
|
return protocalUnitReturn ?? Protocals[protocalName];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user