|
|
|
@ -33,7 +33,7 @@ namespace Mesnac.PlcUtils
|
|
|
|
|
string str = System.Environment.CurrentDirectory;
|
|
|
|
|
str = str + "\\Mesnac.PlcUtils.dll";
|
|
|
|
|
Assembly assembly = Assembly.LoadFile(str); // 加载程序集(EXE 或 DLL)
|
|
|
|
|
string AssemName = "JSSD.PolarBind.Plc.Impl." + plcType.GetDescription();
|
|
|
|
|
string AssemName = "Mesnac.PlcUtils.Impl." + plcType.GetDescription();
|
|
|
|
|
var obj = assembly.CreateInstance(AssemName, true);
|
|
|
|
|
plcInstance = obj as IPlc;
|
|
|
|
|
if (plcInstance == null)
|
|
|
|
@ -71,7 +71,14 @@ namespace Mesnac.PlcUtils
|
|
|
|
|
|
|
|
|
|
public bool readBoolValue(string address)
|
|
|
|
|
{
|
|
|
|
|
return plcInstance.readBoolByAddress(address);
|
|
|
|
|
if(plcInstance != null)
|
|
|
|
|
{
|
|
|
|
|
return plcInstance.readBoolByAddress(address);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|